Merge branch '7.8'
[mesa.git] / src / gallium / state_trackers / python / u_format.i
1 /**************************************************************************
2 *
3 * Copyright 2010 VMware, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 * USE OR OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
24 * of the Software.
25 *
26 **************************************************************************/
27
28
29 static INLINE const char *
30 util_format_name(enum pipe_format format);
31
32 static INLINE boolean
33 util_format_is_s3tc(enum pipe_format format);
34
35 static INLINE boolean
36 util_format_is_depth_or_stencil(enum pipe_format format);
37
38 static INLINE boolean
39 util_format_is_depth_and_stencil(enum pipe_format format);
40
41
42 uint
43 util_format_get_blocksizebits(enum pipe_format format);
44
45 uint
46 util_format_get_blocksize(enum pipe_format format);
47
48 uint
49 util_format_get_blockwidth(enum pipe_format format);
50
51 uint
52 util_format_get_blockheight(enum pipe_format format);
53
54 unsigned
55 util_format_get_nblocksx(enum pipe_format format,
56 unsigned x);
57
58 unsigned
59 util_format_get_nblocksy(enum pipe_format format,
60 unsigned y);
61
62 unsigned
63 util_format_get_nblocks(enum pipe_format format,
64 unsigned width,
65 unsigned height);
66
67 size_t
68 util_format_get_stride(enum pipe_format format,
69 unsigned width);
70
71 size_t
72 util_format_get_2d_size(enum pipe_format format,
73 size_t stride,
74 unsigned height);
75
76 uint
77 util_format_get_component_bits(enum pipe_format format,
78 enum util_format_colorspace colorspace,
79 uint component);
80
81 boolean
82 util_format_has_alpha(enum pipe_format format);
83
84
85 unsigned
86 util_format_get_nr_components(enum pipe_format format);
87
88