Image3f class

A floating-point RGB image.

Base classes

template<typename T>
class Array2d<Color3f>
Generic, resizable, 2D array class.

Public static functions

static auto loadable_formats() -> std::set<std::string>
Set of supported formats for image loading.
static auto savable_formats() -> std::set<std::string>
Set of supported formats for image saving.

Constructors, destructors, conversion operators

Image3f()
Default constructor (empty image)
Image3f(int w, int h)
Size Constructor (sets width and height)
Image3f(int w, int h, const Color3f& v)
Construct an image of a fixed size and initialize all pixels.

Public functions

auto load(const std::string& filename) -> bool
Load an image from file.
auto save(const std::string& filename, float gain = 1.0f) -> bool
Save an image to the specified filename.

Function documentation

Image3f::Image3f(int w, int h)

Size Constructor (sets width and height)

Parameters
w The width of the image
h The height of the image

Image3f::Image3f(int w, int h, const Color3f& v)

Construct an image of a fixed size and initialize all pixels.

Parameters
w The width of the image
h The height of the image
v The Color to set all pixels

bool Image3f::load(const std::string& filename)

Load an image from file.

Parameters
filename The filename
Returns True if the file loaded successfully

bool Image3f::save(const std::string& filename, float gain = 1.0f)

Save an image to the specified filename.

Parameters
filename The filename to save to
gain The multiplicative gain to apply to pixel values before saving
Returns True if the file saved successfully