corona
1.0.2
|
Namespaces | |
namespace | hidden |
PRIVATE API - for internal use only. | |
Classes | |
struct | FormatDesc |
class | DLLInterface |
class | DLLImplementation |
class | Image |
class | File |
class | FileFormatDesc |
Describes a file format that Corona supports. More... | |
class | CFile |
class | MemoryFile |
struct | Header |
struct | InternalStruct |
struct | iwrite_mgr |
class | SimpleImage |
class | auto_array |
struct | RGB |
struct | RGBA |
struct | BGR |
struct | BGRA |
Typedefs | |
typedef unsigned char | byte |
typedef unsigned short | u16 |
typedef unsigned long | u32 |
Enumerations | |
enum | FileFormat { FF_AUTODETECT = 0x0100, FF_PNG = 0x0101, FF_JPEG = 0x0102, FF_PCX = 0x0103, FF_BMP = 0x0104, FF_TGA = 0x0105, FF_GIF = 0x0106 } |
enum | PixelFormat { PF_DONTCARE = 0x0200, PF_R8G8B8A8 = 0x0201, PF_R8G8B8 = 0x0202, PF_I8 = 0x0203, PF_B8G8R8A8 = 0x0204, PF_B8G8R8 = 0x0205 } |
enum | CoordinateAxis { CA_X = 0x0001, CA_Y = 0x0002 } |
Functions | |
Image * | ExpandPalette (Image *image) |
FormatDesc * | GetDescription (PixelFormat format) |
bool | ConvertPixels (byte *out, PixelFormat out_format, const byte *in, PixelFormat in_format, int pixel_count) |
Image * | DirectConversion (Image *image, PixelFormat target_format) |
const char * | GetVersion () |
FileFormatDesc ** | GetSupportedReadFormats () |
FileFormatDesc ** | GetSupportedWriteFormats () |
Image * | CreateImage (int width, int height, PixelFormat format, void *pixels=0) |
Image * | CreateImage (int width, int height, PixelFormat format, int palette_size, PixelFormat palette_format) |
Image * | CloneImage (Image *source, PixelFormat format=PF_DONTCARE) |
Image * | OpenImage (const char *filename, PixelFormat pixel_format=PF_DONTCARE, FileFormat file_format=FF_AUTODETECT) |
Image * | OpenImage (const std::string &filename, PixelFormat pixel_format=PF_DONTCARE, FileFormat file_format=FF_AUTODETECT) |
For convenience. Accepts a std::string. | |
Image * | OpenImage (File *file, PixelFormat pixel_format=PF_DONTCARE, FileFormat file_format=FF_AUTODETECT) |
Image * | OpenImage (const char *filename, FileFormat file_format, PixelFormat pixel_format=PF_DONTCARE) |
For compatibility. This function may be deprecated. | |
Image * | OpenImage (File *file, FileFormat file_format, PixelFormat pixel_format=PF_DONTCARE) |
For compatibility. This function may be deprecated. | |
bool | SaveImage (const char *filename, FileFormat file_format, Image *image) |
bool | SaveImage (const std::string &filename, FileFormat file_format, Image *image) |
For convenience. Accepts a std::string. | |
bool | SaveImage (File *file, FileFormat file_format, Image *image) |
Image * | ConvertImage (Image *source, PixelFormat format) |
Image * | ConvertPalette (Image *source, PixelFormat palette_format) |
Image * | FlipImage (Image *source, int coordinate_axis) |
File * | OpenFile (const char *filename, bool writeable) |
File * | CreateMemoryFile (const void *buffer, int size) |
int | GetPixelSize (PixelFormat format) |
bool | IsDirect (PixelFormat format) |
bool | IsPalettized (PixelFormat format) |
int | GetPaletteSize (PixelFormat format) |
int | getNextPowerOfTwo (int value) |
Image * | OpenBMP (File *file) |
Image * | OpenJPEG (File *file) |
Image * | OpenPCX (File *file) |
Image * | OpenPNG (File *file) |
Image * | OpenTGA (File *file) |
Image * | OpenGIF (File *file) |
bool | ReadHeader (File *file, Header &h) |
bool | ReadInfoHeader (File *file, Header &h) |
bool | ReadPalette (File *file, Header &h) |
Image * | DecodeBitmap (File *file, const Header &h) |
int | count_right_zeroes (u32 n) |
int | count_ones (u32 n) |
bool | advance (int &x, int &y, const Header &h) |
Image * | ReadBitmap1 (const byte *raster_data, const Header &h) |
Image * | ReadBitmap4 (const byte *raster_data, const Header &h) |
Image * | ReadBitmapRLE4 (const byte *raster_data, const Header &h) |
Image * | ReadBitmap8 (const byte *raster_data, const Header &h) |
Image * | ReadBitmapRLE8 (const byte *raster_data, const Header &h) |
Image * | ReadBitmap16 (const byte *raster_data, const Header &h) |
Image * | ReadBitmap24 (const byte *raster_data, const Header &h) |
Image * | ReadBitmap32 (const byte *raster_data, const Header &h) |
int | InputFunc (GifFileType *gif, GifByteType *bytes, int size) |
void | JPEG_init_source (j_decompress_ptr cinfo) |
boolean | JPEG_fill_input_buffer (j_decompress_ptr cinfo) |
void | JPEG_skip_input_data (j_decompress_ptr cinfo, long num_bytes) |
void | JPEG_term_source (j_decompress_ptr cinfo) |
void | JPEG_error_exit (j_common_ptr cinfo) |
void | JPEG_emit_message (j_common_ptr cinfo, int msg_level) |
bool | ReadScanline (File *file, int scansize, byte *scanline) |
void | PNG_read_function (png_structp png_ptr, png_bytep data, png_size_t length) |
void | PNG_warning_function (png_structp png_ptr, png_const_charp error) |
void | PNG_error_function (png_structp png_ptr, png_const_charp warning) |
void | fill_palette (png_structp png, png_infop info, png_color palette[256]) |
bool | SaveJPEG (File *file, Image *image) |
bool | SavePNG (File *file, Image *image) |
bool | SaveTGA (File *file, Image *image) |
void | JPEG_init_destination (j_compress_ptr cinfo) |
boolean | JPEG_empty_output_buffer (j_compress_ptr cinfo) |
void | JPEG_term_destination (j_compress_ptr cinfo) |
void | PNG_write (png_structp png_ptr, png_bytep data, png_size_t length) |
void | PNG_flush (png_structp png_ptr) |
u16 | read16_le (const byte *b) |
void | write16_le (byte *b, u16 value) |
u16 | read16_be (const byte *b) |
void | write16_be (byte *b, u16 value) |
u32 | read32_le (const byte *b) |
u32 | read32_be (const byte *b) |
typedef unsigned char corona::byte |
Definition at line 17 of file OpenPNG.cpp.
typedef unsigned short corona::u16 |
typedef unsigned long corona::u32 |
enum corona::FileFormat |
enum corona::PixelFormat |
Pixel format specifications. Pixel data can be packed in one of the following ways.
PF_DONTCARE |
special format used when specifying a desired pixel format |
PF_R8G8B8A8 |
RGBA, channels have eight bits of precision |
PF_R8G8B8 |
RGB, channels have eight bits of precision |
PF_I8 |
Palettized, 8-bit indices into palette |
PF_B8G8R8A8 |
BGRA, channels have eight bits of precision |
PF_B8G8R8 |
BGR, channels have eight bits of precision |
Image* corona::ExpandPalette | ( | Image * | image | ) |
Definition at line 17 of file Convert.cpp.
FormatDesc* corona::GetDescription | ( | PixelFormat | format | ) |
Definition at line 67 of file Convert.cpp.
bool corona::ConvertPixels | ( | byte * | out, |
PixelFormat | out_format, | ||
const byte * | in, | ||
PixelFormat | in_format, | ||
int | pixel_count | ||
) |
Definition at line 80 of file Convert.cpp.
Image* corona::DirectConversion | ( | Image * | image, |
PixelFormat | target_format | ||
) |
Definition at line 114 of file Convert.cpp.
const char* corona::GetVersion | ( | ) | [inline] |
FileFormatDesc** corona::GetSupportedReadFormats | ( | ) | [inline] |
FileFormatDesc** corona::GetSupportedWriteFormats | ( | ) | [inline] |
Image* corona::CreateImage | ( | int | width, |
int | height, | ||
PixelFormat | format, | ||
void * | pixels = 0 |
||
) | [inline] |
Create a new, blank image with a specified width, height, and format. If pixels is specified, Corona uses them to initialize the contents of the image. Corona does *not* take ownership of the pixel memory, so the caller is responsible for cleaning up after itself. If pixels is not specified, the new image is filled with zeroes.
width | width of the new image |
height | height of the new image |
format | format the pixels are stored in, cannot be PF_DONTCARE |
pixels | pixel buffer used to initialize the new image |
Image* corona::CreateImage | ( | int | width, |
int | height, | ||
PixelFormat | format, | ||
int | palette_size, | ||
PixelFormat | palette_format | ||
) | [inline] |
Create a new, blank image with a specified width, height, format, and palette.
width | width of image |
height | height of image |
format | format of palette indices, should be PF_I8 |
palette_size | number of colors in palette |
palette_format | pixel format of palette entries |
Image* corona::CloneImage | ( | Image * | source, |
PixelFormat | format = PF_DONTCARE |
||
) | [inline] |
Create a new image from an old one. If format is specified, the new image is converted to that pixel format. If format is not specified, the new image simply uses the same format as the source. If the image could not be cloned or the pixel format is invalid, CloneImage returns 0.
source | image to clone |
format | format the new image is stored in, defaults to PF_DONTCARE |
Image* corona::OpenImage | ( | const char * | filename, |
PixelFormat | pixel_format = PF_DONTCARE , |
||
FileFormat | file_format = FF_AUTODETECT |
||
) | [inline] |
Opens an image from the default filesystem. This function simply forwards the call to OpenImage(file, file_format, pixel_format) with a standard C library file.
See OpenImage(fs, filename, file_format, pixel_format) for more information.
filename | image filename to open |
file_format | file format the image is stored in, or FF_AUTODETECT to try all loaders |
pixel_format | desired pixel format, or PF_DONTCARE to use image's native format |
Image* corona::OpenImage | ( | const std::string & | filename, |
PixelFormat | pixel_format = PF_DONTCARE , |
||
FileFormat | file_format = FF_AUTODETECT |
||
) | [inline] |
Image* corona::OpenImage | ( | File * | file, |
PixelFormat | pixel_format = PF_DONTCARE , |
||
FileFormat | file_format = FF_AUTODETECT |
||
) | [inline] |
Opens an image from the specified file.
If file_format is FF_AUTODETECT, the loader tries to load each format until it finds one that succeeds. Otherwise, it tries the specific loader specified.
If pixel_format is PF_DONTCARE, the new image object has the pixel format closest to the image's format on disk. Otherwise, the pixels are converted to the specified format before the image is returned.
file | name of the file that contains the image |
file_format | file format the image is stored in, or FF_AUTODETECT to try all loaders |
pixel_format | desired pixel format, or PF_DONTCARE to use image's native format |
Image* corona::OpenImage | ( | const char * | filename, |
FileFormat | file_format, | ||
PixelFormat | pixel_format = PF_DONTCARE |
||
) | [inline] |
Image* corona::OpenImage | ( | File * | file, |
FileFormat | file_format, | ||
PixelFormat | pixel_format = PF_DONTCARE |
||
) | [inline] |
bool corona::SaveImage | ( | const char * | filename, |
FileFormat | file_format, | ||
Image * | image | ||
) | [inline] |
Saves an image to a file in the default filesystem. This function simply calls SaveImage(file, file_format, image) with a standard C library file.
See SaveImage(fs, filename, file_format, image) for more information.
filename | name of the file to save the image to |
file_format | file format in which to save image. if FF_AUTODETECT, SaveImage guesses the type from the file extension |
image | image to save |
bool corona::SaveImage | ( | const std::string & | filename, |
FileFormat | file_format, | ||
Image * | image | ||
) | [inline] |
bool corona::SaveImage | ( | File * | file, |
FileFormat | file_format, | ||
Image * | image | ||
) | [inline] |
Saves an image to the specified file. This function saves image to a file of type file_format. If file_format is not a supported output type, the function fails. As of now, Corona only supports saving images of type FF_PNG and FF_TGA.
file | file in which to save the image |
file_format | file format in which to save image -- must not be FF_AUTODETECT |
image | image to save |
Image* corona::ConvertImage | ( | Image * | source, |
PixelFormat | format | ||
) | [inline] |
Converts an image from one format to another, destroying the old image. If source is 0, the function returns 0. If format is PF_DONTCARE or the source and target formats match, returns the unmodified source image. If a valid conversion is not found, ConvertImage destroys the old image and returns 0. For example, ConvertImage does not support creating a palettized image from a direct color image yet.
source | image to convert |
format | desired format -- can be PF_DONTCARE |
Image* corona::ConvertPalette | ( | Image * | source, |
PixelFormat | palette_format | ||
) | [inline] |
Converts the palette of a palettized image from one format to another, destroying the old image. If the source is 0, the palette_format is PF_DONTCARE, or the source and target formats match, the function returns the unmodified source image. If a valid conversion is not found or invalid inputs are given (such as a direct-color source image), this function destroys the old image and returns 0.
source | palettized image to convert |
palette_format | desired pixel format of palette |
Image* corona::FlipImage | ( | Image * | source, |
int | coordinate_axis | ||
) | [inline] |
File* corona::OpenFile | ( | const char * | filename, |
bool | writeable | ||
) | [inline] |
File* corona::CreateMemoryFile | ( | const void * | buffer, |
int | size | ||
) | [inline] |
Creates a File implementation that reads from a buffer in memory. It stores a copy of the buffer that is passed in.
The File object does not take ownership of the memory buffer. When the file is destroyed, it will not free the memory.
buffer | Pointer to the beginning of the data. |
size | Size of the buffer in bytes. |
int corona::GetPixelSize | ( | PixelFormat | format | ) | [inline] |
bool corona::IsDirect | ( | PixelFormat | format | ) | [inline] |
bool corona::IsPalettized | ( | PixelFormat | format | ) | [inline] |
int corona::GetPaletteSize | ( | PixelFormat | format | ) | [inline] |
int corona::getNextPowerOfTwo | ( | int | value | ) |
Definition at line 23 of file MemoryFile.cpp.
Image * corona::OpenBMP | ( | File * | file | ) |
Definition at line 47 of file OpenBMP.cpp.
Image * corona::OpenJPEG | ( | File * | file | ) |
Definition at line 36 of file OpenJPEG.cpp.
Image * corona::OpenPCX | ( | File * | file | ) |
Definition at line 69 of file OpenPCX.cpp.
Image * corona::OpenPNG | ( | File * | file | ) |
Definition at line 94 of file OpenPNG.cpp.
Image * corona::OpenTGA | ( | File * | file | ) |
Definition at line 11 of file OpenTGA.cpp.
Image * corona::OpenGIF | ( | File * | file | ) |
Definition at line 19 of file OpenGIF.cpp.
bool corona::ReadHeader | ( | File * | file, |
Header & | h | ||
) |
Definition at line 63 of file OpenBMP.cpp.
bool corona::ReadInfoHeader | ( | File * | file, |
Header & | h | ||
) |
Definition at line 80 of file OpenBMP.cpp.
bool corona::ReadPalette | ( | File * | file, |
Header & | h | ||
) |
Definition at line 177 of file OpenBMP.cpp.
Image * corona::DecodeBitmap | ( | File * | file, |
const Header & | h | ||
) |
Definition at line 640 of file OpenBMP.cpp.
int corona::count_right_zeroes | ( | u32 | n | ) |
Definition at line 153 of file OpenBMP.cpp.
int corona::count_ones | ( | u32 | n | ) |
Definition at line 165 of file OpenBMP.cpp.
bool corona::advance | ( | int & | x, |
int & | y, | ||
const Header & | h | ||
) |
Definition at line 269 of file OpenBMP.cpp.
Image* corona::ReadBitmap1 | ( | const byte * | raster_data, |
const Header & | h | ||
) |
Definition at line 279 of file OpenBMP.cpp.
Image* corona::ReadBitmap4 | ( | const byte * | raster_data, |
const Header & | h | ||
) |
Definition at line 306 of file OpenBMP.cpp.
Image* corona::ReadBitmapRLE4 | ( | const byte * | raster_data, |
const Header & | h | ||
) |
Definition at line 333 of file OpenBMP.cpp.
Image* corona::ReadBitmap8 | ( | const byte * | raster_data, |
const Header & | h | ||
) |
Definition at line 453 of file OpenBMP.cpp.
Image* corona::ReadBitmapRLE8 | ( | const byte * | raster_data, |
const Header & | h | ||
) |
Definition at line 473 of file OpenBMP.cpp.
Image* corona::ReadBitmap16 | ( | const byte * | raster_data, |
const Header & | h | ||
) |
Definition at line 574 of file OpenBMP.cpp.
Image* corona::ReadBitmap24 | ( | const byte * | raster_data, |
const Header & | h | ||
) |
Definition at line 600 of file OpenBMP.cpp.
Image* corona::ReadBitmap32 | ( | const byte * | raster_data, |
const Header & | h | ||
) |
Definition at line 619 of file OpenBMP.cpp.
int corona::InputFunc | ( | GifFileType * | gif, |
GifByteType * | bytes, | ||
int | size | ||
) |
Definition at line 14 of file OpenGIF.cpp.
void corona::JPEG_init_source | ( | j_decompress_ptr | cinfo | ) |
Definition at line 132 of file OpenJPEG.cpp.
boolean corona::JPEG_fill_input_buffer | ( | j_decompress_ptr | cinfo | ) |
Definition at line 138 of file OpenJPEG.cpp.
void corona::JPEG_skip_input_data | ( | j_decompress_ptr | cinfo, |
long | num_bytes | ||
) |
Definition at line 158 of file OpenJPEG.cpp.
void corona::JPEG_term_source | ( | j_decompress_ptr | cinfo | ) |
Definition at line 172 of file OpenJPEG.cpp.
void corona::JPEG_error_exit | ( | j_common_ptr | cinfo | ) |
Definition at line 178 of file OpenJPEG.cpp.
void corona::JPEG_emit_message | ( | j_common_ptr | cinfo, |
int | msg_level | ||
) |
Definition at line 185 of file OpenJPEG.cpp.
bool corona::ReadScanline | ( | File * | file, |
int | scansize, | ||
byte * | scanline | ||
) |
Definition at line 37 of file OpenPCX.cpp.
void corona::PNG_read_function | ( | png_structp | png_ptr, |
png_bytep | data, | ||
png_size_t | length | ||
) |
Definition at line 22 of file OpenPNG.cpp.
void corona::PNG_warning_function | ( | png_structp | png_ptr, |
png_const_charp | error | ||
) |
Definition at line 33 of file OpenPNG.cpp.
void corona::PNG_error_function | ( | png_structp | png_ptr, |
png_const_charp | warning | ||
) |
Definition at line 39 of file OpenPNG.cpp.
void corona::fill_palette | ( | png_structp | png, |
png_infop | info, | ||
png_color | palette[256] | ||
) |
Definition at line 51 of file OpenPNG.cpp.
bool corona::SaveJPEG | ( | File * | file, |
Image * | image | ||
) |
Definition at line 38 of file SaveJPEG.cpp.
bool corona::SavePNG | ( | File * | file, |
Image * | image | ||
) |
Definition at line 20 of file SavePNG.cpp.
bool corona::SaveTGA | ( | File * | file, |
Image * | image | ||
) |
Definition at line 15 of file SaveTGA.cpp.
void corona::JPEG_init_destination | ( | j_compress_ptr | cinfo | ) |
Definition at line 109 of file SaveJPEG.cpp.
boolean corona::JPEG_empty_output_buffer | ( | j_compress_ptr | cinfo | ) |
Definition at line 121 of file SaveJPEG.cpp.
void corona::JPEG_term_destination | ( | j_compress_ptr | cinfo | ) |
Definition at line 134 of file SaveJPEG.cpp.
void corona::PNG_write | ( | png_structp | png_ptr, |
png_bytep | data, | ||
png_size_t | length | ||
) |
Definition at line 9 of file SavePNG.cpp.
void corona::PNG_flush | ( | png_structp | png_ptr | ) |
Definition at line 16 of file SavePNG.cpp.
u16 corona::read16_le | ( | const byte * | b | ) | [inline] |
void corona::write16_le | ( | byte * | b, |
u16 | value | ||
) | [inline] |
u16 corona::read16_be | ( | const byte * | b | ) | [inline] |
void corona::write16_be | ( | byte * | b, |
u16 | value | ||
) | [inline] |
u32 corona::read32_le | ( | const byte * | b | ) | [inline] |
u32 corona::read32_be | ( | const byte * | b | ) | [inline] |