DrawableImage::Decode

DrawableImage::Decode
virtual bool Decode(ImageData* pdest, CopyScanlineFunc copyScanline = CopyScanlineDefault, void* arg = 0) const;
Description

Decode decodes image into the destination ImageData, potentially converting data a scan-line at a time. The following cases can be handled: 

For Generic formats

- Decode should happen a scan-line at a time for each plane by calling copyScanline if provided. 

- Destination format must match Source format with convertible bits masked on both. 

- Destination Size >= Source Size. 

- Destination must have at least one mipLevel. In general, planeCounts should match, but total mipLevels count MAY BE SMALLER in dest, in case back-end driver decided to drop some bottom-level mipLevels. 

For HW formats

- Decode will copy data as one block of DataSize per plane. 

- Destination format must match Source format without convertible bit. 

- Size and planeCount must match for both source and destination. 

Decode can be called from the rendering until releaseTexture() takes place. This means that Image object should remain thread-safe (have immutable structure from the CreateTexture/GetTexture call until texture release).

Parameters
Parameters 
Description 
ImageData* pdest 
Pointer to the destination image, ImageData. 
CopyScanlineFunc copyScanline = CopyScanlineDefault 
The scan-line copy function type used for decoding the image. 
void* arg = 0 
An argument which is passed into the scanline copy function. 
Return Value

Returns true if decoding was successful and false otherwise.