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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 56 - (download) (as text) (annotate)
Wed Jan 31 18:56:21 2007 UTC (2 years, 9 months ago) by cocidius
File size: 3425 byte(s)
1.2.1 release
    1 /*
    2    DDS GIMP plugin
    3 
    4    Copyright (C) 2004 Shawn Kirst <skirst@fuse.net>,
    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_DXT1,
   30    DDS_COMPRESS_DXT3,
   31    DDS_COMPRESS_DXT5,
   32    DDS_COMPRESS_ATI1,
   33    DDS_COMPRESS_ATI2,
   34    DDS_COMPRESS_MAX
   35 } DDS_COMPRESSION_TYPE;
   36 
   37 typedef enum
   38 {
   39    DDS_SAVE_SELECTED_LAYER = 0,
   40    DDS_SAVE_CUBEMAP,
   41    DDS_SAVE_VOLUMEMAP,
   42    DDS_SAVE_MAX
   43 } DDS_SAVE_TYPE;
   44 
   45 typedef enum
   46 {
   47    DDS_FORMAT_DEFAULT = 0,
   48    DDS_FORMAT_RGB8,
   49    DDS_FORMAT_RGBA8,
   50    DDS_FORMAT_BGR8,
   51    DDS_FORMAT_ABGR8,
   52    DDS_FORMAT_R5G6B5,
   53    DDS_FORMAT_RGBA4,
   54    DDS_FORMAT_RGB5A1,
   55    DDS_FORMAT_RGB10A2,
   56    DDS_FORMAT_R3G3B2,
   57    DDS_FORMAT_L8,
   58    DDS_FORMAT_L8A8,
   59    DDS_FORMAT_MAX
   60 } DDS_FORMAT_TYPE;
   61 
   62 #define DDS_HEADERSIZE             128
   63 
   64 #define DDSD_CAPS                  0x00000001
   65 #define DDSD_HEIGHT                0x00000002
   66 #define DDSD_WIDTH                 0x00000004
   67 #define DDSD_PITCH                 0x00000008
   68 #define DDSD_PIXELFORMAT           0x00001000
   69 #define DDSD_MIPMAPCOUNT           0x00020000
   70 #define DDSD_LINEARSIZE            0x00080000
   71 #define DDSD_DEPTH                 0x00800000
   72 
   73 #define DDPF_ALPHAPIXELS           0x00000001
   74 #define DDPF_FOURCC                0x00000004
   75 #define DDPF_PALETTEINDEXED8       0x00000020
   76 #define DDPF_RGB                   0x00000040
   77 #define DDPF_LUMINANCE             0x00020000
   78 
   79 #define DDSCAPS_COMPLEX            0x00000008
   80 #define DDSCAPS_TEXTURE            0x00001000
   81 #define DDSCAPS_MIPMAP             0x00400000
   82 
   83 #define DDSCAPS2_CUBEMAP           0x00000200
   84 #define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400
   85 #define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800
   86 #define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000
   87 #define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000
   88 #define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000
   89 #define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000
   90 #define DDSCAPS2_VOLUME            0x00200000
   91 
   92 typedef struct __attribute__((packed))
   93 {
   94    unsigned int size;
   95    unsigned int flags;
   96    char fourcc[4];
   97    unsigned int bpp;
   98    unsigned int rmask;
   99    unsigned int gmask;
  100    unsigned int bmask;
  101    unsigned int amask;
  102 } dds_pixel_format_t;
  103 
  104 typedef struct __attribute__((packed))
  105 {
  106    unsigned int caps1;
  107    unsigned int caps2;
  108    unsigned int reserved[2];
  109 } dds_caps_t;
  110 
  111 typedef struct __attribute__((packed))
  112 {
  113    char magic[4];
  114    unsigned int size;
  115    unsigned int flags;
  116    unsigned int height;
  117    unsigned int width;
  118    unsigned int pitch_or_linsize;
  119    unsigned int depth;
  120    unsigned int num_mipmaps;
  121    unsigned char reserved[4 * 11];
  122    dds_pixel_format_t pixelfmt;
  123    dds_caps_t caps;
  124    unsigned int reserved2;
  125 } dds_header_t;
  126 
  127 #endif

ViewVC Help
Powered by ViewVC 1.0.4