PixelLightAPI
.
|
#include <Image.h>
Public Member Functions | |
PLGRAPHICS_API | Image () |
Constructor. | |
PLGRAPHICS_API | Image (const Image &cSource) |
Copy constructor. | |
virtual PLGRAPHICS_API | ~Image () |
Destructor. | |
PLGRAPHICS_API Image & | operator= (const Image &cSource) |
Assignment operator. | |
PLGRAPHICS_API void | ApplyEffect (const ImageEffect &cEffect) |
Apply image effect. | |
PLGRAPHICS_API ECheckConsistency | CheckConsistency () const |
Check image for possible problems. | |
bool | IsMultiPart () const |
Check if this image is a multi-part image (e.g. a CubeMap) | |
PLCore::uint32 | GetNumOfParts () const |
Get number of image parts. | |
ImagePart * | GetPart (PLCore::uint32 nIndex) const |
Get image part. | |
ImagePart * | GetPartBySemantics (PLCore::uint32 nSemantics) const |
Get image part by semantics. | |
const PLCore::Container < ImagePart * > & | GetParts () const |
Get image parts. | |
PLGRAPHICS_API ImagePart * | CreatePart (PLCore::uint32 nSemantics=ImagePartStatic) |
Create a new image part. | |
PLGRAPHICS_API bool | DeletePart (ImagePart &cPart) |
Delete image part. | |
PLGRAPHICS_API ImageBuffer * | GetBuffer (PLCore::uint32 nPart=0, PLCore::uint32 nMipmap=0) const |
Get image buffer. | |
PLGRAPHICS_API void | CreateTestImage (ETestImage nTestImage=TestImage2DSimple) |
Create a test image. | |
virtual PLGRAPHICS_API bool | Unload () override |
Unloads the loadable. | |
virtual PLGRAPHICS_API PLCore::String | GetLoadableTypeName () const override |
Returns the loadable type name. | |
Static Public Member Functions | |
static PLGRAPHICS_API Image | CreateImage (EDataFormat nDataFormat, EColorFormat nColorFormat, const PLMath::Vector3i &vSize, ECompression nCompression=CompressionNone) |
Create image. | |
static PLGRAPHICS_API Image | CreateImageAndCopyData (EDataFormat nDataFormat, EColorFormat nColorFormat, const PLMath::Vector3i &vSize, ECompression nCompression=CompressionNone, const PLCore::uint8 *pnData=nullptr) |
Create image and copy given uncompressed image data. | |
static PLGRAPHICS_API Image | CreateImageAndTakeoverData (EDataFormat nDataFormat, EColorFormat nColorFormat, const PLMath::Vector3i &vSize, ECompression nCompression=CompressionNone, PLCore::uint8 *pnData=nullptr) |
Create image and takeover given uncompressed image data. | |
static PLGRAPHICS_API Image | CreateImageAndShareData (EDataFormat nDataFormat, EColorFormat nColorFormat, const PLMath::Vector3i &vSize, ECompression nCompression=CompressionNone, PLCore::uint8 *pnData=nullptr) |
Create image and share given uncompressed image data. |
Image class.
* Usage example: * * // Allocate image * Image cImage = Image::CreateImage(DataByte, ColorRGB, Vector3i(64, 32, 1)); * ImageBuffer *pImageBuffer = cImage.GetBuffer(); * * // Fill image * uint8 *pData = pImageBuffer->GetData(); * for (int i=0; i<pImageBuffer->GetSize().x*pImageBuffer->GetSize().y; i++, pData++) * *pData = static_cast<uint8>(Math::GetRand() % 255); *
PLGRAPHICS_API PLGraphics::Image::Image | ( | ) |
Constructor.
PLGRAPHICS_API PLGraphics::Image::Image | ( | const Image & | cSource | ) |
Copy constructor.
[in] | cSource | Source to copy from |
virtual PLGRAPHICS_API PLGraphics::Image::~Image | ( | ) | [virtual] |
Destructor.
static PLGRAPHICS_API Image PLGraphics::Image::CreateImage | ( | EDataFormat | nDataFormat, |
EColorFormat | nColorFormat, | ||
const PLMath::Vector3i & | vSize, | ||
ECompression | nCompression = CompressionNone |
||
) | [static] |
Create image.
[in] | nDataFormat | Desired data format |
[in] | nColorFormat | Desired color format |
[in] | vSize | Image size |
[in] | nCompression | Compression type |
* Image cImage; * ImageBuffer *pImageBuffer = cImage.CreatePart()->CreateMipmap(); * pImageBuffer->CreateImage(nDataFormat, nColorFormat, vSize, nCompression); *
static PLGRAPHICS_API Image PLGraphics::Image::CreateImageAndCopyData | ( | EDataFormat | nDataFormat, |
EColorFormat | nColorFormat, | ||
const PLMath::Vector3i & | vSize, | ||
ECompression | nCompression = CompressionNone , |
||
const PLCore::uint8 * | pnData = nullptr |
||
) | [static] |
Create image and copy given uncompressed image data.
[in] | nDataFormat | Desired data format |
[in] | nColorFormat | Desired color format |
[in] | vSize | Image size |
[in] | nCompression | Compression type |
[in] | pnData | If not a null pointer, data to copy into the created image, must have enough bytes to fill the whole image! |
* Image::CreateImageAndCopyData(DataByte, ColorRGB, Vector3i(64, 32, 1), CompressionNone, pnMyImageData).Save("MyImage.tga"); *
This is only an ease of use method doing nothing more than:
* Image cImage; * ImageBuffer *pImageBuffer = cImage.CreatePart()->CreateMipmap(); * pImageBuffer->CreateImage(nDataFormat, nColorFormat, vSize, nCompression); * pImageBuffer->CopyData(pnData); *
static PLGRAPHICS_API Image PLGraphics::Image::CreateImageAndTakeoverData | ( | EDataFormat | nDataFormat, |
EColorFormat | nColorFormat, | ||
const PLMath::Vector3i & | vSize, | ||
ECompression | nCompression = CompressionNone , |
||
PLCore::uint8 * | pnData = nullptr |
||
) | [static] |
Create image and takeover given uncompressed image data.
[in] | nDataFormat | Desired data format |
[in] | nColorFormat | Desired color format |
[in] | vSize | Image size |
[in] | nCompression | Compression type |
[in] | pnData | If not a null pointer, pointer to the image data to be taken over by the created image, must have enough bytes to fill the whole image! |
* Image::CreateImageAndTakeoverData(DataByte, ColorRGB, Vector3i(64, 32, 1), CompressionNone, pnMyImageData).Save("MyImage.tga"); *
This is only an ease of use method doing nothing more than:
* Image cImage; * ImageBuffer *pImageBuffer = cImage.CreatePart()->CreateMipmap(); * pImageBuffer->CreateImage(nDataFormat, nColorFormat, vSize, nCompression); * pImageBuffer->TakeoverData(pnData); *
static PLGRAPHICS_API Image PLGraphics::Image::CreateImageAndShareData | ( | EDataFormat | nDataFormat, |
EColorFormat | nColorFormat, | ||
const PLMath::Vector3i & | vSize, | ||
ECompression | nCompression = CompressionNone , |
||
PLCore::uint8 * | pnData = nullptr |
||
) | [static] |
Create image and share given uncompressed image data.
[in] | nDataFormat | Desired data format |
[in] | nColorFormat | Desired color format |
[in] | vSize | Image size |
[in] | nCompression | Compression type |
[in] | pnData | If not a null pointer, pointer to the image data to be shared by the created image, must have enough bytes to fill the whole image! |
* Image::CreateImageAndShareData(DataByte, ColorRGB, Vector3i(64, 32, 1), CompressionNone, pnMyImageData).Save("MyImage.tga"); *
This is only an ease of use method doing nothing more than:
* Image cImage; * ImageBuffer *pImageBuffer = cImage.CreatePart()->CreateMipmap(); * pImageBuffer->CreateImage(nDataFormat, nColorFormat, vSize, nCompression); * pImageBuffer->ShareData(pnData); *
Assignment operator.
[in] | cSource | Source to copy from |
PLGRAPHICS_API void PLGraphics::Image::ApplyEffect | ( | const ImageEffect & | cEffect | ) |
Apply image effect.
[in] | cEffect | Image effect |
PLGRAPHICS_API ECheckConsistency PLGraphics::Image::CheckConsistency | ( | ) | const |
Check image for possible problems.
bool PLGraphics::Image::IsMultiPart | ( | ) | const [inline] |
Check if this image is a multi-part image (e.g. a CubeMap)
PLCore::uint32 PLGraphics::Image::GetNumOfParts | ( | ) | const [inline] |
Get number of image parts.
ImagePart * PLGraphics::Image::GetPart | ( | PLCore::uint32 | nIndex | ) | const [inline] |
Get image part.
[in] | nIndex | Index of image part |
ImagePart * PLGraphics::Image::GetPartBySemantics | ( | PLCore::uint32 | nSemantics | ) | const [inline] |
Get image part by semantics.
[in] | nSemantics | ID of image part |
const PLCore::Container< ImagePart * > & PLGraphics::Image::GetParts | ( | ) | const [inline] |
Get image parts.
PLGRAPHICS_API ImagePart* PLGraphics::Image::CreatePart | ( | PLCore::uint32 | nSemantics = ImagePartStatic | ) |
Create a new image part.
[in] | nSemantics | ID of image part |
PLGRAPHICS_API bool PLGraphics::Image::DeletePart | ( | ImagePart & | cPart | ) |
Delete image part.
[in] | cPart | Image part |
PLGRAPHICS_API ImageBuffer* PLGraphics::Image::GetBuffer | ( | PLCore::uint32 | nPart = 0 , |
PLCore::uint32 | nMipmap = 0 |
||
) | const |
Get image buffer.
[in] | nPart | Index of image part |
[in] | nMipmap | Index of mipmap |
PLGRAPHICS_API void PLGraphics::Image::CreateTestImage | ( | ETestImage | nTestImage = TestImage2DSimple | ) |
Create a test image.
[in] | nTestImage | ID of test image |
virtual PLGRAPHICS_API bool PLGraphics::Image::Unload | ( | ) | [override, virtual] |
Unloads the loadable.
Reimplemented from PLCore::Loadable.
virtual PLGRAPHICS_API PLCore::String PLGraphics::Image::GetLoadableTypeName | ( | ) | const [override, virtual] |
|