Visual Computing Library
|
The Image class stores an Image in 4 bytes RGBA format. More...
#include <vclib/space/core/image.h>
Public Member Functions | |
Image (const std::string &filename) | |
Load an image from a file. | |
Image (const void *data, uint w, uint h, bool yFlip=false, Color::Format format=Color::Format::ABGR) | |
Construct an Image from a raw buffer, which is assumed to be in the given format (default: ABGR). | |
bool | isNull () const |
int | height () const |
int | width () const |
std::size_t | sizeInBytes () const |
Color | pixel (uint i, uint j) const |
const unsigned char * | data () const |
bool | load (const std::string &filename) |
void | save (const std::string &filename, uint quality=90) const |
void | mirror (bool horizontal=false, bool vertical=true) |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
Private Attributes | |
Array2< uint32_t > | mImg |
The Image class stores an Image in 4 bytes RGBA format.
Each pixel is stored as 4 bytes, with the first byte representing RGBA in a uint32_t
.
|
inline |
Load an image from a file.
[in] | filename | the name of the file. |
|
inline |
Construct an Image from a raw buffer, which is assumed to be in the given format (default: ABGR).
[in] | data | the raw buffer. |
[in] | w | the width of the image. |
[in] | h | the height of the image. |
[in] | yFlip | if true, the image is flipped along the y axis. |
[in] | format | the format of the buffer, that is the way each pixel (4 bytes) is stored. |