Resolution Struct Reference

Structure containing the width and height of an image. More...

Functions

 Resolution (int w_=0, int h_=0)
 Default constructor. More...
 
int area () const
 Returns the area (width * height) of the image. More...
 
bool operator== (const Resolution &that) const
 Tests if the given sl::Resolution has the same properties. More...
 
bool operator!= (const Resolution &that) const
 Tests if the given sl::Resolution has different properties. More...
 
bool encode (String &serialized_content) const
 Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string. More...
 
bool decode (const String &serialized_content)
 Fill the structure from the serialized json object contained in the input string. More...
 

Attributes

int width
 Width of the image in pixels. More...
 
int height
 Height of the image in pixels. More...
 

Detailed Description

Structure containing the width and height of an image.

Constructor and Destructor

◆ Resolution()

Resolution ( int  w_ = 0,
int  h_ = 0 
)
inline

Default constructor.

Functions

◆ area()

int area ( ) const
inline

Returns the area (width * height) of the image.

◆ operator==()

bool operator== ( const Resolution that) const
inline

Tests if the given sl::Resolution has the same properties.

Returns
True if the sizes matches.

◆ operator!=()

bool operator!= ( const Resolution that) const
inline

Tests if the given sl::Resolution has different properties.

Returns
True if the sizes are not equal.

◆ encode()

bool encode ( String serialized_content) const

Generate a JSON Object (with the struct type as a key) containing the serialized struct, converted into a string.

Parameters
serialized_contentoutput string containing the JSON Object
Returns
True if file was successfully saved, otherwise false.

◆ decode()

bool decode ( const String serialized_content)

Fill the structure from the serialized json object contained in the input string.

Parameters
serialized_contentinput string containing the JSON Object
Returns
True if the decoding was successful, otherwise false.

Variables

◆ width

◆ height