Back to index

nux  3.0.0
BitmapFormats.cpp
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 #include "NuxCore/NuxCore.h"
00024 #include "BitmapFormats.h"
00025 
00026 namespace nux
00027 {
00028 
00029   PixelFormatInfo GPixelFormats[] =
00030   {
00031     // Name                           BlockSizeX BlockSizeY BlockSizeZ            BlockBytes NumComponents    Platform  Internal    Memory      Flags       Supported
00032     //                                                                                                        Format    Format      Alignment
00033     { "BITFMT_UNKNOWN",          0,          0,       0,      0,              0,          0,             0,       0,           0,          0,        false       }, // BITFMT_Unknown
00034     { "BITFMT_R8G8B8A8",         1,          1,       1,      4,              4,          0,             0,       0,           4,          0,        true        }, // BITFMT_R8G8B8A8
00035     { "BITFMT_B8G8R8A8",         1,          1,       1,      4,              4,          0,             0,       0,           4,          0,        true        }, // BITFMT_B8G8R8A8
00036     { "BITFMT_R8G8B8",           1,          1,       1,      3,              3,          0,             0,       0,           1,          0,        true        }, // BITFMT_R8G8B8
00037     { "BITFMT_R5G6B5",           1,          1,       1,      2,              3,          0,             0,       0,           1,          0,        true        }, // BITFMT_R5G6B5
00038     { "BITFMT_D24S8",            1,          1,       1,      4,              2,          0,             0,       0,           1,          0,        true        }, // BITFMT_D24S8
00039     { "BITFMT_A8",               1,          1,       1,      1,              1,          0,             0,       0,           1,          0,        true        }, // BITFMT_A8
00040 
00041     { "BITFMT_DXT1",             4,          4,       1,      8,              3,          0,             0,       0,           1,          0,        true        }, // BITFMT_DXT1
00042     { "BITFMT_DXT2",             4,          4,       1,      16,             4,          0,             0,       0,           1,          0,        true        }, // BITFMT_DXT2
00043     { "BITFMT_DXT3",             4,          4,       1,      16,             4,          0,             0,       0,           1,          0,        true        }, // BITFMT_DXT3
00044     { "BITFMT_DXT4",             4,          4,       1,      16,             4,          0,             0,       0,           1,          0,        true        }, // BITFMT_DXT4
00045     { "BITFMT_DXT5",             4,          4,       1,      16,             4,          0,             0,       0,           1,          0,        true        }, // BITFMT_DXT5
00046 
00047 #ifndef NUX_OPENGLES_20
00048     { "BITFMT_A8R8G8B8",         1,          1,       1,      4,              4,          0,             0,       0,           4,          0,        true        }, // BITFMT_A8R8G8B8
00049     { "BITFMT_A8B8G8R8",         1,          1,       1,      4,              4,          0,             0,       0,           4,          0,        true        }, // BITFMT_A8B8G8R8
00050     { "BITFMT_B8G8R8",           1,          1,       1,      3,              3,          0,             0,       0,           1,          0,        true        }, // BITFMT_B8G8R8
00051     { "BITFMT_RGBA16F",          1,          1,       1,      8,              4,          0,             0,       0,           1,          0,        true        }, // BITFMT_RGBA16F
00052     { "BITFMT_RGB32F",           1,          1,       1,      12,             3,          0,             0,       0,           1,          0,        true        }, // BITFMT_RGB32F
00053     { "BITFMT_RGBA32F",          1,          1,       1,      16,             4,          0,             0,       0,           1,          0,        true        }, // BITFMT_RGBA32F
00054     { "BITFMT_R10G10B10A2",      1,          1,       1,      4,              4,          0,             0,       0,           4,          0,        true        }, // BITFMT_R10G10B10A2
00055     { "BITFMT_B10G10R10A2",      1,          1,       1,      4,              4,          0,             0,       0,           4,          0,        true        }, // BITFMT_B10G10R10A2
00056     { "BITFMT_A2R10G10B10",      1,          1,       1,      4,              4,          0,             0,       0,           4,          0,        true        }, // BITFMT_A2R10G10B10
00057     { "BITFMT_A2B10G10R10",      1,          1,       1,      4,              4,          0,             0,       0,           4,          0,        true        }, // BITFMT_A2B10G10R10
00058 #endif
00059     { "BITFMT_END_GFX_FORMATS", 0,          0,        0,      0,              0,          0,             0,       0,           0,          0,        false       }, //  BITFMT_END_GFX_FORMATS
00060   };
00061 
00062 
00063   ReadBackPixelFormatInfo GReadBackPixelFormats[] =
00064   {
00065     // Name                        BlockBytes  NumComponents Format    Type      Flags           Supported
00066 
00067     { "BITFMT_UNKNOWN",          0,          0,        0,          0,         0,           false       }, // BITFMT_Unknown
00068     { "BITFMT_R8G8B8A8",         4,          4,        0,          0,         0,           true        }, // BITFMT_R8G8B8A8
00069     { "BITFMT_B8G8R8A8",         4,          4,        0,          0,         0,           true        }, // BITFMT_B8G8R8A8
00070     { "BITFMT_R8G8B8",           3,          3,        0,          0,         0,           true        }, // BITFMT_R8G8B8
00071     { "BITFMT_R5G6B5",           2,          3,        0,          0,         0,           true        }, // BITFMT_R5G6B5
00072     { "BITFMT_D24S8",            4,          2,        0,          0,         0,           true        }, // BITFMT_D24S8
00073     { "BITFMT_A8",               1,          1,        0,          0,         0,           true        }, // BITFMT_A8
00074                                                                                                                     
00075     { "BITFMT_DXT1",             8,          3,        0,          0,         0,           true        }, // BITFMT_DXT1
00076     { "BITFMT_DXT2",             16,         4,        0,          0,         0,           true        }, // BITFMT_DXT2
00077     { "BITFMT_DXT3",             16,         4,        0,          0,         0,           true        }, // BITFMT_DXT3
00078     { "BITFMT_DXT4",             16,         4,        0,          0,         0,           true        }, // BITFMT_DXT4
00079     { "BITFMT_DXT5",             16,         4,        0,          0,         0,           true        }, // BITFMT_DXT5
00080 
00081 #ifndef NUX_OPENGLES_20                                                                                             
00082     { "BITFMT_A8R8G8B8",         4,          4,        0,          0,         0,           true        }, // BITFMT_A8R8G8B8
00083     { "BITFMT_A8B8G8R8",         4,          4,        0,          0,         0,           true        }, // BITFMT_A8B8G8R8
00084     { "BITFMT_B8G8R8",           3,          3,        0,          0,         0,           true        }, // BITFMT_B8G8R8
00085     { "BITFMT_RGBA16F",          8,          4,        0,          0,         0,           true        }, // BITFMT_RGBA16F
00086     { "BITFMT_RGB32F",           12,         3,        0,          0,         0,           true        }, // BITFMT_RGBA32F
00087     { "BITFMT_RGBA32F",          16,         4,        0,          0,         0,           true        }, // BITFMT_RGBA32F
00088     { "BITFMT_R10G10B10A2",      4,          4,        0,          0,         0,           true        }, // BITFMT_R10G10B10A2
00089     { "BITFMT_B10G10R10A2",      4,          4,        0,          0,         0,           true        }, // BITFMT_B10G10R10A2
00090     { "BITFMT_A2B10G10R10",      4,          4,        0,          0,         0,           true        }, // BITFMT_A2B10G10R10
00091     { "BITFMT_A2R10G10B10",      4,          4,        0,          0,         0,           true        }, // BITFMT_A2R10G10B10
00092 #endif                                                             
00093     { "BITFMT_END_GFX_FORMATS",  0,          0,        0,          0,         0,           false       }, //  BITFMT_END_GFX_FORMATS
00094   };
00095 
00096 }