PixelLightAPI
.
|
#include <ImageBuffer.h>
Public Member Functions | |
ImageBuffer () | |
Constructor. | |
ImageBuffer (const ImageBuffer &cSource) | |
Copy constructor. | |
~ImageBuffer () | |
Destructor. | |
ImageBuffer & | operator= (const ImageBuffer &cSource) |
Assignment operator. | |
void | CreateImage (EDataFormat nDataFormat, EColorFormat nColorFormat, const PLMath::Vector3i &vSize, ECompression nCompression=CompressionNone) |
Create image. | |
void | Clear () |
Clear data. | |
PLGRAPHICS_API void | ApplyEffect (const ImageEffect &cEffect) |
Apply image effect. | |
PLGRAPHICS_API ECheckConsistency | CheckConsistency () const |
Check image for possible problems. | |
void | CreateTestImage (ETestImage nTestImage=TestImage2DSimple) |
Create a test image. | |
EDataFormat | GetDataFormat () const |
Get data format. | |
EColorFormat | GetColorFormat () const |
Get color format. | |
PLCore::uint32 | GetComponentsPerPixel () const |
Returns the number of components per pixel. | |
PLCore::uint32 | GetBytesPerPixelComponent () const |
Returns the number of bytes per pixel component. | |
PLCore::uint32 | GetBytesPerPixel () const |
Returns the number of bytes per pixel. | |
ECompression | GetCompression () const |
Get compression type. | |
void | SetCompression (ECompression nCompression) |
Set compression type. | |
PLMath::Vector3i | GetSize () const |
Get image size. | |
PLCore::uint32 | GetNumOfPixels () const |
Returns the number of pixels. | |
bool | HasAnyData () const |
Check if uncompressed or compressed data is available. | |
bool | HasData () const |
Check if uncompressed data is available. | |
PLCore::uint32 | GetDataSize () const |
Get size of image data in bytes. | |
PLCore::uint32 | GetRowSize () const |
Get size of one row of image data in bytes. | |
const PLCore::uint8 * | GetData () const |
Get image data. | |
PLCore::uint8 * | GetData () |
bool | HasCompressedData () const |
Check if compressed data is available. | |
PLCore::uint32 | GetCompressedDataSize () const |
Get size of compressed image data in bytes. | |
const PLCore::uint8 * | GetCompressedData () const |
Get compressed image data. | |
PLCore::uint8 * | GetCompressedData () |
bool | Compress () |
Compress image data. | |
bool | Decompress () |
Decompress image data. | |
void | SetPalette (ImagePalette *pPalette) |
Set color palette. | |
const ImagePalette * | GetPalette () const |
Get color palette. | |
ImagePalette * | GetPalette () |
void | CopyData (const PLCore::uint8 *pnData) |
Copy provided uncompressed image data into this image buffer. | |
void | TakeoverData (PLCore::uint8 *pnData) |
Let this image buffer takeover provided uncompressed image data. | |
void | ShareData (PLCore::uint8 *pnData) |
Let this image buffer share provided uncompressed image data. | |
Static Public Member Functions | |
static PLGRAPHICS_API PLCore::uint32 | GetComponentsPerPixel (EColorFormat nColorFormat) |
Returns the number of components per pixel. | |
static PLGRAPHICS_API PLCore::uint32 | GetBytesPerPixelComponent (EDataFormat nDataFormat) |
Returns the number of bytes per pixel component. | |
static PLCore::uint32 | GetBytesPerPixel (EDataFormat nDataFormat, EColorFormat nColorFormat) |
Returns the number of bytes per pixel. | |
static PLGRAPHICS_API PLCore::uint32 | GetMipmapSize (PLCore::uint32 nBaseSize, PLCore::uint32 nMipmap) |
Returns the size of a certain mipmap. | |
static bool | IsAlphaChannelColorFormat (EColorFormat nColorFormat) |
Returns whether or not the given color format has an alpha channel. | |
static PLGRAPHICS_API EColorFormat | GetAlphaChannelColorFormat (EColorFormat nColorFormat) |
Returns a version with alpha channel of the given color format. | |
static PLGRAPHICS_API EColorFormat | GetNoneAlphaChannelColorFormat (EColorFormat nColorFormat) |
Returns a version without alpha channel of the given color format. |
Image buffer class.
PLGraphics::ImageBuffer::ImageBuffer | ( | ) | [inline] |
Constructor.
PLGraphics::ImageBuffer::ImageBuffer | ( | const ImageBuffer & | cSource | ) | [inline] |
Copy constructor.
[in] | cSource | Source to copy from |
PLGraphics::ImageBuffer::~ImageBuffer | ( | ) | [inline] |
Destructor.
static PLGRAPHICS_API PLCore::uint32 PLGraphics::ImageBuffer::GetComponentsPerPixel | ( | EColorFormat | nColorFormat | ) | [static] |
Returns the number of components per pixel.
[in] | nColorFormat | Color format |
static PLGRAPHICS_API PLCore::uint32 PLGraphics::ImageBuffer::GetBytesPerPixelComponent | ( | EDataFormat | nDataFormat | ) | [static] |
Returns the number of bytes per pixel component.
[in] | nDataFormat | Data format |
PLCore::uint32 PLGraphics::ImageBuffer::GetBytesPerPixel | ( | EDataFormat | nDataFormat, |
EColorFormat | nColorFormat | ||
) | [inline, static] |
Returns the number of bytes per pixel.
[in] | nDataFormat | Data format |
[in] | nColorFormat | Color format |
static PLGRAPHICS_API PLCore::uint32 PLGraphics::ImageBuffer::GetMipmapSize | ( | PLCore::uint32 | nBaseSize, |
PLCore::uint32 | nMipmap | ||
) | [static] |
Returns the size of a certain mipmap.
[in] | nBaseSize | Size of the base level |
[in] | nMipmap | Mipmap level |
bool PLGraphics::ImageBuffer::IsAlphaChannelColorFormat | ( | EColorFormat | nColorFormat | ) | [inline, static] |
Returns whether or not the given color format has an alpha channel.
[in] | nColorFormat | Color format to check |
static PLGRAPHICS_API EColorFormat PLGraphics::ImageBuffer::GetAlphaChannelColorFormat | ( | EColorFormat | nColorFormat | ) | [static] |
Returns a version with alpha channel of the given color format.
[in] | nColorFormat | Color format to return a color format with alpha channel from |
static PLGRAPHICS_API EColorFormat PLGraphics::ImageBuffer::GetNoneAlphaChannelColorFormat | ( | EColorFormat | nColorFormat | ) | [static] |
Returns a version without alpha channel of the given color format.
[in] | nColorFormat | Color format to return a color format without alpha channel from |
ImageBuffer & PLGraphics::ImageBuffer::operator= | ( | const ImageBuffer & | cSource | ) | [inline] |
Assignment operator.
[in] | cSource | Source to copy from |
void PLGraphics::ImageBuffer::CreateImage | ( | EDataFormat | nDataFormat, |
EColorFormat | nColorFormat, | ||
const PLMath::Vector3i & | vSize, | ||
ECompression | nCompression = CompressionNone |
||
) | [inline] |
Create image.
[in] | nDataFormat | Desired data format (for example "DataByte") |
[in] | nColorFormat | Desired color format (for example "ColorRGB") |
[in] | vSize | Image size (for example "PLMath::Vector3i(64, 32, 1)") |
[in] | nCompression | Compression type (for example "CompressionNone") |
void PLGraphics::ImageBuffer::Clear | ( | ) | [inline] |
Clear data.
PLGRAPHICS_API void PLGraphics::ImageBuffer::ApplyEffect | ( | const ImageEffect & | cEffect | ) |
Apply image effect.
[in] | cEffect | Image effect |
PLGRAPHICS_API ECheckConsistency PLGraphics::ImageBuffer::CheckConsistency | ( | ) | const |
Check image for possible problems.
void PLGraphics::ImageBuffer::CreateTestImage | ( | ETestImage | nTestImage = TestImage2DSimple | ) | [inline] |
Create a test image.
[in] | nTestImage | ID of test image |
EDataFormat PLGraphics::ImageBuffer::GetDataFormat | ( | ) | const [inline] |
Get data format.
EColorFormat PLGraphics::ImageBuffer::GetColorFormat | ( | ) | const [inline] |
Get color format.
PLCore::uint32 PLGraphics::ImageBuffer::GetComponentsPerPixel | ( | ) | const [inline] |
Returns the number of components per pixel.
PLCore::uint32 PLGraphics::ImageBuffer::GetBytesPerPixelComponent | ( | ) | const [inline] |
Returns the number of bytes per pixel component.
PLCore::uint32 PLGraphics::ImageBuffer::GetBytesPerPixel | ( | ) | const [inline] |
Returns the number of bytes per pixel.
ECompression PLGraphics::ImageBuffer::GetCompression | ( | ) | const [inline] |
Get compression type.
void PLGraphics::ImageBuffer::SetCompression | ( | ECompression | nCompression | ) | [inline] |
Set compression type.
[in] | nCompression | Compression type |
PLMath::Vector3i PLGraphics::ImageBuffer::GetSize | ( | ) | const [inline] |
Get image size.
PLCore::uint32 PLGraphics::ImageBuffer::GetNumOfPixels | ( | ) | const [inline] |
Returns the number of pixels.
bool PLGraphics::ImageBuffer::HasAnyData | ( | ) | const [inline] |
Check if uncompressed or compressed data is available.
bool PLGraphics::ImageBuffer::HasData | ( | ) | const [inline] |
Check if uncompressed data is available.
PLCore::uint32 PLGraphics::ImageBuffer::GetDataSize | ( | ) | const [inline] |
Get size of image data in bytes.
PLCore::uint32 PLGraphics::ImageBuffer::GetRowSize | ( | ) | const [inline] |
Get size of one row of image data in bytes.
const PLCore::uint8 * PLGraphics::ImageBuffer::GetData | ( | ) | const [inline] |
Get image data.
PLCore::uint8 * PLGraphics::ImageBuffer::GetData | ( | ) | [inline] |
bool PLGraphics::ImageBuffer::HasCompressedData | ( | ) | const [inline] |
Check if compressed data is available.
PLCore::uint32 PLGraphics::ImageBuffer::GetCompressedDataSize | ( | ) | const [inline] |
Get size of compressed image data in bytes.
const PLCore::uint8 * PLGraphics::ImageBuffer::GetCompressedData | ( | ) | const [inline] |
Get compressed image data.
PLCore::uint8 * PLGraphics::ImageBuffer::GetCompressedData | ( | ) | [inline] |
bool PLGraphics::ImageBuffer::Compress | ( | ) | [inline] |
Compress image data.
bool PLGraphics::ImageBuffer::Decompress | ( | ) | [inline] |
Decompress image data.
void PLGraphics::ImageBuffer::SetPalette | ( | ImagePalette * | pPalette | ) | [inline] |
Set color palette.
[in] | pPalette | Pointer to color palette, or a null pointer if the image has no palette |
const ImagePalette * PLGraphics::ImageBuffer::GetPalette | ( | ) | const [inline] |
Get color palette.
ImagePalette * PLGraphics::ImageBuffer::GetPalette | ( | ) | [inline] |
void PLGraphics::ImageBuffer::CopyData | ( | const PLCore::uint8 * | pnData | ) | [inline] |
Copy provided uncompressed image data into this image buffer.
[in] | pnData | Data to copy into this image buffer, must have enough bytes to fill the whole image! If null pointer, this method does nothing. |
void PLGraphics::ImageBuffer::TakeoverData | ( | PLCore::uint8 * | pnData | ) | [inline] |
Let this image buffer takeover provided uncompressed image data.
[in] | pnData | Pointer to the image data to be taken over by this image buffer, must have enough bytes to fill the whole image buffer! If null pointer, this method does nothing. |
void PLGraphics::ImageBuffer::ShareData | ( | PLCore::uint8 * | pnData | ) | [inline] |
Let this image buffer share provided uncompressed image data.
[in] | pnData | Pointer to the image data to be shared by this image buffer, must have enough bytes to fill the whole image buffer! If null pointer, this method does nothing. |
|