aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorJody Northup2009-06-20 05:31:23 +0000
committerJody Northup2009-06-20 05:31:23 +0000
commitc0c0aed4880763bd5a1fc15a7138a5e2c4f1d904 (patch)
tree2ac013c7da35805078c828a1878d458770608382 /graphics
parentf7dd1c15ed38418a0371032966144eb6c2e004cb (diff)
downloadscummvm-rg350-c0c0aed4880763bd5a1fc15a7138a5e2c4f1d904.tar.gz
scummvm-rg350-c0c0aed4880763bd5a1fc15a7138a5e2c4f1d904.tar.bz2
scummvm-rg350-c0c0aed4880763bd5a1fc15a7138a5e2c4f1d904.zip
Factory constructors for ARGB BGR ABGR and BGRA pixel formats.
svn-id: r41697
Diffstat (limited to 'graphics')
-rw-r--r--graphics/pixelformat.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 7f7f2412cb..a773a42d76 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -65,8 +65,6 @@ struct PixelFormat {
}
//"Factory" methods for convenience
- //TODO: BGR support
- //TODO: Specify alpha position
static inline PixelFormat createFormatCLUT8() {
return PixelFormat(1,8,8,8,8,0,0,0,0);
}
@@ -75,24 +73,55 @@ struct PixelFormat {
static inline PixelFormat createFormatRGB555() {
return PixelFormat(2,3,3,3,8,10,5,0,0);
}
+ static inline PixelFormat createFormatBGR555() {
+ return PixelFormat(2,3,3,3,8,0,5,10,0);
+ }
static inline PixelFormat createFormatXRGB1555() {
//Special case, alpha bit is always high in this mode.
return PixelFormat(2,3,3,3,7,10,5,0,15);
}
+ static inline PixelFormat createFormatXBGR1555() {
+ //Special case, alpha bit is always high in this mode.
+ return PixelFormat(2,3,3,3,7,0,5,10,15);
+ }
static inline PixelFormat createFormatRGB565() {
return PixelFormat(2,3,2,3,8,11,5,0,0);
}
+ static inline PixelFormat createFormatBGR565() {
+ return PixelFormat(2,3,2,3,8,0,5,11,0);
+ }
static inline PixelFormat createFormatRGBA4444() {
return PixelFormat(2,4,4,4,4,12,8,4,0);
}
+ static inline PixelFormat createFormatARGB4444() {
+ return PixelFormat(2,4,4,4,4,8,4,0,12);
+ }
+ static inline PixelFormat createFormatABGR4444() {
+ return PixelFormat(2,4,4,4,4,0,4,8,12);
+ }
+ static inline PixelFormat createFormatBGRA4444() {
+ return PixelFormat(2,4,4,4,4,4,8,12,0);
+ }
#ifdef ENABLE_32BIT
//3 to 4 byte per pixel modes
static inline PixelFormat createFormatRGB888() {
return PixelFormat(3,0,0,0,8,16,8,0,0);
}
+ static inline PixelFormat createFormatBGR888() {
+ return PixelFormat(3,0,0,0,8,0,8,16,0);
+ }
static inline PixelFormat createFormatRGBA8888() {
return PixelFormat(4,0,0,0,0,24,16,8,0);
}
+ static inline PixelFormat createFormatARGB8888() {
+ return PixelFormat(4,0,0,0,0,16,8,0,24);
+ }
+ static inline PixelFormat createFormatABGR8888() {
+ return PixelFormat(4,0,0,0,0,0,8,16,24);
+ }
+ static inline PixelFormat createFormatBGRA8888() {
+ return PixelFormat(4,0,0,0,0,8,16,24,0);
+ }
#endif //ENABLE_32BIT
#endif //ENABLE_RGB_COLOR