summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pack.h
diff options
context:
space:
mode:
authorIago Toral Quiroga <[email protected]>2014-11-07 08:32:14 +0100
committerIago Toral Quiroga <[email protected]>2015-01-12 11:20:29 +0100
commit2ec8718dae126e6699640de37cbd950878635cbd (patch)
tree434e7c76fc136dfecc8a01a6949b885798cc0369 /src/mesa/main/pack.h
parentd71a1adff253aa75a3474723209c35831bb3f048 (diff)
mesa: Add helpers to extract GL_COLOR_INDEX to RGBA float/ubyte
We only use _mesa_make_temp_ubyte_image in texstore.c to convert GL_COLOR_INDEX to RGBA, but this helper does more stuff than this. All uses of this helper can be replaced with calls to _mesa_format_convert except for this GL_COLOR_INDEX conversion. This patch extracts the GL_COLOR_INDEX to RGBA logic to a separate helper so we can use that instead from texstore.c. In future patches we will replace all remaining calls to _mesa_make_temp_ubyte_image in the repository (related to compressed formats) with calls to _mesa_format_convert so we can remove _mesa_make_temp_ubyte_image and related functions. v2: - Remove ‘for’ loop initial declaration. They are only allowed in C99 or C11 mode. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/main/pack.h')
-rw-r--r--src/mesa/main/pack.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/main/pack.h b/src/mesa/main/pack.h
index 9988bea4fd1..ddba82eea54 100644
--- a/src/mesa/main/pack.h
+++ b/src/mesa/main/pack.h
@@ -165,4 +165,18 @@ _mesa_pack_luminance_from_rgba_integer(GLuint n, GLuint rgba[][4], bool rgba_is_
GLvoid *dstAddr, GLenum dst_format,
GLenum dst_type);
+extern GLfloat *
+_mesa_unpack_color_index_to_rgba_float(struct gl_context *ctx, GLuint dims,
+ const void *src, GLenum srcFormat, GLenum srcType,
+ int srcWidth, int srcHeight, int srcDepth,
+ const struct gl_pixelstore_attrib *srcPacking,
+ GLbitfield transferOps);
+
+extern GLubyte *
+_mesa_unpack_color_index_to_rgba_ubyte(struct gl_context *ctx, GLuint dims,
+ const void *src, GLenum srcFormat, GLenum srcType,
+ int srcWidth, int srcHeight, int srcDepth,
+ const struct gl_pixelstore_attrib *srcPacking,
+ GLbitfield transferOps);
+
#endif