C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
VSN::SizeI Class Reference

SizeI class describes a size and uses an integer precision. More...

#include <vsn_size.h>

Public Member Functions

 SizeI ()
 Default constructor that creates invalid size, i.e. IsValid() returns false.
 
 SizeI (int w, int h)
 Constructor with setting width and height.
 
bool IsNull () const
 Returns true if width and height are 0 otherwise returns false.
 
bool IsEmpty () const
 Returns true if width and height are less than or equal to 0 otherwise returns false.
 
bool IsValid () const
 Returns true if width and height are greater than or equal to 0 otherwise returns false.
 
int GetWidth () const
 Returns width.
 
int GetHeight () const
 Returns height.
 
void SetWidth (int w)
 Sets width.
 
void SetHeight (int h)
 Sets height.
 
int & InitWidth ()
 Returns reference to width.
 
int & InitHeight ()
 Returns reference to height.
 
SizeIoperator+= (const SizeI &)
 Adds the specified size to this size and returns reference to this size.
 
SizeIoperator-= (const SizeI &)
 Subtracts the given size from this size and returns reference to this size.
 
const SizeI operator*= (float)
 Multiplies size by the specified number.
 
bool operator== (const SizeI &)
 Returns true if the specified size and this one are equal otherwise returns false.
 
bool operator!= (const SizeI &)
 Returns true if the specified size and this one are different otherwise returns false.
 
const SizeI operator+ (const SizeI &)
 Returns sum of the specified size and this one. Each component is added separately.
 
const SizeI operator- (const SizeI &)
 Returns difference between this size and the specified one. Each component is subtracted separately.
 

Friends

VSN_FUNC_EX const SizeI operator* (const SizeI &s, float c)
 Returns composition of two sizes with the specified number.
 

Detailed Description

SizeI class describes a size and uses an integer precision.

SizeI class defines a width and height. It can be initialized in constructor or changed with SetWidth(), SetHeight() functions, and also uses the arithmetic operators. SizeI can be managed directly changing its values by receiving the references to width and heights. The width and height can be initialized with functions or with constructor. IsValid() method defines the correct size: the correct size must have a width and height greater than 0. IsEmpty() function returns true if the width and height are less than or equal to 0, and IsNull() function returns true if the width and height are 0.


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