• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KImgIO

dds.cpp File Reference

#include "dds.h"
#include <QtCore/QStringList>
#include <QtGui/QImage>
#include <QtCore/QDataStream>
#include <kglobal.h>
#include <kdebug.h>
#include <math.h>

Include dependency graph for dds.cpp:

Go to the source code of this file.


Defines

#define CUBE_LAYOUT   HORIZONTAL
#define HORIZONTAL   1
#define MAKEFOURCC(ch0, ch1, ch2, ch3)
#define sqrtf(x)   ((float)sqrt(x))
#define VERTICAL   2

Typedefs

typedef bool(* TextureLoader )(QDataStream &s, const DDSHeader &header, QImage &img)
typedef quint8 uchar
typedef quint32 uint
typedef quint16 ushort

Enumerations

enum  DDSType {
  DDS_A8R8G8B8 = 0, DDS_A1R5G5B5 = 1, DDS_A4R4G4B4 = 2, DDS_R8G8B8 = 3,
  DDS_R5G6B5 = 4, DDS_DXT1 = 5, DDS_DXT2 = 6, DDS_DXT3 = 7,
  DDS_DXT4 = 8, DDS_DXT5 = 9, DDS_RXGB = 10, DDS_ATI2 = 11,
  DDS_UNKNOWN
}

Functions

static int FaceOffset (const DDSHeader &header)
static TextureLoader GetTextureLoader (DDSType type)
static DDSType GetType (const DDSHeader &header)
static bool HasAlpha (const DDSHeader &header)
static bool IsCubeMap (const DDSHeader &header)
static bool IsSupported (const DDSHeader &header)
static bool IsValid (const DDSHeader &header)
static bool LoadA1R5G5B5 (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadA4R4G4B4 (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadA8R8G8B8 (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadATI2 (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadCubeMap (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadDXT1 (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadDXT2 (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadDXT3 (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadDXT4 (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadDXT5 (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadR5G6B5 (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadR8G8B8 (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadRXGB (QDataStream &s, const DDSHeader &header, QImage &img)
static bool LoadTexture (QDataStream &s, const DDSHeader &header, QImage &img)
static QDataStream & operator>> (QDataStream &s, BlockDXTAlphaLinear &c)
static QDataStream & operator>> (QDataStream &s, BlockDXTAlphaExplicit &c)
static QDataStream & operator>> (QDataStream &s, BlockDXT &c)
static QDataStream & operator>> (QDataStream &s, Color565 &c)
static QDataStream & operator>> (QDataStream &s, DDSHeader &header)
static QDataStream & operator>> (QDataStream &s, DDSCaps &caps)
static QDataStream & operator>> (QDataStream &s, DDSPixelFormat &pf)

Variables

static const uint DDPF_ALPHAPIXELS = 0x00000001l
static const uint DDPF_FOURCC = 0x00000004l
static const uint DDPF_RGB = 0x00000040l
static const uint DDSCAPS2_CUBEMAP = 0x00000200l
static const uint DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800l
static const uint DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000l
static const uint DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x00008000l
static const uint DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400l
static const uint DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000l
static const uint DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000l
static const uint DDSCAPS2_VOLUME = 0x00200000l
static const uint DDSCAPS_TEXTURE = 0x00001000l
static const uint DDSD_CAPS = 0x00000001l
static const uint DDSD_HEIGHT = 0x00000002l
static const uint DDSD_PITCH = 0x00000008l
static const uint DDSD_PIXELFORMAT = 0x00001000l
static const uint DDSD_WIDTH = 0x00000004l
static int face_flags [6]
static int face_offset [6][2] = { {2, 1}, {0, 1}, {1, 0}, {1, 2}, {1, 1}, {3, 1} }
static const uint FOURCC_ATI2 = MAKEFOURCC('A', 'T', 'I', '2')
static const uint FOURCC_DDS = MAKEFOURCC('D', 'D', 'S', ' ')
static const uint FOURCC_DXT1 = MAKEFOURCC('D', 'X', 'T', '1')
static const uint FOURCC_DXT2 = MAKEFOURCC('D', 'X', 'T', '2')
static const uint FOURCC_DXT3 = MAKEFOURCC('D', 'X', 'T', '3')
static const uint FOURCC_DXT4 = MAKEFOURCC('D', 'X', 'T', '4')
static const uint FOURCC_DXT5 = MAKEFOURCC('D', 'X', 'T', '5')
static const uint FOURCC_RXGB = MAKEFOURCC('R', 'X', 'G', 'B')

Define Documentation

#define CUBE_LAYOUT   HORIZONTAL

Definition at line 49 of file dds.cpp.

#define HORIZONTAL   1

Definition at line 47 of file dds.cpp.

#define MAKEFOURCC ( ch0,
ch1,
ch2,
ch3   ) 

Value:

(uint(uchar(ch0)) | (uint(uchar(ch1)) << 8) | \
        (uint(uchar(ch2)) << 16) | (uint(uchar(ch3)) << 24 ))

Definition at line 42 of file dds.cpp.

#define sqrtf ( x   )     ((float)sqrt(x))

Definition at line 34 of file dds.cpp.

#define VERTICAL   2

Definition at line 48 of file dds.cpp.


Typedef Documentation

typedef bool(* TextureLoader)(QDataStream &s, const DDSHeader &header, QImage &img)

Definition at line 769 of file dds.cpp.

typedef quint8 uchar

Definition at line 39 of file dds.cpp.

typedef quint32 uint

Definition at line 37 of file dds.cpp.

typedef quint16 ushort

Definition at line 38 of file dds.cpp.


Enumeration Type Documentation

enum DDSType

Enumerator:
DDS_A8R8G8B8 
DDS_A1R5G5B5 
DDS_A4R4G4B4 
DDS_R8G8B8 
DDS_R5G6B5 
DDS_DXT1 
DDS_DXT2 
DDS_DXT3 
DDS_DXT4 
DDS_DXT5 
DDS_RXGB 
DDS_ATI2 
DDS_UNKNOWN 

Definition at line 117 of file dds.cpp.


Function Documentation

static int FaceOffset ( const DDSHeader &  header  )  [static]

Definition at line 827 of file dds.cpp.

static TextureLoader GetTextureLoader ( DDSType  type  )  [static]

Definition at line 772 of file dds.cpp.

static DDSType GetType ( const DDSHeader &  header  )  [static]

Definition at line 226 of file dds.cpp.

static bool HasAlpha ( const DDSHeader &  header  )  [static]

Definition at line 267 of file dds.cpp.

static bool IsCubeMap ( const DDSHeader &  header  )  [static]

Definition at line 272 of file dds.cpp.

static bool IsSupported ( const DDSHeader &  header  )  [static]

Definition at line 277 of file dds.cpp.

static bool IsValid ( const DDSHeader &  header  )  [static]

Definition at line 206 of file dds.cpp.

static bool LoadA1R5G5B5 ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 322 of file dds.cpp.

static bool LoadA4R4G4B4 ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 343 of file dds.cpp.

static bool LoadA8R8G8B8 ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 288 of file dds.cpp.

static bool LoadATI2 ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 713 of file dds.cpp.

static bool LoadCubeMap ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 872 of file dds.cpp.

static bool LoadDXT1 ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 518 of file dds.cpp.

static bool LoadDXT2 ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 602 of file dds.cpp.

static bool LoadDXT3 ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 557 of file dds.cpp.

static bool LoadDXT4 ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 657 of file dds.cpp.

static bool LoadDXT5 ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 609 of file dds.cpp.

static bool LoadR5G6B5 ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 364 of file dds.cpp.

static bool LoadR8G8B8 ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 305 of file dds.cpp.

static bool LoadRXGB ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 664 of file dds.cpp.

static bool LoadTexture ( QDataStream &  s,
const DDSHeader &  header,
QImage &  img 
) [static]

Definition at line 805 of file dds.cpp.

static QDataStream& operator>> ( QDataStream &  s,
BlockDXTAlphaLinear &  c 
) [static]

Definition at line 512 of file dds.cpp.

static QDataStream& operator>> ( QDataStream &  s,
BlockDXTAlphaExplicit &  c 
) [static]

Definition at line 446 of file dds.cpp.

static QDataStream& operator>> ( QDataStream &  s,
BlockDXT &  c 
) [static]

Definition at line 437 of file dds.cpp.

static QDataStream& operator>> ( QDataStream &  s,
Color565 &  c 
) [static]

Definition at line 384 of file dds.cpp.

static QDataStream& operator>> ( QDataStream &  s,
DDSHeader &  header 
) [static]

Definition at line 188 of file dds.cpp.

static QDataStream& operator>> ( QDataStream &  s,
DDSCaps &  caps 
) [static]

Definition at line 165 of file dds.cpp.

static QDataStream& operator>> ( QDataStream &  s,
DDSPixelFormat &  pf 
) [static]

Definition at line 145 of file dds.cpp.


Variable Documentation

const uint DDPF_ALPHAPIXELS = 0x00000001l [static]

Definition at line 115 of file dds.cpp.

const uint DDPF_FOURCC = 0x00000004l [static]

Definition at line 114 of file dds.cpp.

const uint DDPF_RGB = 0x00000040l [static]

Definition at line 113 of file dds.cpp.

const uint DDSCAPS2_CUBEMAP = 0x00000200l [static]

Definition at line 104 of file dds.cpp.

const uint DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800l [static]

Definition at line 107 of file dds.cpp.

const uint DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000l [static]

Definition at line 109 of file dds.cpp.

const uint DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x00008000l [static]

Definition at line 111 of file dds.cpp.

const uint DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400l [static]

Definition at line 106 of file dds.cpp.

const uint DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000l [static]

Definition at line 108 of file dds.cpp.

const uint DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000l [static]

Definition at line 110 of file dds.cpp.

const uint DDSCAPS2_VOLUME = 0x00200000l [static]

Definition at line 103 of file dds.cpp.

const uint DDSCAPS_TEXTURE = 0x00001000l [static]

Definition at line 102 of file dds.cpp.

const uint DDSD_CAPS = 0x00000001l [static]

Definition at line 96 of file dds.cpp.

const uint DDSD_HEIGHT = 0x00000002l [static]

Definition at line 99 of file dds.cpp.

const uint DDSD_PITCH = 0x00000008l [static]

Definition at line 100 of file dds.cpp.

const uint DDSD_PIXELFORMAT = 0x00001000l [static]

Definition at line 97 of file dds.cpp.

const uint DDSD_WIDTH = 0x00000004l [static]

Definition at line 98 of file dds.cpp.

int face_flags[6] [static]

Initial value:

 {
        DDSCAPS2_CUBEMAP_POSITIVEX,
        DDSCAPS2_CUBEMAP_NEGATIVEX,
        DDSCAPS2_CUBEMAP_POSITIVEY,
        DDSCAPS2_CUBEMAP_NEGATIVEY,
        DDSCAPS2_CUBEMAP_POSITIVEZ,
        DDSCAPS2_CUBEMAP_NEGATIVEZ
    }

Definition at line 862 of file dds.cpp.

int face_offset[6][2] = { {2, 1}, {0, 1}, {1, 0}, {1, 2}, {1, 1}, {3, 1} } [static]

Definition at line 859 of file dds.cpp.

const uint FOURCC_ATI2 = MAKEFOURCC('A', 'T', 'I', '2') [static]

Definition at line 94 of file dds.cpp.

const uint FOURCC_DDS = MAKEFOURCC('D', 'D', 'S', ' ') [static]

Definition at line 87 of file dds.cpp.

const uint FOURCC_DXT1 = MAKEFOURCC('D', 'X', 'T', '1') [static]

Definition at line 88 of file dds.cpp.

const uint FOURCC_DXT2 = MAKEFOURCC('D', 'X', 'T', '2') [static]

Definition at line 89 of file dds.cpp.

const uint FOURCC_DXT3 = MAKEFOURCC('D', 'X', 'T', '3') [static]

Definition at line 90 of file dds.cpp.

const uint FOURCC_DXT4 = MAKEFOURCC('D', 'X', 'T', '4') [static]

Definition at line 91 of file dds.cpp.

const uint FOURCC_DXT5 = MAKEFOURCC('D', 'X', 'T', '5') [static]

Definition at line 92 of file dds.cpp.

const uint FOURCC_RXGB = MAKEFOURCC('R', 'X', 'G', 'B') [static]

Definition at line 93 of file dds.cpp.

KImgIO

Skip menu "KImgIO"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal