nux-1.16.0
BitmapFormats.h
00001 /*
00002  * Copyright 2010 Inalogic® Inc.
00003  *
00004  * This program is free software: you can redistribute it and/or modify it
00005  * under the terms of the GNU Lesser General Public License, as
00006  * published by the  Free Software Foundation; either version 2.1 or 3.0
00007  * of the License.
00008  *
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranties of
00011  * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
00012  * PURPOSE.  See the applicable version of the GNU Lesser General Public
00013  * License for more details.
00014  *
00015  * You should have received a copy of both the GNU Lesser General Public
00016  * License along with this program. If not, see <http://www.gnu.org/licenses/>
00017  *
00018  * Authored by: Jay Taoko <jaytaoko@inalogic.com>
00019  *
00020  */
00021 
00022 
00023 #ifndef BITMAPFORMATS_H
00024 #define BITMAPFORMATS_H
00025 
00026 namespace nux
00027 {
00028 
00029   typedef struct
00030   {
00031     const TCHAR *Name;
00032     int             BlockSizeX;
00033     int             BlockSizeY;
00034     int             BlockSizeZ;
00035     int             BlockBytes;
00036     int             NumComponents;
00037     unsigned int        PlatformFormat; // internal format
00038     int             Format;
00039     int             type;
00040     int             RowMemoryAlignment; // best memory alignment in a row
00041     unsigned int        Flags;
00042     bool                        Supported;
00043   }  PixelFormatInfo;
00044 
00045   typedef struct
00046   {
00047     const TCHAR *Name;
00048     int             BlockBytes;
00049     int             NumComponents;
00050     unsigned int    Format;
00051     int             type;
00052     unsigned int        Flags;
00053     bool                        Supported;
00054   } ReadBackPixelFormatInfo;
00055 
00056   typedef enum
00057   {
00058     BITFMT_UNKNOWN          = 0,
00059     BITFMT_R8G8B8A8,            // 32-bit RGBA pixel format with alpha, using 8 bits per channel.
00060     BITFMT_A8B8G8R8,            // 32-bit ABGR pixel format with alpha, using 8 bits per channel.
00061 
00062     BITFMT_B8G8R8A8,            // 32-bit BGRA pixel format with alpha, using 8 bits per channel.
00063     BITFMT_A8R8G8B8,            // 32-bit ARGB pixel format with alpha, using 8 bits per channel.
00064 
00065     BITFMT_R8G8B8,              // 24-bit RGB pixel format with 8 bits per channel.
00066     BITFMT_B8G8R8,              // 24-bit RGB pixel format with 8 bits per channel.
00067 
00068     BITFMT_R5G6B5,             // 16-bit RGB pixel format with 5 bits for red, 6 bits for green, and 5 bits for blue.
00069 
00070     BITFMT_RGBA16F,
00071     BITFMT_RGB32F,
00072     BITFMT_RGBA32F,
00073     BITFMT_D24S8,
00074 
00075     BITFMT_DXT1,
00076     BITFMT_DXT2,
00077     BITFMT_DXT3,
00078     BITFMT_DXT4,
00079     BITFMT_DXT5,
00080 
00081     BITFMT_R10G10B10A2,         // 32-bit pixel format using 10 bits for each color and 2 bits for alpha.
00082     BITFMT_B10G10R10A2,         // 32-bit pixel format using 10 bits for each color and 2 bits for alpha.
00083     BITFMT_A2R10G10B10,         // 32-bit pixel format using 10 bits for each color and 2 bits for alpha.
00084     BITFMT_A2B10G10R10,         // 32-bit pixel format using 10 bits for each color and 2 bits for alpha.
00085 
00086     BITFMT_A8,                  // Gray level 8 bits
00087 
00088     BITFMT_END_GFX_FORMATS,
00089 
00090     BITFMT_X8R8G8B8,            // 32-bit RGB pixel format, where 8 bits are reserved for each color.
00091     BITFMT_X8B8G8R8,            // 32-bit RGB pixel format, where 8 bits are reserved for each color.
00092 
00093     BITFMT_X1R5G5B5,           // 16-bit pixel format where 5 bits are reserved for each color.
00094     BITFMT_A1R5G5B5,           // 16-bit pixel format where 5 bits are reserved for each color and 1 bit is reserved for alpha.
00095     BITFMT_A4R4G4B4,           // 16-bit ARGB pixel format with 4 bits for each channel.
00096     BITFMT_X4R4G4B4,           // 16-bit RGB pixel format using 4 bits for each color.
00097     BITFMT_A8R3G3B2,           // 16-bit ARGB texture format using 8 bits for alpha, 3 bits each for red and green, and 2 bits for blue.
00098 
00099     //BITFMT_A8P8,               // 8-bit color indexed with 8 bits of alpha.
00100     //BITFMT_A8L8,               // 16-bit using 8 bits each for alpha and luminance.
00101     //BITFMT_GRAY16,             // Gray level 16 bits
00102 
00103     BITFMT_R3G3B2,             // 8-bit RGB texture format using 3 bits for red, 3 bits for green, and 2 bits for blue.
00104 
00105     //BITFMT_P8,                 // 8-bit color indexed.
00106     //BITFMT_L8,                 // 8-bit luminance only.
00107     //BITFMT_A4L4,               // 8-bit using 4 bits each for alpha and luminance.
00108     //BITFMT_A8,                 // 8-bit alpha only.
00109 
00110 
00111   } BitmapFormat;
00112 
00113   extern PixelFormatInfo GPixelFormats[];
00114   extern ReadBackPixelFormatInfo        GReadBackPixelFormats[];
00115 
00116 }
00117 
00118 #endif // BITMAPFORMATS_H
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends