GATE
|
Generic image file format loading and saving utilities. More...
#include "gate/graphics/gate_graphics_api.h"
#include "gate/gatetypes.h"
#include "gate/graphics/images.h"
Macros | |
#define | GATE_IMAGEFORMAT_UNKNOWN 0 |
#define | GATE_IMAGEFORMAT_BITMAP 1 |
#define | GATE_IMAGEFORMAT_PIXMAP 2 |
#define | GATE_IMAGEFORMAT_JPEG 3 |
#define | GATE_IMAGEFORMAT_PNG 4 |
#define | GATE_IMAGEFORMAT_GIF 5 |
Functions | |
GATE_GRAPHICS_API gate_enumint_t | gate_imageformat_parse_file_extension (gate_string_t const *file_ext) |
Checks the filename extension and returns a matching file format identifier. | |
GATE_GRAPHICS_API char const * | gate_imageformat_get_file_extension (gate_enumint_t image_format) |
Returns the default file extension of the given image file format. | |
GATE_GRAPHICS_API gate_result_t | gate_imageformat_load (gate_enumint_t image_format, gate_stream_t *srcstream, gate_rasterimage_t *image, gate_enumint_t flags) |
Loads the specific image format from a byte stream and creates a rasterimage. | |
GATE_GRAPHICS_API gate_result_t | gate_imageformat_save (gate_enumint_t image_format, gate_rasterimage_t const *image, gate_stream_t *deststream, gate_enumint_t flags) |
Saves a rasterimage in the specified format into an output stream. | |
GATE_GRAPHICS_API gate_result_t | gate_imageformat_load_file (gate_string_t const *file_path, gate_rasterimage_t *image, gate_enumint_t flags) |
Loads an image file and initializes a rasterimage. | |
GATE_GRAPHICS_API gate_result_t | gate_imageformat_save_file (gate_string_t const *file_path, gate_rasterimage_t const *image, gate_enumint_t flags) |
Save a rasterimage to a file. | |
Generic image file format loading and saving utilities.
#define GATE_IMAGEFORMAT_UNKNOWN 0 |
Unknown image file format
#define GATE_IMAGEFORMAT_BITMAP 1 |
Windows Bitmap BMP image file format
#define GATE_IMAGEFORMAT_PIXMAP 2 |
X11 Pixmap XPM image file format
#define GATE_IMAGEFORMAT_JPEG 3 |
JPEG JPG image file format
#define GATE_IMAGEFORMAT_PNG 4 |
PNG image file format
#define GATE_IMAGEFORMAT_GIF 5 |
GIF image file format
GATE_GRAPHICS_API gate_enumint_t gate_imageformat_parse_file_extension | ( | gate_string_t const * | file_ext | ) |
Checks the filename extension and returns a matching file format identifier.
[in] | file_ext | string with path, filename or '.EXT' extension-token of image file |
GATE_GRAPHICS_API char const * gate_imageformat_get_file_extension | ( | gate_enumint_t | image_format | ) |
Returns the default file extension of the given image file format.
[in] | image_format | GATE_IMAGEFORMAT_* file format identifier |
GATE_GRAPHICS_API gate_result_t gate_imageformat_load | ( | gate_enumint_t | image_format, |
gate_stream_t * | srcstream, | ||
gate_rasterimage_t * | image, | ||
gate_enumint_t | flags ) |
Loads the specific image format from a byte stream and creates a rasterimage.
[in] | image_format | GATE_IMAGEFORMAT_* image format identifier |
[in] | srcstream | input stream containing image date |
[out] | image | pointer to rasterimage to be initialized |
[in] | flags | image-format specific loader-flags (0: default-loader) |
GATE_GRAPHICS_API gate_result_t gate_imageformat_save | ( | gate_enumint_t | image_format, |
gate_rasterimage_t const * | image, | ||
gate_stream_t * | deststream, | ||
gate_enumint_t | flags ) |
Saves a rasterimage in the specified format into an output stream.
[in] | image_format | GATE_IMAGEFORMAT_* image format identifier |
[in] | image | pointer to rasterimage to be saved |
[out] | deststream | output stream that receives formated image data |
[in] | flags | image-format specific writer-flags (0: default-writer) |
GATE_GRAPHICS_API gate_result_t gate_imageformat_load_file | ( | gate_string_t const * | file_path, |
gate_rasterimage_t * | image, | ||
gate_enumint_t | flags ) |
Loads an image file and initializes a rasterimage.
[in] | file_path | string with input image file path |
[out] | image | pointer to rasterimage to be loaded |
[in] | flags | image-format specific loader-flags (0: default-loader) |
GATE_GRAPHICS_API gate_result_t gate_imageformat_save_file | ( | gate_string_t const * | file_path, |
gate_rasterimage_t const * | image, | ||
gate_enumint_t | flags ) |
Save a rasterimage to a file.
[in] | file_path | string with output image file path |
[in] | image | pointer to rasterimage thats data is saved |
[in] | flags | image-format specific writer-flags (0: default-writer) |