42 bool load(
const std::string& filename);
49 bool save(
const std::string& filename,
bool flip =
true)
const;
53 inline int width()
const {
return myWidth; }
57 inline int height()
const {
return myHeight; }
64 inline unsigned char*
data()
const {
return myData; }
93 void set(
int row,
int col,
const Pixel& color);
102 void setVec4(
int row,
int col,
const glm::vec4& color);
111 glm::vec4
getVec4(
int row,
int col)
const;
117 unsigned char* myData;
118 unsigned int myWidth;
119 unsigned int myHeight;
123 #endif // AGL_IMAGE_H_
void set(int width, int height, unsigned char *data)
Replace image RGBA data.
Definition: image.cpp:55
int width() const
Return the image width in pixels.
Definition: image.h:53
int height() const
Return the image height in pixels.
Definition: image.h:57
bool save(const std::string &filename, bool flip=true) const
Save the image to the given filename (.png)
Definition: image.cpp:87
Holder for a RGBA color.
Definition: image.h:17
glm::vec4 getVec4(int row, int col) const
Get the pixel RGBA color at index (row, col)
Definition: image.cpp:117
Implements loading, modifying, and saving RGBA images.
Definition: image.h:27
Global utilities and common third party includes.
Pixel get(int row, int col) const
Get the pixel at index (row, col)
Definition: image.cpp:94
void setVec4(int row, int col, const glm::vec4 &color)
Set the pixel RGBA color at index (row, col)
Definition: image.cpp:129
bool load(const std::string &filename)
Load the given filename (.png)
Definition: image.cpp:75
unsigned char * data() const
Return the RGBA data.
Definition: image.h:64