AtlasTexChunk Class Reference [Atlas Resource System]

#include <atlasTexChunk.h>

Inheritance diagram for AtlasTexChunk:

Inheritance graph
[legend]
List of all members.

Detailed Description

Atlas chunk subclass for textures.

This is where the real meat for textures lives; texture chunks may be in a variety of formats, and include several textures worth of opacity map data if they are used in that role.


Public Types

typedef AtlasChunk Parent
 FormatJPEG
 Use (lossy) JPEG compression.
 FormatPNG
 Use (lossless) PNG compression.
 FormatDDS
 Use (fast-to-load, big, lossy) DDS with DXT compression.
enum  TexFormat {
  FormatJPEG,
  FormatPNG,
  FormatDDS
}

Public Member Functions

 AtlasTexChunk ()
 ~AtlasTexChunk ()
virtual void read (Stream *s)
 Deserialize from a stream.
virtual void write (Stream *s)
 Serialize this chunk to a stream.
virtual U32 getHeadSentinel ()
virtual U32 getTailSentinel ()
virtual void process ()
 Once the chunk has been loaded (in another thread), this is called in the main thread to prepare any complex resources.
void generate (AtlasChunk *children[4])
 Given four children, (re)generate the data for this one.
const bool isBitmapTexFormat (const TexFormat f) const
AtlasTexChunkgenerateCopy (S32 reformat=-1)

Static Public Member Functions

static GBitmaploadDDSIntoGBitmap (const U8 *ddsBuffer, U32 ddsBufferSize)

Public Attributes

TexFormat mFormat
U8 layerCount
 If we're storing opacity map data there may be more than one layer worth of image data.
GBitmapbitmap
DDSFiledds

Private Member Functions

void writeDDS (Stream *s)


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
FormatJPEG  Use (lossy) JPEG compression.
FormatPNG  Use (lossless) PNG compression.
FormatDDS  Use (fast-to-load, big, lossy) DDS with DXT compression.


Constructor & Destructor Documentation

AtlasTexChunk::AtlasTexChunk (  ) 

AtlasTexChunk::~AtlasTexChunk (  ) 


Member Function Documentation

void AtlasTexChunk::writeDDS ( Stream s  )  [private]

virtual void AtlasTexChunk::read ( Stream s  )  [virtual]

Deserialize from a stream.

See also:
You probably want to use readFromStream()

Reimplemented from AtlasChunk.

virtual void AtlasTexChunk::write ( Stream s  )  [virtual]

Serialize this chunk to a stream.

See also:
You probably want to use prepareDeferredWrite()

Reimplemented from AtlasChunk.

virtual U32 AtlasTexChunk::getHeadSentinel (  )  [virtual]

Reimplemented from AtlasChunk.

virtual U32 AtlasTexChunk::getTailSentinel (  )  [virtual]

Reimplemented from AtlasChunk.

virtual void AtlasTexChunk::process (  )  [virtual]

Once the chunk has been loaded (in another thread), this is called in the main thread to prepare any complex resources.

(For instance, a texture or VB, that depend on access to GFX to initialize.)

Reimplemented from AtlasChunk.

void AtlasTexChunk::generate ( AtlasChunk children[4]  )  [virtual]

Given four children, (re)generate the data for this one.

Their order starts at topleft, clockwise, 0123.

Reimplemented from AtlasChunk.

const bool AtlasTexChunk::isBitmapTexFormat ( const TexFormat  f  )  const [inline]

AtlasTexChunk* AtlasTexChunk::generateCopy ( S32  reformat = -1  ) 

static GBitmap* AtlasTexChunk::loadDDSIntoGBitmap ( const U8 ddsBuffer,
U32  ddsBufferSize 
) [static]


Member Data Documentation

If we're storing opacity map data there may be more than one layer worth of image data.

(e.g. we have 10 channels of opacity data and PNG only supports 4 channels/image, so we'd have to have 3 layers).

TOC versions prior than 150 only support a layerCount of 1.