Rumba C++ SDK
maquina::Image Class Reference

An Image. More...

#include <Image.h>

Inheritance diagram for maquina::Image:
maquina::Value

Public Member Functions

 Image ()
 
 Image (const Value &v)
 Cast a Value object in Image. More...
 
 Image (int width, int height, int channels, bool clear=true)
 
int width () const
 Returns the image width. More...
 
int height () const
 Returns the image height. More...
 
int channels () const
 Returns the image channels count. More...
 
void * pixels () const
 Returns the image pixels. More...
 
void pixel (int x, int y, float *pixel, int channels) const
 Get the pixel. More...
 
void set_pixel (int x, int y, const Imath::Color4f &color)
 Set the pixel. More...
 
void to_UINT8 ()
 Convert Image to UINT8 format if needed. More...
 
void to_RGBA ()
 Add or remove channels to make Image RGBA. More...
 
bool read (const std::wstring &path)
 
bool write (const char *path) const
 
void flip ()
 Flip the image vertically. More...
 
void rotate (int rotation)
 Rotate the image image by 90, 180 or 270d. More...
 
void resize (int width, int height)
 Resize the image. More...
 
- Public Member Functions inherited from maquina::Value
 Value ()
 
Value duplicate () const
 Duplicate the value. More...
 
bool as_bool () const
 Returns the value as a bool. More...
 
int as_int () const
 Returns the value as an integer. More...
 
float as_float () const
 Returns the value as a float. More...
 
double as_double () const
 Returns the value as a double. More...
 
const std::string & as_string () const
 Returns the value as a string. More...
 
std::wstring as_wstring () const
 Returns the value as a wstring. More...
 
Imath::V2f as_V2f () const
 Returns the value as a V2f. More...
 
Imath::V3f as_V3f () const
 Returns the value as a V3f. More...
 
Imath::V4f as_V4f () const
 Returns the value as a V4f. More...
 
const Imath::V2das_V2d () const
 Returns the value as a V2d. More...
 
const Imath::V3das_V3d () const
 Returns the value as a V3d. More...
 
const Imath::V4das_V4d () const
 Returns the value as a V4d. More...
 
const Imath::V2ias_V2i () const
 Returns the value as a V2i. More...
 
const Imath::V3ias_V3i () const
 Returns the value as a V3i. More...
 
const Imath::V4ias_V4i () const
 Returns the value as a V4i. More...
 
Imath::M44f as_M44f () const
 Returns the value as a M44f. More...
 
const Imath::M44das_M44d () const
 Returns the value as a M44d. More...
 
const Imath::Box3fas_Box3f () const
 Returns the value as a Box3f. More...
 
const Imath::Color4fas_Color4f () const
 Returns the value as a Color4f. More...
 
Imath::Quatf as_Quatf () const
 Returns the value as a Quatf. More...
 
const Imath::Quatdas_Quatd () const
 Returns the value as a Quatd. More...
 
std::shared_ptr< const UserDataas_user_data () const
 Returns the value as a user data. More...
 
StringView type_name () const
 Return the type name of the Value. More...
 
bool has_node_delegate () const
 Check if this value can produces a NodeDelegate. More...
 
std::shared_ptr< NodeDelegatenode_delegate (const std::shared_ptr< NodeDelegate > &parent, const StringView &name) const
 
bool operator== (const Value &o) const
 Compare the two values. More...
 
bool operator!= (const Value &o) const
 
bool is_instance (const char *value_type_name) const
 Check if this type derives from another value type. More...
 
bool is_interpolable () const
 Checks if the value is interpolable. More...
 
Value lerp (const Value &other, double weight) const
 Performs linear interpolation between this value and another value. More...
 
 Value (bool)
 Create a boolean value. More...
 
 Value (int)
 Create an integer value. More...
 
 Value (float)
 Create a float value. More...
 
 Value (double)
 Create a double value. More...
 
 Value (const char *string)
 Create a string value. More...
 
 Value (const wchar_t *string)
 Create a string value. More...
 
 Value (const std::string &string)
 Create a string value. More...
 
 Value (const std::wstring &string)
 Create a wide string value. More...
 
 Value (const Imath::V2f &)
 Create a Imath::V2f value. More...
 
 Value (const Imath::V3f &)
 Create a Imath::V3f value. More...
 
 Value (const Imath::V4f &)
 Create a Imath::V4f value. More...
 
 Value (const Imath::V2d &)
 Create a Imath::V2d value. More...
 
 Value (const Imath::V3d &)
 Create a Imath::V3d value. More...
 
 Value (const Imath::V4d &)
 Create a Imath::V4d value. More...
 
 Value (const Imath::V2i &)
 Create a Imath::V2i value. More...
 
 Value (const Imath::V3i &)
 Create a Imath::V3i value. More...
 
 Value (const Imath::V4i &)
 Create a Imath::V4i value. More...
 
 Value (const Imath::Color4f &)
 Create a Imath::Color4f value. More...
 
 Value (const Imath::M44f &)
 Create a Imath::M44f value. More...
 
 Value (const Imath::M44d &)
 Create a Imath::M44d value. More...
 
 Value (const Imath::Box3f &)
 Create a Imath::Box3f value. More...
 
 Value (const Imath::Quatf &)
 Create a Imath::Quatf value. More...
 
 Value (const Imath::Quatd &)
 Create a Imath::Quatd value. More...
 
 Value (const std::shared_ptr< const UserData > &user_data)
 Create a user data value. More...
 

Static Public Attributes

static const Image default_value
 The default value. More...
 
- Static Public Attributes inherited from maquina::Value
static const Value default_value
 The default value. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from maquina::Value
static bool validate_type_name (const char *type_name)
 Return true if the name is a valid type name. More...
 
static Value get_default_value (const char *type_name)
 Return a default value for a given type. More...
 

Detailed Description

An Image.

Constructor & Destructor Documentation

◆ Image() [1/3]

maquina::Image::Image ( )

◆ Image() [2/3]

maquina::Image::Image ( const Value v)

Cast a Value object in Image.

If v has not the good type, a default value is constructed.

◆ Image() [3/3]

maquina::Image::Image ( int  width,
int  height,
int  channels,
bool  clear = true 
)

Member Function Documentation

◆ channels()

int maquina::Image::channels ( ) const

Returns the image channels count.

◆ flip()

void maquina::Image::flip ( )

Flip the image vertically.

◆ height()

int maquina::Image::height ( ) const

Returns the image height.

◆ pixel()

void maquina::Image::pixel ( int  x,
int  y,
float *  pixel,
int  channels 
) const

Get the pixel.

◆ pixels()

void* maquina::Image::pixels ( ) const

Returns the image pixels.

◆ read()

bool maquina::Image::read ( const std::wstring &  path)

◆ resize()

void maquina::Image::resize ( int  width,
int  height 
)

Resize the image.

◆ rotate()

void maquina::Image::rotate ( int  rotation)

Rotate the image image by 90, 180 or 270d.

◆ set_pixel()

void maquina::Image::set_pixel ( int  x,
int  y,
const Imath::Color4f color 
)

Set the pixel.

◆ to_RGBA()

void maquina::Image::to_RGBA ( )

Add or remove channels to make Image RGBA.

◆ to_UINT8()

void maquina::Image::to_UINT8 ( )

Convert Image to UINT8 format if needed.

◆ width()

int maquina::Image::width ( ) const

Returns the image width.

◆ write()

bool maquina::Image::write ( const char *  path) const

Member Data Documentation

◆ default_value

const Image maquina::Image::default_value
static

The default value.


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