zenilib
0.5.3.0
|
#include <Image.h>
Public Types | |
enum | Color_Space { Luminance, Luminance_Alpha, RGB, RGBA } |
Public Member Functions | |
Image () | |
Image (const String &filename, const bool &tileable_=false) | |
Image (const Point2i &size_, const Color_Space &color_space_, const bool &tileable_=false) | |
bool | blit (const Point2i &upper_left, const Image &source) |
Copy a different Image in the same color-space into this Image. Returns true if blits successfully, false otherwise. More... | |
Color_Space | color_space () const |
Determine the Color_Space of the raw image data. More... | |
Color | extract_Color (const Point2i &pixel) const |
Get the Color value of the pixel specified [0, 0] being the upper left, (width, height) being the lower right. More... | |
Color | extract_Color (const Point2f &coordinate) const |
Get the Color value of a given coordinate, [0.0f, 0.0f] to (1.0f, 1.0f), with wrapping if (tileable == true). More... | |
Uint32 | extract_RGBA (const Point2i &pixel) const |
Get the Color value of the pixel specified [0, 0] being the upper left, (width, height) being the lower right. More... | |
const Uint8 * | get_data () const |
Get access to the raw image data. More... | |
Uint8 * | get_data () |
Get access to the raw image data. More... | |
int | height () const |
Get the number of pixels in the image in the y-direction. More... | |
void | resize (const int &width, const int &height) |
void | set_Color (const Point2i &pixel, const Color &color) |
Set the Color value of the pixel specified [0, 0] being the upper left, (width, height) being the lower right. More... | |
void | set_RGBA (const Point2i &pixel, const Uint32 &rgba) |
Set the Color value of the pixel specified [0, 0] being the upper left, (width, height) being the lower right. More... | |
const Point2i & | size () const |
Get the dimensions of the image. More... | |
bool | tileable () const |
Determine if the given Image is tileable. More... | |
int | width () const |
Get the number of pixels in the image in the x-direction. More... | |
This class describes a image, loaded from a file.
Contact: bazal d@ze nipex .com
Definition at line 42 of file Image.cpp.
References file, Zeni::File_Ops::get_asset_FILE(), header(), int, j, Luminance, Luminance_Alpha, NULL, PNG_COLOR_TYPE_GRAY, PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_RGB, PNG_COLOR_TYPE_RGB_ALPHA, png_destroy_read_struct(), png_get_IHDR(), png_get_rowbytes(), png_init_io(), png_jmpbuf, PNG_LIBPNG_VER_STRING, png_read_image(), png_read_info(), png_read_update_info(), png_set_sig_bytes(), png_sig_cmp(), RGB, RGBA, u, Zeni::Point2i::x, Zeni::Point2i::y, and ZENI_LOGE().
Copy a different Image in the same color-space into this Image. Returns true if blits successfully, false otherwise.
Definition at line 352 of file Image.cpp.
References assert, max, memcpy, min, Zeni::Point2i::x, and Zeni::Point2i::y.
|
inline |
Determine the Color_Space of the raw image data.
Definition at line 25 of file Image.hxx.
Referenced by Zeni::Window::alert_window_resized().
Get the Color value of the pixel specified [0, 0] being the upper left, (width, height) being the lower right.
Definition at line 219 of file Image.cpp.
References assert, Luminance, Luminance_Alpha, RGB, and RGBA.
Referenced by extract_Color(), and resize().
Get the Color value of a given coordinate, [0.0f, 0.0f] to (1.0f, 1.0f), with wrapping if (tileable == true).
Definition at line 276 of file Image.cpp.
References extract_Color(), floor(), Zeni::Color::interpolate_to(), Zeni::Point2i::x, Zeni::Point2f::x, Zeni::Point2i::y, and Zeni::Point2f::y.
Get access to the raw image data.
Definition at line 29 of file Image.hxx.
Referenced by Zeni::Window::alert_window_resized().
|
inline |
|
inline |
Get the number of pixels in the image in the y-direction.
Definition at line 45 of file Image.hxx.
References Zeni::Point2i::y.
Referenced by Zeni::Window::alert_window_resized(), and resize().
Definition at line 334 of file Image.cpp.
References extract_Color(), height(), i, j, set_Color(), swap(), and width().
Set the Color value of the pixel specified [0, 0] being the upper left, (width, height) being the lower right.
Definition at line 191 of file Image.cpp.
References Zeni::Color::get_rgba(), and set_RGBA().
Referenced by resize().
Set the Color value of the pixel specified [0, 0] being the upper left, (width, height) being the lower right.
Definition at line 195 of file Image.cpp.
References assert, Luminance, Luminance_Alpha, RGB, and RGBA.
Referenced by set_Color().
|
inline |
|
inline |
Get the number of pixels in the image in the x-direction.
Definition at line 41 of file Image.hxx.
References Zeni::Point2i::x.
Referenced by Zeni::Window::alert_window_resized(), and resize().