#include <pngimage.h>
|
static bool | isValid (const char *filename) |
|
static void | save (const char *file, Texture *pTexture, TextureType target=QUAD_MAP) |
|
static void | writeImageToFile (Byte *pData, uint width, uint height, Image::Format format, const char *filename) |
|
static void | read (png_struct *pHeader, png_byte *pData, png_size_t length) |
|
static void | write (png_struct *pHeader, png_byte *pData, png_size_t length) |
|
static void | warning (png_struct *pHeader, png_const_charp error) |
|
static void | error (png_struct *pHeader, png_const_charp error) |
|
static Image * | createImage (const char *filename) |
|
static bool | isValid (const char *filename, const ByteArray &magic) |
|
static size_t | byteSize (PixelFormat pixelFormat) |
|
static Format | convert (PixelFormat pixelFormat) |
|
static bool | hasAlpha (PixelFormat pixelFormat) |
|
static PixelFormat | removeAlpha (PixelFormat pixelFormat) |
|
|
static const ByteArray | magic |
|
|
enum | Format {
RGB_565
,
RGB_888
,
BGR_888
,
RGBA_8888
,
BGRA_8888
,
RGBA_5551
,
RGBA_4444
,
BGRA_4444
,
ALPHA_8
,
GRAY_8
,
GRAY_16
,
GRAY_ALPHA_8_8
,
GRAY_ALPHA_15_1
,
DEPTH_8
,
DEPTH_16
,
DEPTH_24
} |
|
size_t | dataSize |
|
uint | width |
|
uint | height |
|
uint | channels |
|
Format | format |
|
Byte * | pData |
|
◆ PngImage()
PngImage::PngImage |
( |
const char * | filename | ) |
|
◆ ~PngImage()
virtual PngImage::~PngImage |
( |
| ) |
|
|
virtual |
◆ allocAndCreatePixels()
virtual Byte * PngImage::allocAndCreatePixels |
( |
| ) |
|
|
virtual |
Creates a new array of pixels on the heap. Caller must delete as this data is not managed.
- Returns
- Byte array.
Implements Image.
◆ error()
static void PngImage::error |
( |
png_struct * | pHeader, |
|
|
png_const_charp | error ) |
|
static |
◆ isValid()
static bool PngImage::isValid |
( |
const char * | filename | ) |
|
|
static |
◆ read()
static void PngImage::read |
( |
png_struct * | pHeader, |
|
|
png_byte * | pData, |
|
|
png_size_t | length ) |
|
static |
◆ save() [1/2]
virtual void PngImage::save |
( |
const char * | file | ) |
|
|
virtual |
Saves a texture to the filesystem.
- Parameters
-
Pointer | to texture. |
The | texture's target-data to save. If not specified the QUAD target will be selected. |
Implements Image.
◆ save() [2/2]
◆ warning()
static void PngImage::warning |
( |
png_struct * | pHeader, |
|
|
png_const_charp | error ) |
|
static |
◆ write()
static void PngImage::write |
( |
png_struct * | pHeader, |
|
|
png_byte * | pData, |
|
|
png_size_t | length ) |
|
static |
◆ writeImageToFile()
static void PngImage::writeImageToFile |
( |
Byte * | pData, |
|
|
uint | width, |
|
|
uint | height, |
|
|
Image::Format | format, |
|
|
const char * | filename ) |
|
static |
◆ magic
const ByteArray PngImage::magic |
|
static |
The documentation for this class was generated from the following file: