|
PNTK
|
#include <gui_image.h>
Public Member Functions | |
| gui_image () | |
| gui_image (int width, int height, gui_image_format format, bool initialize_native=0) | |
| gui_image (gui_stream *stream, bool initialize_native=0) | |
| gui_size | get_size () |
| int | get_bit_depth () |
| bool | has_alpha () |
| bool | has_native_image () |
| bool | has_native_surface () |
| void | clear () |
| gui_image_format | get_format () |
| unsigned char * | get_bits () |
| void * | get_native_image () |
| void * | get_native_surface () |
| void | create_native_image () |
| void | create_native_surface () |
| void | release_native_image () |
| void | release_native_surface () |
| void | load_bmp (gui_stream *stream) |
| void | save_bmp (gui_stream *stream) |
| void | load_xpm (gui_stream *stream) |
| void | save_xpm (gui_stream *stream) |
| void | convert (gui_image_format format) |
Static Public Member Functions | |
| static void | get_channel_info (gui_image_format format, int &bit_depth, int &channel_a, int &channel_r, int &channel_g, int &channel_b) |
An abstract image class that loads/saves image files and can convert them to a format usable by the native toolkit implementations.
| pntk::gui_image::gui_image | ( | ) |
Creates an empty image object
| pntk::gui_image::gui_image | ( | int | width, |
| int | height, | ||
| gui_image_format | format, | ||
| bool | initialize_native = 0 |
||
| ) |
Creates an image object with a the given width and height. This constructor will optionally initialize the underlaying platform image resource.
| pntk::gui_image::gui_image | ( | gui_stream * | stream, |
| bool | initialize_native = 0 |
||
| ) |
Creates an image object from the filed stored in stream. This constructor will optionally initialize the underlaying platform image resource.
| void pntk::gui_image::clear | ( | ) |
Clears the entire image, filling it with White (0xFFFFFFFF).
| void pntk::gui_image::convert | ( | gui_image_format | format | ) |
Converts the current image into another format.
| void pntk::gui_image::create_native_image | ( | ) |
Creates the native underlaying image resource from the loaded data..
| void pntk::gui_image::create_native_surface | ( | ) |
Creates the native underlaying image surface (for drawing to a canvas) from the loaded data.
| int pntk::gui_image::get_bit_depth | ( | ) |
Returns the bit depth of the image
| unsigned char* pntk::gui_image::get_bits | ( | ) |
Returns a pointer to the raw bits of the image once loaded.
|
static |
Returns channel information about an image format.
| gui_image_format pntk::gui_image::get_format | ( | ) |
Returns internal format.
| void* pntk::gui_image::get_native_image | ( | ) |
Returns a pointer to the underlaying platform image resource. Calls create_native_image if the resource has not been created yet.
| void* pntk::gui_image::get_native_surface | ( | ) |
Returns a pointer to the underlaying platform off screen surface. Calls create_native_surface if the surface has not been created yet.
| gui_size pntk::gui_image::get_size | ( | ) |
Returns the size of the image.
| bool pntk::gui_image::has_alpha | ( | ) |
Returns a boolean that indicates whether or not the image contains an alpha channel
| bool pntk::gui_image::has_native_image | ( | ) |
Returns a boolean that indicates whether or not the underlaying platform resource has been created.
| bool pntk::gui_image::has_native_surface | ( | ) |
Returns a boolean that indicates whether or not the underlaying platform surface has been created.
| void pntk::gui_image::load_bmp | ( | gui_stream * | stream | ) |
Loads a bmp image from the given filename.
| void pntk::gui_image::load_xpm | ( | gui_stream * | stream | ) |
Loads an xpm image from the given filename.
| void pntk::gui_image::release_native_image | ( | ) |
Destroys the native image resource associated with the data, if it was created previously.
| void pntk::gui_image::release_native_surface | ( | ) |
Destroys the native image surface associated with the data, if it was created previously.
| void pntk::gui_image::save_bmp | ( | gui_stream * | stream | ) |
Saves the current image as a bmp to the given filename.
| void pntk::gui_image::save_xpm | ( | gui_stream * | stream | ) |
Saves the current image as an xpm to the given filename.
1.8.15