2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
6 * Copyright (c) 2008 VMware, Inc.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 * Texture formats definitions.
31 * \author Gareth Hughes
43 /** GLchan-valued formats */
45 extern const struct gl_texture_format _mesa_texformat_rgba
;
46 extern const struct gl_texture_format _mesa_texformat_rgb
;
47 extern const struct gl_texture_format _mesa_texformat_alpha
;
48 extern const struct gl_texture_format _mesa_texformat_luminance
;
49 extern const struct gl_texture_format _mesa_texformat_luminance_alpha
;
50 extern const struct gl_texture_format _mesa_texformat_intensity
;
53 #if FEATURE_EXT_texture_sRGB
54 /** sRGB (nonlinear) formats */
56 extern const struct gl_texture_format _mesa_texformat_srgb8
;
57 extern const struct gl_texture_format _mesa_texformat_srgba8
;
58 extern const struct gl_texture_format _mesa_texformat_sargb8
;
59 extern const struct gl_texture_format _mesa_texformat_sl8
;
60 extern const struct gl_texture_format _mesa_texformat_sla8
;
61 #if FEATURE_texture_s3tc
62 extern const struct gl_texture_format _mesa_texformat_srgb_dxt1
;
63 extern const struct gl_texture_format _mesa_texformat_srgba_dxt1
;
64 extern const struct gl_texture_format _mesa_texformat_srgba_dxt3
;
65 extern const struct gl_texture_format _mesa_texformat_srgba_dxt5
;
70 /** Floating point texture formats */
72 extern const struct gl_texture_format _mesa_texformat_rgba_float32
;
73 extern const struct gl_texture_format _mesa_texformat_rgba_float16
;
74 extern const struct gl_texture_format _mesa_texformat_rgb_float32
;
75 extern const struct gl_texture_format _mesa_texformat_rgb_float16
;
76 extern const struct gl_texture_format _mesa_texformat_alpha_float32
;
77 extern const struct gl_texture_format _mesa_texformat_alpha_float16
;
78 extern const struct gl_texture_format _mesa_texformat_luminance_float32
;
79 extern const struct gl_texture_format _mesa_texformat_luminance_float16
;
80 extern const struct gl_texture_format _mesa_texformat_luminance_alpha_float32
;
81 extern const struct gl_texture_format _mesa_texformat_luminance_alpha_float16
;
82 extern const struct gl_texture_format _mesa_texformat_intensity_float32
;
83 extern const struct gl_texture_format _mesa_texformat_intensity_float16
;
86 /** Signed fixed point texture formats */
88 extern const struct gl_texture_format _mesa_texformat_dudv8
;
89 extern const struct gl_texture_format _mesa_texformat_signed_rgba8888
;
90 extern const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev
;
93 /** \name Assorted hardware-friendly formats */
95 extern const struct gl_texture_format _mesa_texformat_rgba8888
;
96 extern const struct gl_texture_format _mesa_texformat_rgba8888_rev
;
97 extern const struct gl_texture_format _mesa_texformat_argb8888
;
98 extern const struct gl_texture_format _mesa_texformat_argb8888_rev
;
99 extern const struct gl_texture_format _mesa_texformat_rgb888
;
100 extern const struct gl_texture_format _mesa_texformat_bgr888
;
101 extern const struct gl_texture_format _mesa_texformat_rgb565
;
102 extern const struct gl_texture_format _mesa_texformat_rgb565_rev
;
103 extern const struct gl_texture_format _mesa_texformat_rgba4444
;
104 extern const struct gl_texture_format _mesa_texformat_argb4444
;
105 extern const struct gl_texture_format _mesa_texformat_argb4444_rev
;
106 extern const struct gl_texture_format _mesa_texformat_argb1555
;
107 extern const struct gl_texture_format _mesa_texformat_argb1555_rev
;
108 extern const struct gl_texture_format _mesa_texformat_rgba5551
;
109 extern const struct gl_texture_format _mesa_texformat_al88
;
110 extern const struct gl_texture_format _mesa_texformat_al88_rev
;
111 extern const struct gl_texture_format _mesa_texformat_rgb332
;
112 extern const struct gl_texture_format _mesa_texformat_a8
;
113 extern const struct gl_texture_format _mesa_texformat_l8
;
114 extern const struct gl_texture_format _mesa_texformat_i8
;
115 extern const struct gl_texture_format _mesa_texformat_ci8
;
116 extern const struct gl_texture_format _mesa_texformat_z24_s8
;
117 extern const struct gl_texture_format _mesa_texformat_s8_z24
;
118 extern const struct gl_texture_format _mesa_texformat_z16
;
119 extern const struct gl_texture_format _mesa_texformat_z32
;
122 /** \name YCbCr formats */
124 extern const struct gl_texture_format _mesa_texformat_ycbcr
;
125 extern const struct gl_texture_format _mesa_texformat_ycbcr_rev
;
128 /** \name Compressed formats */
130 #if FEATURE_texture_fxt1
131 extern const struct gl_texture_format _mesa_texformat_rgb_fxt1
;
132 extern const struct gl_texture_format _mesa_texformat_rgba_fxt1
;
134 #if FEATURE_texture_s3tc
135 extern const struct gl_texture_format _mesa_texformat_rgb_dxt1
;
136 extern const struct gl_texture_format _mesa_texformat_rgba_dxt1
;
137 extern const struct gl_texture_format _mesa_texformat_rgba_dxt3
;
138 extern const struct gl_texture_format _mesa_texformat_rgba_dxt5
;
142 /** \name The null format */
144 extern const struct gl_texture_format _mesa_null_texformat
;
148 extern const struct gl_texture_format
*
149 _mesa_choose_tex_format( GLcontext
*ctx
, GLint internalFormat
,
150 GLenum format
, GLenum type
);
154 _mesa_format_to_type_and_comps(const struct gl_texture_format
*format
,
155 GLenum
*datatype
, GLuint
*comps
);