Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Private Member Functions | Private Attributes
Hydrax::Image Class Reference

Description

Class for store variable channels of an image.

Definition at line 42 of file Image.h.

Data Structures

struct  Pixel
 

Public Types

enum  Type
 
enum  Channel
 

Public Member Functions

 Image (const Size &Size)
 
 Image (const Size &Size, const Type &Type)
 
 Image (const Size &Size, const Type &Type, const float &v)
 
 ~Image ()
 
const float & getValue (const int &x, const int &y, const int &c) const
 
float getValueLI (const float &x, const float &y, const int &c) const
 
const float & getValue (const int &x, const int &y, const Channel &c) const
 
float getValueLI (const float &x, const float &y, const Channel &c) const
 
Pixel getPixel (const int &x, const int &y) const
 
Pixel getPixelLI (const float &x, const float &y) const
 
void setValue (const int &x, const int &y, const int &c, const float &v)
 
void setValue (const int &x, const int &y, const Channel &c, const float &v)
 
void setPixel (const int &x, const int &y, const Pixel &p)
 
Size getSize () const
 
Type getType () const
 
const int & getNumberOfChannels () const
 

Private Member Functions

void _Initialize (const float &v)
 

Private Attributes

Size mSize
 
int mChannels
 
float * mData
 

Member Enumeration Documentation

◆ Channel

Channel enum.

Enumerator
CHANNEL_R 
CHANNEL_G 
CHANNEL_B 
CHANNEL_A 

Definition at line 58 of file Image.h.

◆ Type

Image type enum.

Enumerator
TYPE_ONE_CHANNEL 
TYPE_TWO_CHANNELS 
TYPE_RGB 
TYPE_RGBA 

Default.

Definition at line 47 of file Image.h.

Constructor & Destructor Documentation

◆ Image() [1/3]

Hydrax::Image::Image ( const Size &  Size)

Constructor.

Parameters
SizeImage size

Definition at line 29 of file Image.cpp.

◆ Image() [2/3]

Hydrax::Image::Image ( const Size &  Size,
const Type &  Type 
)

Constructor.

Parameters
SizeImage size
TypeImage type

Definition at line 37 of file Image.cpp.

◆ Image() [3/3]

Hydrax::Image::Image ( const Size &  Size,
const Type &  Type,
const float &  v 
)

Constructor.

Parameters
SizeImage size
TypeImage type
vInitial channel values

Definition at line 45 of file Image.cpp.

◆ ~Image()

Hydrax::Image::~Image ( )

Destructor.

Definition at line 53 of file Image.cpp.

Member Function Documentation

◆ _Initialize()

void Hydrax::Image::_Initialize ( const float &  v)
private

Initialize array (Reserve dynamic memory)

Parameters
vInitial values

Definition at line 239 of file Image.cpp.

◆ getNumberOfChannels()

const int & Hydrax::Image::getNumberOfChannels ( ) const
inline

Get number of channels.

Returns
Number of channels

Definition at line 253 of file Image.h.

◆ getPixel()

Image::Pixel Hydrax::Image::getPixel ( const int &  x,
const int &  y 
) const

Get a pixel.

Parameters
xX value
yY value
Returns
Pixel

Definition at line 114 of file Image.cpp.

◆ getPixelLI()

Image::Pixel Hydrax::Image::getPixelLI ( const float &  x,
const float &  y 
) const

Get a pixel with linear interpolation, like x = 4.56, y = 8.34.

Parameters
xX value
yY value
Returns
Pixel

Definition at line 144 of file Image.cpp.

◆ getSize()

Size Hydrax::Image::getSize ( ) const
inline

Get image size.

Returns
Image size

Definition at line 237 of file Image.h.

◆ getType()

Type Hydrax::Image::getType ( ) const
inline

Get image type.

Returns
Image type

Definition at line 245 of file Image.h.

◆ getValue() [1/2]

const float & Hydrax::Image::getValue ( const int &  x,
const int &  y,
const Channel &  c 
) const
inline

Get a pixel value.

Parameters
xX value
yY value
cChannel
Returns
Pixel channel value

Definition at line 176 of file Image.h.

◆ getValue() [2/2]

const float & Hydrax::Image::getValue ( const int &  x,
const int &  y,
const int &  c 
) const

Get a pixel value.

Parameters
xX value
yY value
cChannel
Returns
Pixel channel value

Definition at line 58 of file Image.cpp.

◆ getValueLI() [1/2]

float Hydrax::Image::getValueLI ( const float &  x,
const float &  y,
const Channel &  c 
) const
inline

Get a pixel value with linear interpolation, like x = 4.56, y = 8.34.

Parameters
xX value
yY value
cChannel
Returns
Pixel channel value

Definition at line 188 of file Image.h.

◆ getValueLI() [2/2]

float Hydrax::Image::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.

Parameters
xX value
yY value
cChannel
Returns
Pixel channel value

Definition at line 76 of file Image.cpp.

◆ setPixel()

void Hydrax::Image::setPixel ( const int &  x,
const int &  y,
const Pixel &  p 
)

Set a pixel.

Parameters
xX value
yY value
pPixel

Definition at line 192 of file Image.cpp.

◆ setValue() [1/2]

void Hydrax::Image::setValue ( const int &  x,
const int &  y,
const Channel &  c,
const float &  v 
)
inline

Set a pixel value.

Parameters
xX value
yY value
cChannel
vValue

Definition at line 222 of file Image.h.

◆ setValue() [2/2]

void Hydrax::Image::setValue ( const int &  x,
const int &  y,
const int &  c,
const float &  v 
)

Set a pixel value.

Parameters
xX value
yY value
cChannel
vValue

Definition at line 174 of file Image.cpp.

Field Documentation

◆ mChannels

int Hydrax::Image::mChannels
private

Number of channels.

Definition at line 267 of file Image.h.

◆ mData

float* Hydrax::Image::mData
private

Our image data.

Definition at line 270 of file Image.h.

◆ mSize

Size Hydrax::Image::mSize
private

Image size.

Definition at line 265 of file Image.h.


The documentation for this class was generated from the following files: