Mercurial > sdl-ios-xcode
annotate 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 |
rev | line source |
---|---|
3087
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
1 /* |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
3 Copyright (C) 1997-2009 Sam Lantinga |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
4 |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
7 License as published by the Free Software Foundation; either |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
9 |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
14 |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
18 |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
19 Sam Lantinga |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
20 slouken@libsdl.org |
3092
cad1aefa2ed9
Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
3087
diff
changeset
|
21 |
cad1aefa2ed9
Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
3087
diff
changeset
|
22 QNX Graphics Framework SDL driver |
cad1aefa2ed9
Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
3087
diff
changeset
|
23 Copyright (C) 2009 Mike Gorchak |
cad1aefa2ed9
Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
3087
diff
changeset
|
24 (mike@malva.ua, lestat@i.com.ua) |
3087
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
25 */ |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
26 |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
27 #include "SDL_config.h" |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
28 #include "SDL_gf_pixelfmt.h" |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
29 |
3139 | 30 gf_format_t |
31 qnxgf_sdl_to_gf_pixelformat(uint32_t pixelfmt) | |
3087
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
32 { |
3139 | 33 switch (pixelfmt) { |
34 case SDL_PIXELFORMAT_INDEX8: | |
35 { | |
36 return GF_FORMAT_PAL8; | |
37 } | |
38 break; | |
39 case SDL_PIXELFORMAT_ARGB1555: | |
40 { | |
41 return GF_FORMAT_PACK_ARGB1555; | |
42 } | |
43 break; | |
44 case SDL_PIXELFORMAT_ABGR1555: | |
45 { | |
46 return GF_FORMAT_PACK_ARGB1555; | |
47 } | |
48 break; | |
49 case SDL_PIXELFORMAT_RGB565: | |
50 { | |
51 return GF_FORMAT_PACK_RGB565; | |
52 } | |
53 break; | |
54 case SDL_PIXELFORMAT_RGB888: | |
55 { | |
56 return GF_FORMAT_BGR888; | |
57 } | |
58 break; | |
59 case SDL_PIXELFORMAT_BGRA8888: | |
60 { | |
61 return GF_FORMAT_BGRA8888; | |
62 } | |
63 break; | |
64 case SDL_PIXELFORMAT_ARGB8888: | |
65 { | |
66 return GF_FORMAT_ARGB8888; | |
67 } | |
68 break; | |
69 case SDL_PIXELFORMAT_YV12: | |
70 { | |
71 return GF_FORMAT_PLANAR_YUV_YV12; | |
72 } | |
73 break; | |
74 case SDL_PIXELFORMAT_YUY2: | |
75 { | |
76 return GF_FORMAT_PACK_YUV_YUY2; | |
77 } | |
78 break; | |
79 case SDL_PIXELFORMAT_UYVY: | |
80 { | |
81 return GF_FORMAT_PACK_YUV_UYVY; | |
82 } | |
83 break; | |
84 case SDL_PIXELFORMAT_YVYU: | |
85 { | |
86 return GF_FORMAT_PACK_YUV_YVYU; | |
87 } | |
88 break; | |
89 } | |
3087
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
90 |
3139 | 91 return GF_FORMAT_INVALID; |
3087
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
92 } |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
93 |
3139 | 94 uint32_t |
95 qnxgf_gf_to_sdl_pixelformat(gf_format_t pixelfmt) | |
3087
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
96 { |
3139 | 97 switch (pixelfmt) { |
98 case GF_FORMAT_PAL8: | |
99 { | |
100 return SDL_PIXELFORMAT_INDEX8; | |
101 } | |
102 break; | |
103 case GF_FORMAT_PKLE_ARGB1555: | |
104 { | |
105 return SDL_PIXELFORMAT_ARGB1555; | |
106 } | |
107 break; | |
108 case GF_FORMAT_PACK_ARGB1555: | |
109 { | |
110 return SDL_PIXELFORMAT_ARGB1555; | |
111 } | |
112 break; | |
113 case GF_FORMAT_PKBE_ARGB1555: | |
114 { | |
115 return SDL_PIXELFORMAT_ABGR1555; | |
116 } | |
117 break; | |
118 case GF_FORMAT_PKBE_RGB565: | |
119 { | |
120 return SDL_PIXELFORMAT_RGB565; | |
121 } | |
122 break; | |
123 case GF_FORMAT_PKLE_RGB565: | |
124 { | |
125 return SDL_PIXELFORMAT_RGB565; | |
126 } | |
127 break; | |
128 case GF_FORMAT_PACK_RGB565: | |
129 { | |
130 return SDL_PIXELFORMAT_RGB565; | |
131 } | |
132 break; | |
133 case GF_FORMAT_BGR888: | |
134 { | |
135 return SDL_PIXELFORMAT_RGB888; | |
136 } | |
137 break; | |
138 case GF_FORMAT_BGRA8888: | |
139 { | |
140 return SDL_PIXELFORMAT_BGRA8888; | |
141 } | |
142 break; | |
143 case GF_FORMAT_ARGB8888: | |
144 { | |
145 return SDL_PIXELFORMAT_ARGB8888; | |
146 } | |
147 break; | |
3087
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
148 |
3139 | 149 case GF_FORMAT_PLANAR_YUV_YV12: |
150 { | |
151 return SDL_PIXELFORMAT_YV12; | |
152 } | |
153 break; | |
154 case GF_FORMAT_PACK_YUV_YUY2: | |
155 { | |
156 return SDL_PIXELFORMAT_YUY2; | |
157 } | |
158 break; | |
159 case GF_FORMAT_PACK_YUV_UYVY: | |
160 { | |
161 return SDL_PIXELFORMAT_UYVY; | |
162 } | |
163 break; | |
164 case GF_FORMAT_PACK_YUV_YVYU: | |
165 { | |
166 return SDL_PIXELFORMAT_YVYU; | |
167 } | |
168 break; | |
169 } | |
3087
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
170 |
3139 | 171 return SDL_PIXELFORMAT_UNKNOWN; |
3087
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff
changeset
|
172 } |
3092
cad1aefa2ed9
Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
3087
diff
changeset
|
173 |
cad1aefa2ed9
Date: Thu, 12 Mar 2009 15:14:38 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
3087
diff
changeset
|
174 /* vi: set ts=4 sw=4 expandtab: */ |