annotate src/video/qnxgf/SDL_gf_pixelfmt.c @ 3092:cad1aefa2ed9

Date: Thu, 12 Mar 2009 15:14:38 +0200 From: "Mike Gorchak" Subject: New QNX patches In photon.tar.gz there are new files to be placed into ./src/video/photon/ directory. qnx3.diff - new patches for QNX support. Since I've found a lot of bugs in the new GF QNX Graphics Framework and I'm suspended development for GF driver until already found bugs will be fixed and switched to Photon driver implementation. sdl.diff - I've found that renderer creation result has not been checked and SDL shows error like: "there is no current renderer", now SDL will show correct error which was set be renderer.
author Sam Lantinga <slouken@libsdl.org>
date Tue, 17 Mar 2009 03:24:22 +0000
parents 0b6f51c29267
children 7f684f249ec9
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
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
30 gf_format_t qnxgf_sdl_to_gf_pixelformat(uint32_t pixelfmt)
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
31 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
32 switch(pixelfmt)
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
33 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
34 case SDL_PIXELFORMAT_INDEX8:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
35 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
36 return GF_FORMAT_PAL8;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
37 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
38 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
39 case SDL_PIXELFORMAT_ARGB1555:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
40 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
41 return GF_FORMAT_PACK_ARGB1555;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
42 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
43 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
44 case SDL_PIXELFORMAT_ABGR1555:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
45 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
46 return GF_FORMAT_PACK_ARGB1555;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
47 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
48 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
49 case SDL_PIXELFORMAT_RGB565:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
50 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
51 return GF_FORMAT_PACK_RGB565;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
52 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
53 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
54 case SDL_PIXELFORMAT_RGB888:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
55 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
56 return GF_FORMAT_BGR888;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
57 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
58 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
59 case SDL_PIXELFORMAT_BGRA8888:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
60 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
61 return GF_FORMAT_BGRA8888;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
62 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
63 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
64 case SDL_PIXELFORMAT_ARGB8888:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
65 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
66 return GF_FORMAT_ARGB8888;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
67 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
68 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
69 case SDL_PIXELFORMAT_YV12:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
70 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
71 return GF_FORMAT_PLANAR_YUV_YV12;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
72 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
73 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
74 case SDL_PIXELFORMAT_YUY2:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
75 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
76 return GF_FORMAT_PACK_YUV_YUY2;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
77 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
78 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
79 case SDL_PIXELFORMAT_UYVY:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
80 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
81 return GF_FORMAT_PACK_YUV_UYVY;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
82 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
83 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
84 case SDL_PIXELFORMAT_YVYU:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
85 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
86 return GF_FORMAT_PACK_YUV_YVYU;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
87 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
88 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
89 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
90
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
91 return GF_FORMAT_INVALID;
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
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
94 uint32_t qnxgf_gf_to_sdl_pixelformat(gf_format_t pixelfmt)
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
95 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
96 switch(pixelfmt)
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
97 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
98 case GF_FORMAT_PAL8:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
99 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
100 return SDL_PIXELFORMAT_INDEX8;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
101 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
102 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
103 case GF_FORMAT_PKLE_ARGB1555:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
104 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
105 return SDL_PIXELFORMAT_ARGB1555;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
106 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
107 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
108 case GF_FORMAT_PACK_ARGB1555:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
109 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
110 return SDL_PIXELFORMAT_ARGB1555;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
111 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
112 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
113 case GF_FORMAT_PKBE_ARGB1555:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
114 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
115 return SDL_PIXELFORMAT_ABGR1555;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
116 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
117 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
118 case GF_FORMAT_PKBE_RGB565:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
119 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
120 return SDL_PIXELFORMAT_RGB565;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
121 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
122 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
123 case GF_FORMAT_PKLE_RGB565:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
124 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
125 return SDL_PIXELFORMAT_RGB565;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
126 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
127 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
128 case GF_FORMAT_PACK_RGB565:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
129 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
130 return SDL_PIXELFORMAT_RGB565;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
131 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
132 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
133 case GF_FORMAT_BGR888:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
134 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
135 return SDL_PIXELFORMAT_RGB888;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
136 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
137 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
138 case GF_FORMAT_BGRA8888:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
139 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
140 return SDL_PIXELFORMAT_BGRA8888;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
141 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
142 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
143 case GF_FORMAT_ARGB8888:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
144 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
145 return SDL_PIXELFORMAT_ARGB8888;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
146 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
147 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
148
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
149 case GF_FORMAT_PLANAR_YUV_YV12:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
150 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
151 return SDL_PIXELFORMAT_YV12;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
152 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
153 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
154 case GF_FORMAT_PACK_YUV_YUY2:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
155 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
156 return SDL_PIXELFORMAT_YUY2;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
157 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
158 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
159 case GF_FORMAT_PACK_YUV_UYVY:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
160 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
161 return SDL_PIXELFORMAT_UYVY;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
162 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
163 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
164 case GF_FORMAT_PACK_YUV_YVYU:
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
165 {
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
166 return SDL_PIXELFORMAT_YVYU;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
167 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
168 break;
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
169 }
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
170
0b6f51c29267 Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
171 return SDL_PIXELFORMAT_UNKNOWN;
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: */