From 3d305243938980af520c6d3e0ce02f4ee3a6126c Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sun, 30 Aug 2009 12:02:36 +0100 Subject: util: Auto generate pixel format accessor functions from This has several advantages over the u_ - not hand written - no intermediate memcpy of raw pixels - supports 4 ubytes in addition to floats - no need to pass a pipe_transfer It also has (hopefully temporary) limitations: - no support for YUV - no support for SRGB --- src/gallium/auxiliary/util/u_format.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/gallium/auxiliary/util/u_format.h') diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index b5504ebe05..7b5b7fcda5 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -111,4 +111,28 @@ const struct util_format_description * util_format_description(enum pipe_format format); +void +util_format_read_4f(enum pipe_format format, + float *dst, unsigned dst_stride, + const void *src, unsigned src_stride, + unsigned x, unsigned y, unsigned w, unsigned h); + +void +util_format_write_4f(enum pipe_format format, + const float *src, unsigned src_stride, + void *dst, unsigned dst_stride, + unsigned x, unsigned y, unsigned w, unsigned h); + +void +util_format_read_4ub(enum pipe_format format, + uint8_t *dst, unsigned dst_stride, + const void *src, unsigned src_stride, + unsigned x, unsigned y, unsigned w, unsigned h); + +void +util_format_write_4ub(enum pipe_format format, + const uint8_t *src, unsigned src_stride, + void *dst, unsigned dst_stride, + unsigned x, unsigned y, unsigned w, unsigned h); + #endif /* ! U_FORMAT_H */ -- cgit v1.2.3