Modifications to templating library, extensions
[gfxprim.git] / gfxprim_config.py
blob174f82d5101df91dd46247474abcd278e2f967e4
2 # gfxprim_config.py - module configuring GfxPrim code generation and
3 # known PixelTypes
4 #
7 # 2011 - Tomas Gavenciak <gavento@ucw.cz>
8 # 2011 - Cyril Hrubis <metan@ucw.cz>
10 # This file is sourced by all the generating scripts.
11 # Moreover, the generated files are sourced by almost all Gfxprim sources,
12 # so a complete recompilation is required after any change.
15 # Declared pixel sizes:
16 PS_1BPP_LE = PixelSize(1, bit_endian=LE)
17 PS_1BPP_BE = PixelSize(1, bit_endian=BE)
18 PS_2BPP_LE = PixelSize(2, bit_endian=LE)
19 PS_2BPP_BE = PixelSize(2, bit_endian=BE)
20 PS_4BPP_LE = PixelSize(4, bit_endian=LE)
21 PS_4BPP_BE = PixelSize(4, bit_endian=BE)
22 PS_8BPP = PixelSize(8)
23 PS_16BPP = PixelSize(16)
24 PS_24BPP = PixelSize(24)
25 PS_32BPP = PixelSize(32)
26 # Experimental:
27 PS_19BPP_LE = PixelSize(19, bit_endian=LE)
30 config = GfxPrimConfig(
32 # C name and bit-size of the GP_pixel type
33 pixel_type = "uint32_t",
34 pixel_size = 32,
36 # List of pixel sizes (bpp), explicit on purpose
37 pixelsizes = [PS_1BPP_LE, PS_1BPP_BE, PS_2BPP_LE, PS_2BPP_BE, PS_4BPP_LE, PS_4BPP_BE,
38 PS_8BPP, PS_16BPP, PS_24BPP, PS_32BPP,
39 PS_19BPP_LE,
42 # List of PixelTypes, order defines the numbering.
43 # The "Undefined" type is added automatically.
44 pixeltypes = [
47 # Standard RGB types
50 PixelType(name='RGBx8888', pixelsize=PS_32BPP, chanslist=[
51 ('R', 16, 8),
52 ('G', 8, 8),
53 ('B', 0, 8)]),
55 PixelType(name='RGBA8888', pixelsize=PS_32BPP, chanslist=[
56 ('R', 24, 8),
57 ('G', 16, 8),
58 ('B', 8, 8),
59 ('A', 0, 8)]),
61 PixelType(name='RGB888', pixelsize=PS_24BPP, chanslist=[
62 ('R', 16, 8),
63 ('G', 8, 8),
64 ('B', 0, 8)]),
66 PixelType(name='RGB565', pixelsize=PS_16BPP, chanslist=[
67 ('R', 11, 5),
68 ('G', 5, 6),
69 ('B', 0, 5)]),
72 # Palette types
75 PixelType(name='P2', pixelsize=PS_2BPP_LE, chanslist=[
76 ('P', 0, 2)]),
78 PixelType(name='P4', pixelsize=PS_4BPP_LE, chanslist=[
79 ('P', 0, 4)]),
81 PixelType(name='P8', pixelsize=PS_8BPP, chanslist=[
82 ('P', 0, 8)]),
85 # Gray-only pixel types
88 PixelType(name='V1', pixelsize=PS_1BPP_LE, chanslist=[
89 ('V', 0, 1)]),
91 PixelType(name='V2', pixelsize=PS_2BPP_LE, chanslist=[
92 ('V', 0, 2)]),
94 PixelType(name='V4', pixelsize=PS_4BPP_LE, chanslist=[
95 ('V', 0, 4)]),
97 PixelType(name='V8', pixelsize=PS_8BPP, chanslist=[
98 ('V', 0, 8)]),
101 # Experiments
104 PixelType(name='VA12', pixelsize=PS_4BPP_BE, chanslist=[
105 ('A', 1, 2),
106 ('V', 3, 1)]),