comparison src/video/qnxgf/SDL_gf_pixelfmt.c @ 3139:7f684f249ec9

indent
author Sam Lantinga <slouken@libsdl.org>
date Sat, 23 May 2009 22:41:08 +0000
parents cad1aefa2ed9
children 44d5474c2c8a
comparison
equal deleted inserted replaced
3125:d71d8ceda8b3 3139:7f684f249ec9
25 */ 25 */
26 26
27 #include "SDL_config.h" 27 #include "SDL_config.h"
28 #include "SDL_gf_pixelfmt.h" 28 #include "SDL_gf_pixelfmt.h"
29 29
30 gf_format_t qnxgf_sdl_to_gf_pixelformat(uint32_t pixelfmt) 30 gf_format_t
31 qnxgf_sdl_to_gf_pixelformat(uint32_t pixelfmt)
31 { 32 {
32 switch(pixelfmt) 33 switch (pixelfmt) {
33 { 34 case SDL_PIXELFORMAT_INDEX8:
34 case SDL_PIXELFORMAT_INDEX8: 35 {
35 { 36 return GF_FORMAT_PAL8;
36 return GF_FORMAT_PAL8; 37 }
37 } 38 break;
38 break; 39 case SDL_PIXELFORMAT_ARGB1555:
39 case SDL_PIXELFORMAT_ARGB1555: 40 {
40 { 41 return GF_FORMAT_PACK_ARGB1555;
41 return GF_FORMAT_PACK_ARGB1555; 42 }
42 } 43 break;
43 break; 44 case SDL_PIXELFORMAT_ABGR1555:
44 case SDL_PIXELFORMAT_ABGR1555: 45 {
45 { 46 return GF_FORMAT_PACK_ARGB1555;
46 return GF_FORMAT_PACK_ARGB1555; 47 }
47 } 48 break;
48 break; 49 case SDL_PIXELFORMAT_RGB565:
49 case SDL_PIXELFORMAT_RGB565: 50 {
50 { 51 return GF_FORMAT_PACK_RGB565;
51 return GF_FORMAT_PACK_RGB565; 52 }
52 } 53 break;
53 break; 54 case SDL_PIXELFORMAT_RGB888:
54 case SDL_PIXELFORMAT_RGB888: 55 {
55 { 56 return GF_FORMAT_BGR888;
56 return GF_FORMAT_BGR888; 57 }
57 } 58 break;
58 break; 59 case SDL_PIXELFORMAT_BGRA8888:
59 case SDL_PIXELFORMAT_BGRA8888: 60 {
60 { 61 return GF_FORMAT_BGRA8888;
61 return GF_FORMAT_BGRA8888; 62 }
62 } 63 break;
63 break; 64 case SDL_PIXELFORMAT_ARGB8888:
64 case SDL_PIXELFORMAT_ARGB8888: 65 {
65 { 66 return GF_FORMAT_ARGB8888;
66 return GF_FORMAT_ARGB8888; 67 }
67 } 68 break;
68 break; 69 case SDL_PIXELFORMAT_YV12:
69 case SDL_PIXELFORMAT_YV12: 70 {
70 { 71 return GF_FORMAT_PLANAR_YUV_YV12;
71 return GF_FORMAT_PLANAR_YUV_YV12; 72 }
72 } 73 break;
73 break; 74 case SDL_PIXELFORMAT_YUY2:
74 case SDL_PIXELFORMAT_YUY2: 75 {
75 { 76 return GF_FORMAT_PACK_YUV_YUY2;
76 return GF_FORMAT_PACK_YUV_YUY2; 77 }
77 } 78 break;
78 break; 79 case SDL_PIXELFORMAT_UYVY:
79 case SDL_PIXELFORMAT_UYVY: 80 {
80 { 81 return GF_FORMAT_PACK_YUV_UYVY;
81 return GF_FORMAT_PACK_YUV_UYVY; 82 }
82 } 83 break;
83 break; 84 case SDL_PIXELFORMAT_YVYU:
84 case SDL_PIXELFORMAT_YVYU: 85 {
85 { 86 return GF_FORMAT_PACK_YUV_YVYU;
86 return GF_FORMAT_PACK_YUV_YVYU; 87 }
87 } 88 break;
88 break; 89 }
89 }
90 90
91 return GF_FORMAT_INVALID; 91 return GF_FORMAT_INVALID;
92 } 92 }
93 93
94 uint32_t qnxgf_gf_to_sdl_pixelformat(gf_format_t pixelfmt) 94 uint32_t
95 qnxgf_gf_to_sdl_pixelformat(gf_format_t pixelfmt)
95 { 96 {
96 switch(pixelfmt) 97 switch (pixelfmt) {
97 { 98 case GF_FORMAT_PAL8:
98 case GF_FORMAT_PAL8: 99 {
99 { 100 return SDL_PIXELFORMAT_INDEX8;
100 return SDL_PIXELFORMAT_INDEX8; 101 }
101 } 102 break;
102 break; 103 case GF_FORMAT_PKLE_ARGB1555:
103 case GF_FORMAT_PKLE_ARGB1555: 104 {
104 { 105 return SDL_PIXELFORMAT_ARGB1555;
105 return SDL_PIXELFORMAT_ARGB1555; 106 }
106 } 107 break;
107 break; 108 case GF_FORMAT_PACK_ARGB1555:
108 case GF_FORMAT_PACK_ARGB1555: 109 {
109 { 110 return SDL_PIXELFORMAT_ARGB1555;
110 return SDL_PIXELFORMAT_ARGB1555; 111 }
111 } 112 break;
112 break; 113 case GF_FORMAT_PKBE_ARGB1555:
113 case GF_FORMAT_PKBE_ARGB1555: 114 {
114 { 115 return SDL_PIXELFORMAT_ABGR1555;
115 return SDL_PIXELFORMAT_ABGR1555; 116 }
116 } 117 break;
117 break; 118 case GF_FORMAT_PKBE_RGB565:
118 case GF_FORMAT_PKBE_RGB565: 119 {
119 { 120 return SDL_PIXELFORMAT_RGB565;
120 return SDL_PIXELFORMAT_RGB565; 121 }
121 } 122 break;
122 break; 123 case GF_FORMAT_PKLE_RGB565:
123 case GF_FORMAT_PKLE_RGB565: 124 {
124 { 125 return SDL_PIXELFORMAT_RGB565;
125 return SDL_PIXELFORMAT_RGB565; 126 }
126 } 127 break;
127 break; 128 case GF_FORMAT_PACK_RGB565:
128 case GF_FORMAT_PACK_RGB565: 129 {
129 { 130 return SDL_PIXELFORMAT_RGB565;
130 return SDL_PIXELFORMAT_RGB565; 131 }
131 } 132 break;
132 break; 133 case GF_FORMAT_BGR888:
133 case GF_FORMAT_BGR888: 134 {
134 { 135 return SDL_PIXELFORMAT_RGB888;
135 return SDL_PIXELFORMAT_RGB888; 136 }
136 } 137 break;
137 break; 138 case GF_FORMAT_BGRA8888:
138 case GF_FORMAT_BGRA8888: 139 {
139 { 140 return SDL_PIXELFORMAT_BGRA8888;
140 return SDL_PIXELFORMAT_BGRA8888; 141 }
141 } 142 break;
142 break; 143 case GF_FORMAT_ARGB8888:
143 case GF_FORMAT_ARGB8888: 144 {
144 { 145 return SDL_PIXELFORMAT_ARGB8888;
145 return SDL_PIXELFORMAT_ARGB8888; 146 }
146 } 147 break;
147 break;
148 148
149 case GF_FORMAT_PLANAR_YUV_YV12: 149 case GF_FORMAT_PLANAR_YUV_YV12:
150 { 150 {
151 return SDL_PIXELFORMAT_YV12; 151 return SDL_PIXELFORMAT_YV12;
152 } 152 }
153 break; 153 break;
154 case GF_FORMAT_PACK_YUV_YUY2: 154 case GF_FORMAT_PACK_YUV_YUY2:
155 { 155 {
156 return SDL_PIXELFORMAT_YUY2; 156 return SDL_PIXELFORMAT_YUY2;
157 } 157 }
158 break; 158 break;
159 case GF_FORMAT_PACK_YUV_UYVY: 159 case GF_FORMAT_PACK_YUV_UYVY:
160 { 160 {
161 return SDL_PIXELFORMAT_UYVY; 161 return SDL_PIXELFORMAT_UYVY;
162 } 162 }
163 break; 163 break;
164 case GF_FORMAT_PACK_YUV_YVYU: 164 case GF_FORMAT_PACK_YUV_YVYU:
165 { 165 {
166 return SDL_PIXELFORMAT_YVYU; 166 return SDL_PIXELFORMAT_YVYU;
167 } 167 }
168 break; 168 break;
169 } 169 }
170 170
171 return SDL_PIXELFORMAT_UNKNOWN; 171 return SDL_PIXELFORMAT_UNKNOWN;
172 } 172 }
173 173
174 /* vi: set ts=4 sw=4 expandtab: */ 174 /* vi: set ts=4 sw=4 expandtab: */