1848b8605Smrg/* 2848b8605Smrg * Mesa 3-D graphics library 3848b8605Smrg * 4848b8605Smrg * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. 5848b8605Smrg * Copyright (c) 2008-2009 VMware, Inc. 6848b8605Smrg * Copyright (c) 2012 Intel Corporation 7848b8605Smrg * 8848b8605Smrg * Permission is hereby granted, free of charge, to any person obtaining a 9848b8605Smrg * copy of this software and associated documentation files (the "Software"), 10848b8605Smrg * to deal in the Software without restriction, including without limitation 11848b8605Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 12848b8605Smrg * and/or sell copies of the Software, and to permit persons to whom the 13848b8605Smrg * Software is furnished to do so, subject to the following conditions: 14848b8605Smrg * 15848b8605Smrg * The above copyright notice and this permission notice shall be included 16848b8605Smrg * in all copies or substantial portions of the Software. 17848b8605Smrg * 18848b8605Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19848b8605Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20848b8605Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21848b8605Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 22848b8605Smrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 23848b8605Smrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24848b8605Smrg * OTHER DEALINGS IN THE SOFTWARE. 25848b8605Smrg */ 26848b8605Smrg 27848b8605Smrg#ifndef GLFORMATS_H 28848b8605Smrg#define GLFORMATS_H 29848b8605Smrg 30848b8605Smrg 31b8e80941Smrg#include <stdbool.h> 32848b8605Smrg#include <GL/gl.h> 33848b8605Smrg 34848b8605Smrg 35848b8605Smrg#ifdef __cplusplus 36848b8605Smrgextern "C" { 37848b8605Smrg#endif 38848b8605Smrg 39b8e80941Smrgstruct gl_context; 40b8e80941Smrg 41b8e80941Smrgextern void 42b8e80941Smrg_mesa_compute_component_mapping(GLenum inFormat, GLenum outFormat, GLubyte *map); 43b8e80941Smrg 44848b8605Smrgextern GLboolean 45848b8605Smrg_mesa_type_is_packed(GLenum type); 46848b8605Smrg 47848b8605Smrgextern GLint 48848b8605Smrg_mesa_sizeof_type( GLenum type ); 49848b8605Smrg 50848b8605Smrgextern GLint 51848b8605Smrg_mesa_sizeof_packed_type( GLenum type ); 52848b8605Smrg 53848b8605Smrgextern GLint 54848b8605Smrg_mesa_components_in_format( GLenum format ); 55848b8605Smrg 56848b8605Smrgextern GLint 57848b8605Smrg_mesa_bytes_per_pixel( GLenum format, GLenum type ); 58848b8605Smrg 59848b8605Smrgextern GLint 60848b8605Smrg_mesa_bytes_per_vertex_attrib(GLint comps, GLenum type); 61848b8605Smrg 62b8e80941Smrgextern GLboolean 63b8e80941Smrg_mesa_is_astc_format(GLenum internalFormat); 64b8e80941Smrg 65b8e80941Smrgextern GLboolean 66b8e80941Smrg_mesa_is_etc2_format(GLenum internalFormat); 67b8e80941Smrg 68848b8605Smrgextern GLboolean 69848b8605Smrg_mesa_is_type_unsigned(GLenum type); 70848b8605Smrg 71848b8605Smrgextern GLboolean 72848b8605Smrg_mesa_is_enum_format_unsized(GLenum format); 73848b8605Smrg 74848b8605Smrgextern GLboolean 75848b8605Smrg_mesa_is_enum_format_unorm(GLenum format); 76848b8605Smrg 77848b8605Smrgextern GLboolean 78848b8605Smrg_mesa_is_enum_format_snorm(GLenum format); 79848b8605Smrg 80848b8605Smrgextern GLboolean 81848b8605Smrg_mesa_is_enum_format_integer(GLenum format); 82848b8605Smrg 83848b8605Smrgextern GLboolean 84848b8605Smrg_mesa_is_enum_format_unsigned_int(GLenum format); 85848b8605Smrg 86848b8605Smrgextern GLboolean 87848b8605Smrg_mesa_is_enum_format_signed_int(GLenum format); 88848b8605Smrg 89848b8605Smrgextern GLboolean 90848b8605Smrg_mesa_is_color_format(GLenum format); 91848b8605Smrg 92848b8605Smrgextern GLboolean 93848b8605Smrg_mesa_is_depth_format(GLenum format); 94848b8605Smrg 95848b8605Smrgextern GLboolean 96848b8605Smrg_mesa_is_stencil_format(GLenum format); 97848b8605Smrg 98848b8605Smrgextern GLboolean 99848b8605Smrg_mesa_is_ycbcr_format(GLenum format); 100848b8605Smrg 101848b8605Smrgextern GLboolean 102848b8605Smrg_mesa_is_depthstencil_format(GLenum format); 103848b8605Smrg 104848b8605Smrgextern GLboolean 105848b8605Smrg_mesa_is_depth_or_stencil_format(GLenum format); 106848b8605Smrg 107848b8605Smrgextern GLboolean 108b8e80941Smrg_mesa_is_compressed_format(const struct gl_context *ctx, GLenum format); 109b8e80941Smrg 110b8e80941Smrgextern GLboolean 111b8e80941Smrg_mesa_is_srgb_format(GLenum format); 112848b8605Smrg 113848b8605Smrgextern GLenum 114848b8605Smrg_mesa_base_format_to_integer_format(GLenum format); 115848b8605Smrg 116b8e80941Smrgextern GLenum 117b8e80941Smrg_mesa_unpack_format_to_base_format(GLenum format); 118b8e80941Smrg 119848b8605Smrgextern GLboolean 120848b8605Smrg_mesa_base_format_has_channel(GLenum base_format, GLenum pname); 121848b8605Smrg 122848b8605Smrgextern GLenum 123848b8605Smrg_mesa_generic_compressed_format_to_uncompressed_format(GLenum format); 124848b8605Smrg 125848b8605Smrgextern GLenum 126848b8605Smrg_mesa_get_nongeneric_internalformat(GLenum format); 127848b8605Smrg 128848b8605Smrgextern GLenum 129848b8605Smrg_mesa_get_linear_internalformat(GLenum format); 130848b8605Smrg 131848b8605Smrgextern GLenum 132848b8605Smrg_mesa_error_check_format_and_type(const struct gl_context *ctx, 133848b8605Smrg GLenum format, GLenum type); 134848b8605Smrg 135848b8605Smrgextern GLenum 136b8e80941Smrg_mesa_es_error_check_format_and_type(const struct gl_context *ctx, 137b8e80941Smrg GLenum format, GLenum type, 138848b8605Smrg unsigned dimensions); 139848b8605Smrg 140848b8605Smrgextern GLenum 141b8e80941Smrg_mesa_gles_error_check_format_and_type(const struct gl_context *ctx, 142b8e80941Smrg GLenum format, GLenum type, 143b8e80941Smrg GLenum internalFormat); 144b8e80941Smrgextern GLint 145b8e80941Smrg_mesa_base_tex_format(const struct gl_context *ctx, GLint internalFormat ); 146b8e80941Smrg 147b8e80941Smrgextern uint32_t 148b8e80941Smrg_mesa_format_from_format_and_type(GLenum format, GLenum type); 149b8e80941Smrg 150b8e80941Smrgextern uint32_t 151b8e80941Smrg_mesa_tex_format_from_format_and_type(const struct gl_context *ctx, 152b8e80941Smrg GLenum gl_format, GLenum type); 153b8e80941Smrg 154b8e80941Smrgextern bool 155b8e80941Smrg_mesa_is_es3_color_renderable(const struct gl_context *ctx, 156b8e80941Smrg GLenum internal_format); 157848b8605Smrg 158b8e80941Smrgextern bool 159b8e80941Smrg_mesa_is_es3_texture_filterable(const struct gl_context *ctx, 160b8e80941Smrg GLenum internal_format); 161848b8605Smrg 162848b8605Smrg#ifdef __cplusplus 163848b8605Smrg} 164848b8605Smrg#endif 165848b8605Smrg 166848b8605Smrg#endif /* GLFORMATS_H */ 167