mesa: replace gl_texture_format with gl_format
[mesa.git] / src / mesa / main / texformat.h
1 /*
2 * Mesa 3-D graphics library
3 * Version: 6.5.1
4 *
5 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
6 * Copyright (c) 2008 VMware, Inc.
7 *
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:
14 *
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
17 *
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.
24 */
25
26
27 /**
28 * \file texformat.h
29 * Texture formats definitions.
30 *
31 * \author Gareth Hughes
32 */
33
34
35 #ifndef TEXFORMAT_H
36 #define TEXFORMAT_H
37
38
39 #include "mtypes.h"
40 #include "formats.h"
41
42 #if 0
43 /** GLchan-valued formats */
44 /*@{*/
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;
51 /*@}*/
52
53 #if FEATURE_EXT_texture_sRGB
54 /** sRGB (nonlinear) formats */
55 /*@{*/
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;
66 #endif
67 /*@}*/
68 #endif
69
70 /** Floating point texture formats */
71 /*@{*/
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;
84 /*@}*/
85
86 /** Signed fixed point texture formats */
87 /*@{*/
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;
91 /*@}*/
92
93 /** \name Assorted hardware-friendly formats */
94 /*@{*/
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;
120 /*@}*/
121
122 /** \name YCbCr formats */
123 /*@{*/
124 extern const struct gl_texture_format _mesa_texformat_ycbcr;
125 extern const struct gl_texture_format _mesa_texformat_ycbcr_rev;
126 /*@}*/
127
128 /** \name Compressed formats */
129 /*@{*/
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;
133 #endif
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;
139 #endif
140 /*@}*/
141
142 /** \name The null format */
143 /*@{*/
144 extern const struct gl_texture_format _mesa_null_texformat;
145 /*@}*/
146 #endif
147
148 extern gl_format
149 _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat,
150 GLenum format, GLenum type );
151
152
153 extern void
154 _mesa_format_to_type_and_comps(gl_format format,
155 GLenum *datatype, GLuint *comps);
156
157 extern FetchTexelFuncF
158 _mesa_get_texel_fetch_func(GLuint format, GLuint dims);
159
160 extern StoreTexelFunc
161 _mesa_get_texel_store_func(GLuint format);
162
163
164 #endif