![]() |
RigsofRods
2023.09
Soft-body Physics Simulation
|
Class for store variable channels of an image. More...
#include <Image.h>
Data Structures | |
struct | Pixel |
Pixel structure. More... | |
Public Types | |
enum | Type { TYPE_ONE_CHANNEL = 1, TYPE_TWO_CHANNELS = 2, TYPE_RGB = 3, TYPE_RGBA = 4 } |
Image type enum. More... | |
enum | Channel { CHANNEL_R = 0, CHANNEL_G = 1, CHANNEL_B = 2, CHANNEL_A = 3 } |
Channel enum. More... | |
Public Member Functions | |
Image (const Size &Size) | |
Constructor. More... | |
Image (const Size &Size, const Type &Type) | |
Constructor. More... | |
Image (const Size &Size, const Type &Type, const float &v) | |
Constructor. More... | |
~Image () | |
Destructor. More... | |
const float & | getValue (const int &x, const int &y, const int &c) const |
Get a pixel value. More... | |
float | getValueLI (const float &x, const float &y, const int &c) const |
Get a pixel value with linear interpolation, like x = 4.56, y = 8.34. More... | |
const float & | getValue (const int &x, const int &y, const Channel &c) const |
Get a pixel value. More... | |
float | getValueLI (const float &x, const float &y, const Channel &c) const |
Get a pixel value with linear interpolation, like x = 4.56, y = 8.34. More... | |
Pixel | getPixel (const int &x, const int &y) const |
Get a pixel. More... | |
Pixel | getPixelLI (const float &x, const float &y) const |
Get a pixel with linear interpolation, like x = 4.56, y = 8.34. More... | |
void | setValue (const int &x, const int &y, const int &c, const float &v) |
Set a pixel value. More... | |
void | setValue (const int &x, const int &y, const Channel &c, const float &v) |
Set a pixel value. More... | |
void | setPixel (const int &x, const int &y, const Pixel &p) |
Set a pixel. More... | |
Size | getSize () const |
Get image size. More... | |
Type | getType () const |
Get image type. More... | |
const int & | getNumberOfChannels () const |
Get number of channels. More... | |
Private Member Functions | |
void | _Initialize (const float &v) |
Initialize array (Reserve dynamic memory) More... | |
Private Attributes | |
Size | mSize |
Image size. More... | |
int | mChannels |
Number of channels. More... | |
float * | mData |
Our image data. More... | |
enum Hydrax::Image::Type |
Hydrax::Image::Image | ( | const Size & | Size | ) |
|
private |
|
inline |
Image::Pixel Hydrax::Image::getPixel | ( | const int & | x, |
const int & | y | ||
) | const |
Image::Pixel Hydrax::Image::getPixelLI | ( | const float & | x, |
const float & | y | ||
) | const |
|
inline |
|
inline |
|
inline |
const float & Hydrax::Image::getValue | ( | const int & | x, |
const int & | y, | ||
const int & | c | ||
) | const |
|
inline |
float Hydrax::Image::getValueLI | ( | const float & | x, |
const float & | y, | ||
const int & | c | ||
) | const |
void Hydrax::Image::setPixel | ( | const int & | x, |
const int & | y, | ||
const Pixel & | p | ||
) |
|
inline |
void Hydrax::Image::setValue | ( | const int & | x, |
const int & | y, | ||
const int & | c, | ||
const float & | v | ||
) |