Pepper_47_C++_interfaces
Public Member Functions | List of all members
pp::FloatSize Class Reference

A size of an object based on width and height. More...

#include <size.h>

Collaboration diagram for pp::FloatSize:
Collaboration graph

Public Member Functions

 FloatSize ()
 The default constructor. Initializes the width and height to 0.0f. More...
 
 FloatSize (const PP_FloatSize &s)
 
 FloatSize (float w, float h)
 
 ~FloatSize ()
 Destructor. More...
 
 operator PP_FloatSize ()
 
const PP_FloatSize & pp_float_size () const
 
PP_FloatSize & pp_float_size ()
 
float width () const
 
void set_width (float w)
 
float height () const
 
void set_height (float h)
 
float GetArea () const
 
void SetSize (float w, float h)
 
void Enlarge (float w, float h)
 
bool IsEmpty () const
 

Detailed Description

A size of an object based on width and height.

Definition at line 149 of file size.h.

Constructor & Destructor Documentation

pp::FloatSize::FloatSize ( )
inline

The default constructor. Initializes the width and height to 0.0f.

Definition at line 153 of file size.h.

pp::FloatSize::FloatSize ( const PP_FloatSize &  s)
inline

A constructor accepting a pointer to a PP_FloatSize and converting the PP_FloatSize to a FloatSize. This is an implicit conversion constructor.

Parameters
[in]sA pointer to a PP_FloatSize.

Definition at line 163 of file size.h.

References set_height(), and set_width().

pp::FloatSize::FloatSize ( float  w,
float  h 
)
inline

A constructor accepting two float values for width and height and converting them to a FloatSize.

Parameters
[in]wAn float value representing a width.
[in]hAn float value representing a height.

Definition at line 174 of file size.h.

References set_height(), and set_width().

pp::FloatSize::~FloatSize ( )
inline

Destructor.

Definition at line 181 of file size.h.

Member Function Documentation

void pp::FloatSize::Enlarge ( float  w,
float  h 
)
inline

Enlarge() enlarges the size of an object.

Parameters
[in]wA width to add the current width.
[in]hA height to add to the current height.

Definition at line 265 of file size.h.

References height(), set_height(), set_width(), and width().

float pp::FloatSize::GetArea ( ) const
inline

GetArea() determines the area (width * height).

Returns
The area.

Definition at line 248 of file size.h.

References height(), and width().

float pp::FloatSize::height ( ) const
inline

Getter function for returning the value of height.

Returns
The value of height for this FloatSize.

Definition at line 230 of file size.h.

Referenced by Enlarge(), GetArea(), IsEmpty(), operator==(), and pp::FloatRect::set_size().

bool pp::FloatSize::IsEmpty ( ) const
inline

IsEmpty() determines if the size is zero.

Returns
true if the size is zero.

Definition at line 273 of file size.h.

References height(), and width().

pp::FloatSize::operator PP_FloatSize ( )
inline

PP_FloatSize() allows implicit conversion of a FloatSize to a PP_FloatSize.

Returns
A Size.

Definition at line 188 of file size.h.

const PP_FloatSize& pp::FloatSize::pp_float_size ( ) const
inline

Getter function for returning the internal PP_FloatSize struct.

Returns
A const reference to the internal PP_FloatSize struct.

Definition at line 197 of file size.h.

PP_FloatSize& pp::FloatSize::pp_float_size ( )
inline

Getter function for returning the internal PP_FloatSize struct.

Returns
A mutable reference to the PP_FloatSize struct.

Definition at line 205 of file size.h.

void pp::FloatSize::set_height ( float  h)
inline

Setter function for setting the value of height.

Parameters
[in]hA new height value.

Definition at line 237 of file size.h.

References PP_DCHECK.

Referenced by Enlarge(), FloatSize(), and SetSize().

void pp::FloatSize::set_width ( float  w)
inline

Setter function for setting the value of width.

Parameters
[in]wA new width value.

Definition at line 219 of file size.h.

References PP_DCHECK.

Referenced by Enlarge(), FloatSize(), and SetSize().

void pp::FloatSize::SetSize ( float  w,
float  h 
)
inline

SetSize() sets the value of width and height.

Parameters
[in]wA new width value.
[in]hA new height value.

Definition at line 256 of file size.h.

References set_height(), and set_width().

float pp::FloatSize::width ( ) const
inline

Getter function for returning the value of width.

Returns
The value of width for this FloatSize.

Definition at line 212 of file size.h.

Referenced by Enlarge(), GetArea(), IsEmpty(), operator==(), and pp::FloatRect::set_size().


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