ImageData

ImageData
Scaleform::Render::ImageData
Declaration
class ImageData;
Description

 

ImageData describes the image data in addressable memory that can be accessed and modified directly. ImageData is usually initialized by Image::Map or Texture::Map functions; it can also be created as a temporary on stack. 

ImageData can include any number of channel and mip-level planes, addressable individually based on plane index. Many standard format images will have only one data plane, plane 0. The size of the image is the size of its 0th plane. 

Right now, it is assumed that there is a fixed relationship between image size and the size of all its extra planes, as reported by GetFormatPlaneSize. In the future this may change, which would require extra Image::Create functions. 

Image planes are numbered first by the order of data channels in ImageFormat, then by mip-map level index. Image_R8G8B8A8, for example, has only one channel, thus the index of a plane and mipmap is the same. Image_Y8_U2_V2, however, has three data planes, indexed as {Y = 0, U = 1, V = 2}. If such an image also has mip-map levels, the U plane of a second mipmap (first down from the top level), would have an index of 5. 

For efficiency, ImageData stores one ImagePlane directly as a data member, allocating additional planes only when they are needed. For standard system-memory formats, additional mipmap data is stored immediately following the top level data, so its location and size can be computed without keeping additional ImagePlane structure for every level. Such compact plane storage is used by default unless "SeparateMipmaps" flag is specified, so a call to GetPlane() actually computes the requested memory location based on the top-level plane and its format.

Data Members
Data Member 
Description 
ImageData flags. 
Format of the image data. 
Number of mipmap levels. 
Array of colors for a palette-based image, null if not available. 
Array of ImagePlane structures, potentially allocated. 
Number of indexable ImagePlane structure at pPlanes
Use 
ImageUse flags. 
Methods
Method 
Description 
Clears the image data from the memory, by resetting the image format (ImageFormat) to Image_None with no planes. 
Compute a hash code based on image contents. Can be useful for comparing images. 
Retrieves the data contents of the image data. 
Returns the color map for the palette-based image. 
Obtains the format of the image data. 
Returns the image format without the 'Convertible' flag. 
Returns the number of planes for a particular image format. 
Returns the image size of a plane for a particular image format. 
Returns the pitch (distance in bytes between rows) of the given image format. 
Obtains the number of scan-lines. 
Retrieves the height of the image. 
Returns the number of the mipmap levels in the image data. 
Returns the number of bits per pixel in the image. 
Calculates the size of the given mipmap level in bytes, given format and size. 
Calculates the total size of all mipmaps levels in bytes, given format and size. 
Finds the corresponding image plane given a miplevel and plane index. 
Obtains the type of pixel format that the image has. 
Obtains the pitch of the image in bytes. 
Returns the pixel at the specified coordinates in an image. 
Copies the specified ImagePlane into the location pointed to by pplane. 
 
Returns the number of planes in the ImageData. 
Returns reference to the image plane. 
Obtains the size of the image. 
Access the scanline of the image. 
Retrieves the width of the image. 
Initializes ImageData with the specified values. 
Determines if the mipmap levels have separately allocated data planes. 
Initializes ImageData with the specified values. 
Initializes the ImageData object to the specified image format and number of mipmaps, while also initializing it to use pre-allocated raw data planes. 
Initializes the ImageData object to accommodate the specified image format and number of mipmaps. If separateMipmaps is specified, stores all mipmaps in a single raw data plane. 
Initializes the ImageData object to the specified format, size and data. Image format must have only one data plane. 
Initialize functions used to completely re-initialize ImageData, clearing all values, changing format and potentially allocating the needed number of planes. 
Determines if the image data uses a compressed format. 
Determines if the format of the image is in compressed format or not. 
Initializes ImageData to a sub-range of levels from source, which should have valid planes. 
 
Determines if the image data is of hardware-specific image format. 
Sets an alpha channel of a pixel at specified coordinates. 
Sets a pixel at specified coordinates in an image. 
Sets a pixel at specified coordinates in an image. 
Sets plane data contents. 
Read 
Reads the image data. 
Writes the image data. 
Topics
Topic 
Description 
An enumeration listing the ImageData flags. 
Operators
Operator 
Description 
== 
Determines if all aspects of the two images matches, including the layout. 
File

Render_Image.h