Back to index

nux  3.0.0
BitmapFormats.h
Go to the documentation of this file.
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_B8G8R8A8,            // 32-bit BGRA pixel format with alpha, using 8 bits per channel.
00061     BITFMT_R8G8B8,              // 24-bit RGB pixel format with 8 bits per channel.
00062     BITFMT_R5G6B5,             // 16-bit RGB pixel format with 5 bits for red, 6 bits for green, and 5 bits for blue.
00063     BITFMT_D24S8,
00064     BITFMT_A8,                  // Gray level 8 bits
00065 
00066     BITFMT_DXT1,
00067     BITFMT_DXT2,
00068     BITFMT_DXT3,
00069     BITFMT_DXT4,
00070     BITFMT_DXT5,
00071 
00072 #ifndef NUX_OPENGLES_20
00073     BITFMT_A8R8G8B8,            // 32-bit ARGB pixel format with alpha, using 8 bits per channel.
00074     BITFMT_A8B8G8R8,            // 32-bit ABGR pixel format with alpha, using 8 bits per channel.
00075     BITFMT_B8G8R8,              // 24-bit RGB pixel format with 8 bits per channel.
00076     BITFMT_RGBA16F,
00077     BITFMT_RGB32F,
00078     BITFMT_RGBA32F,
00079 
00080     BITFMT_R10G10B10A2,         // 32-bit pixel format using 10 bits for each color and 2 bits for alpha.
00081     BITFMT_B10G10R10A2,         // 32-bit pixel format using 10 bits for each color and 2 bits for alpha.
00082     BITFMT_A2R10G10B10,         // 32-bit pixel format using 10 bits for each color and 2 bits for alpha.
00083     BITFMT_A2B10G10R10,         // 32-bit pixel format using 10 bits for each color and 2 bits for alpha.
00084 #endif
00085     BITFMT_END_GFX_FORMATS,
00086   } BitmapFormat;
00087 
00088   extern PixelFormatInfo GPixelFormats[];
00089   extern ReadBackPixelFormatInfo   GReadBackPixelFormats[];
00090 
00091 }
00092 
00093 #endif // BITMAPFORMATS_H