glformats.h revision af69d88d
1/*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
5 * Copyright (c) 2008-2009  VMware, Inc.
6 * Copyright (c) 2012 Intel Corporation
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 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 * OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27#ifndef GLFORMATS_H
28#define GLFORMATS_H
29
30
31#include <GL/gl.h>
32
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38extern GLboolean
39_mesa_type_is_packed(GLenum type);
40
41extern GLint
42_mesa_sizeof_type( GLenum type );
43
44extern GLint
45_mesa_sizeof_packed_type( GLenum type );
46
47extern GLint
48_mesa_components_in_format( GLenum format );
49
50extern GLint
51_mesa_bytes_per_pixel( GLenum format, GLenum type );
52
53extern GLint
54_mesa_bytes_per_vertex_attrib(GLint comps, GLenum type);
55
56extern GLboolean
57_mesa_is_type_unsigned(GLenum type);
58
59extern GLboolean
60_mesa_is_enum_format_unsized(GLenum format);
61
62extern GLboolean
63_mesa_is_enum_format_unorm(GLenum format);
64
65extern GLboolean
66_mesa_is_enum_format_snorm(GLenum format);
67
68extern GLboolean
69_mesa_is_enum_format_integer(GLenum format);
70
71extern GLboolean
72_mesa_is_enum_format_unsigned_int(GLenum format);
73
74extern GLboolean
75_mesa_is_enum_format_signed_int(GLenum format);
76
77extern GLboolean
78_mesa_is_color_format(GLenum format);
79
80extern GLboolean
81_mesa_is_depth_format(GLenum format);
82
83extern GLboolean
84_mesa_is_stencil_format(GLenum format);
85
86extern GLboolean
87_mesa_is_ycbcr_format(GLenum format);
88
89extern GLboolean
90_mesa_is_depthstencil_format(GLenum format);
91
92extern GLboolean
93_mesa_is_depth_or_stencil_format(GLenum format);
94
95extern GLboolean
96_mesa_is_compressed_format(struct gl_context *ctx, GLenum format);
97
98extern GLenum
99_mesa_base_format_to_integer_format(GLenum format);
100
101extern GLboolean
102_mesa_base_format_has_channel(GLenum base_format, GLenum pname);
103
104extern GLint
105_mesa_base_format_component_count(GLenum base_format);
106
107extern GLenum
108_mesa_generic_compressed_format_to_uncompressed_format(GLenum format);
109
110extern GLenum
111_mesa_get_nongeneric_internalformat(GLenum format);
112
113extern GLenum
114_mesa_get_linear_internalformat(GLenum format);
115
116extern GLenum
117_mesa_error_check_format_and_type(const struct gl_context *ctx,
118                                  GLenum format, GLenum type);
119
120extern GLenum
121_mesa_es_error_check_format_and_type(GLenum format, GLenum type,
122                                     unsigned dimensions);
123
124extern GLenum
125_mesa_es3_error_check_format_and_type(GLenum format, GLenum type,
126                                      GLenum internalFormat);
127
128
129#ifdef __cplusplus
130}
131#endif
132
133#endif /* GLFORMATS_H */
134