30 Image(
unsigned int awidth,
unsigned int aheight,
unsigned int acomponents,
float value = 0.0f);
38 glm::vec4 &
rgba(
int x,
int y);
46 glm::vec3 &
rgb(
int x,
int y);
54 float &
r(
int x,
int y);
62 const glm::vec4 &
rgba(
int x,
int y)
const;
70 const glm::vec3 &
rgb(
int x,
int y)
const;
78 const float &
r(
int x,
int y)
const;
86 glm::vec3
rgbl(
float x,
float y)
const;
94 glm::vec3
rgbn(
float x,
float y)
const;
102 glm::vec4
rgbal(
float x,
float y)
const;
111 int load(
const std::string & path,
unsigned int channels,
bool flip,
bool externalFile);
118 int save(
const std::string & path,
Save options)
const;
125 static bool isFloat(
const std::string & path);
171 int loadLDR(
const std::string & path,
unsigned int channels,
bool flip,
bool externalFile);
180 int loadHDR(
const std::string & path,
unsigned int channels,
bool flip,
bool externalFile);
189inline int modPos(
int x,
int w){
199 return static_cast< Image::Save>(
static_cast<uint
>(t0) |
static_cast<uint
>(t1));
208 return bool(
static_cast<uint
>(t0) &
static_cast<uint
>(t1));
Represents an image composed of pixels with values in [0,1]. Provide image loading/saving utilities,...
Definition: Image.hpp:8
static bool isFloat(const std::string &path)
Definition: Image.cpp:122
int save(const std::string &path, Save options) const
Definition: Image.cpp:115
unsigned int components
Number of components/channels.
Definition: Image.hpp:145
float & r(int x, int y)
Definition: Image.cpp:38
Image(const Image &)=delete
glm::vec3 rgbn(float x, float y) const
Definition: Image.cpp:54
Image & operator=(const Image &)=delete
glm::vec4 rgbal(float x, float y) const
Definition: Image.cpp:86
int load(const std::string &path, unsigned int channels, bool flip, bool externalFile)
Definition: Image.cpp:108
unsigned int height
The height of the image.
Definition: Image.hpp:144
Image & operator=(Image &&)=default
glm::vec4 & rgba(int x, int y)
Definition: Image.cpp:30
int loadHDR(const std::string &path, unsigned int channels, bool flip, bool externalFile)
Definition: Image.cpp:335
unsigned int width
The width of the image.
Definition: Image.hpp:143
std::vector< float > pixels
The pixels values of the image.
Definition: Image.hpp:146
glm::vec3 rgbl(float x, float y) const
Definition: Image.cpp:64
Save
Options for saving an image to disk.
Definition: Image.hpp:13
@ SRGB_LDR
Apply gamma sRGB correction before saving, ignored for HDR images.
@ NONE
No specific options.
@ FLIP
Flip the image vertically.
@ IGNORE_ALPHA
Force alpha to 1.
int loadLDR(const std::string &path, unsigned int channels, bool flip, bool externalFile)
Definition: Image.cpp:291
int saveAsHDR(const std::string &path, Save options) const
Definition: Image.cpp:160
int saveAsLDR(const std::string &path, Save options) const
Definition: Image.cpp:126
glm::vec3 & rgb(int x, int y)
Definition: Image.cpp:34