[gimp-dds] / tags / release-2.0.6 / dds.h Repository:
ViewVC logotype

View of /tags/release-2.0.6/dds.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 118 - (download) (as text) (annotate)
Tue Jun 3 23:39:13 2008 UTC (17 months, 2 weeks ago) by cocidius
File size: 4127 byte(s)
Release 2.0.6 tag
    1 /*
    2    DDS GIMP plugin
    3 
    4    Copyright (C) 2004-2008 Shawn Kirst <skirst@insightbb.com>,
    5    with parts (C) 2003 Arne Reuter <homepage@arnereuter.de> where specified.
    6 
    7    This program is free software; you can redistribute it and/or
    8    modify it under the terms of the GNU General Public
    9    License as published by the Free Software Foundation; either
   10    version 2 of the License, or (at your option) any later version.
   11 
   12    This program is distributed in the hope that it will be useful,
   13    but WITHOUT ANY WARRANTY; without even the implied warranty of
   14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   15    General Public License for more details.
   16 
   17    You should have received a copy of the GNU General Public License
   18    along with this program; see the file COPYING.  If not, write to
   19    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   20    Boston, MA 02111-1307, USA.
   21 */
   22 
   23 #ifndef DDS_H
   24 #define DDS_H
   25 
   26 typedef enum
   27 {
   28    DDS_COMPRESS_NONE = 0,
   29    DDS_COMPRESS_BC1,        /* DXT1  */
   30    DDS_COMPRESS_BC2,        /* DXT3  */
   31    DDS_COMPRESS_BC3,        /* DXT5  */
   32    DDS_COMPRESS_BC3N,       /* DXT5n */
   33    DDS_COMPRESS_BC4,        /* ATI1  */
   34    DDS_COMPRESS_BC5,        /* ATI2  */
   35    DDS_COMPRESS_AEXP,       /* DXT5  */
   36    DDS_COMPRESS_YCOCG,      /* DXT5  */
   37    DDS_COMPRESS_YCOCGS,     /* DXT5  */
   38    DDS_COMPRESS_MAX
   39 } DDS_COMPRESSION_TYPE;
   40 
   41 typedef enum
   42 {
   43    DDS_SAVE_SELECTED_LAYER = 0,
   44    DDS_SAVE_CUBEMAP,
   45    DDS_SAVE_VOLUMEMAP,
   46    DDS_SAVE_MAX
   47 } DDS_SAVE_TYPE;
   48 
   49 typedef enum
   50 {
   51    DDS_FORMAT_DEFAULT = 0,
   52    DDS_FORMAT_RGB8,
   53    DDS_FORMAT_RGBA8,
   54    DDS_FORMAT_BGR8,
   55    DDS_FORMAT_ABGR8,
   56    DDS_FORMAT_R5G6B5,
   57    DDS_FORMAT_RGBA4,
   58    DDS_FORMAT_RGB5A1,
   59    DDS_FORMAT_RGB10A2,
   60    DDS_FORMAT_R3G3B2,
   61    DDS_FORMAT_A8,
   62    DDS_FORMAT_L8,
   63    DDS_FORMAT_L8A8,
   64    DDS_FORMAT_AEXP,
   65    DDS_FORMAT_YCOCG,
   66    DDS_FORMAT_MAX
   67 } DDS_FORMAT_TYPE;
   68 
   69 typedef enum
   70 {
   71    DDS_COLOR_DEFAULT = 0,
   72    DDS_COLOR_DISTANCE,
   73    DDS_COLOR_LUMINANCE,
   74    DDS_COLOR_INSET_BBOX,
   75    DDS_COLOR_MAX
   76 } DDS_COLOR_TYPE;
   77 
   78 typedef enum
   79 {
   80    DDS_MIPMAP_DEFAULT = 0,
   81    DDS_MIPMAP_NEAREST,
   82    DDS_MIPMAP_BOX,
   83    DDS_MIPMAP_BILINEAR,
   84    DDS_MIPMAP_BICUBIC,
   85    DDS_MIPMAP_LANCZOS,
   86    DDS_MIPMAP_MAX
   87 } DDS_MIPMAP_TYPE;
   88 
   89 #define DDS_HEADERSIZE             128
   90 
   91 #define DDSD_CAPS                  0x00000001
   92 #define DDSD_HEIGHT                0x00000002
   93 #define DDSD_WIDTH                 0x00000004
   94 #define DDSD_PITCH                 0x00000008
   95 #define DDSD_PIXELFORMAT           0x00001000
   96 #define DDSD_MIPMAPCOUNT           0x00020000
   97 #define DDSD_LINEARSIZE            0x00080000
   98 #define DDSD_DEPTH                 0x00800000
   99 
  100 #define DDPF_ALPHAPIXELS           0x00000001
  101 #define DDPF_ALPHA                 0x00000002
  102 #define DDPF_FOURCC                0x00000004
  103 #define DDPF_PALETTEINDEXED8       0x00000020
  104 #define DDPF_RGB                   0x00000040
  105 #define DDPF_LUMINANCE             0x00020000
  106 
  107 #define DDSCAPS_COMPLEX            0x00000008
  108 #define DDSCAPS_TEXTURE            0x00001000
  109 #define DDSCAPS_MIPMAP             0x00400000
  110 
  111 #define DDSCAPS2_CUBEMAP           0x00000200
  112 #define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400
  113 #define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800
  114 #define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000
  115 #define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000
  116 #define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000
  117 #define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000
  118 #define DDSCAPS2_VOLUME            0x00200000
  119 
  120 typedef struct __attribute__((packed))
  121 {
  122    unsigned int size;
  123    unsigned int flags;
  124    char fourcc[4];
  125    unsigned int bpp;
  126    unsigned int rmask;
  127    unsigned int gmask;
  128    unsigned int bmask;
  129    unsigned int amask;
  130 } dds_pixel_format_t;
  131 
  132 typedef struct __attribute__((packed))
  133 {
  134    unsigned int caps1;
  135    unsigned int caps2;
  136    unsigned int reserved[2];
  137 } dds_caps_t;
  138 
  139 typedef struct __attribute__((packed))
  140 {
  141    char magic[4];
  142    unsigned int size;
  143    unsigned int flags;
  144    unsigned int height;
  145    unsigned int width;
  146    unsigned int pitch_or_linsize;
  147    unsigned int depth;
  148    unsigned int num_mipmaps;
  149    unsigned char reserved[4 * 11];
  150    dds_pixel_format_t pixelfmt;
  151    dds_caps_t caps;
  152    unsigned int reserved2;
  153 } dds_header_t;
  154 
  155 #endif

ViewVC Help
Powered by ViewVC 1.0.4