reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

ofRectangle.h File Reference
#include "ofConstants.h"
#include <glm/vec3.hpp>
#include <glm/vec2.hpp>

Go to the source code of this file.

Classes

class  ofRectangle
 A class representing a 2D rectangle. More...
 

Enumerations

enum  ofAspectRatioMode { OF_ASPECT_RATIO_IGNORE = 0 , OF_ASPECT_RATIO_KEEP = 1 , OF_ASPECT_RATIO_KEEP_BY_EXPANDING = 2 }
 Used to represent the available rectangle aspect ratio scaling modes. More...
 
enum  ofAlignVert { OF_ALIGN_VERT_IGNORE = 0x0000 , OF_ALIGN_VERT_TOP = 0x0010 , OF_ALIGN_VERT_BOTTOM = 0x0020 , OF_ALIGN_VERT_CENTER = 0x0040 }
 Used to represent the available vertical rectangle alignment modes. More...
 
enum  ofAlignHorz { OF_ALIGN_HORZ_IGNORE = 0x0000 , OF_ALIGN_HORZ_LEFT = 0x0001 , OF_ALIGN_HORZ_RIGHT = 0x0002 , OF_ALIGN_HORZ_CENTER = 0x0004 }
 Used to represent the available horizontal rectangle alignment modes. More...
 
enum  ofScaleMode { OF_SCALEMODE_FIT = 0 , OF_SCALEMODE_FILL = 1 , OF_SCALEMODE_CENTER = 2 , OF_SCALEMODE_STRETCH_TO_FILL = 3 }
 Used to represent the available rectangle scaling modes. More...
 

Enumeration Type Documentation

◆ ofAlignHorz

Used to represent the available horizontal rectangle alignment modes.

See also
ofRectangle
Enumerator
OF_ALIGN_HORZ_IGNORE 

Do not perform any horizontal alignment.

OF_ALIGN_HORZ_LEFT 

Use the left edge of the rectangle to horizontally anchor the alignment.

OF_ALIGN_HORZ_RIGHT 

Use the right edge of the rectangle to horizontally anchor the alignment.

OF_ALIGN_HORZ_CENTER 

Use the center of the rectangle to horizontally anchor the alignment.

◆ ofAlignVert

Used to represent the available vertical rectangle alignment modes.

See also
ofRectangle
Enumerator
OF_ALIGN_VERT_IGNORE 

Do not perform any vertical alignment.

OF_ALIGN_VERT_TOP 

Use the upper edge of the rectangle to vertically anchor the alignment.

OF_ALIGN_VERT_BOTTOM 

Use the bottom edge of the rectangle to vertically anchor the alignment.

OF_ALIGN_VERT_CENTER 

Use the center of the rectangle to vertically anchor the alignment.

◆ ofAspectRatioMode

Used to represent the available rectangle aspect ratio scaling modes.

See also
ofRectangle
Enumerator
OF_ASPECT_RATIO_IGNORE 

Set the rectangle's width and height to match the target.

OF_ASPECT_RATIO_KEEP 

Resizes the rectangle to completely fit within the target.

OF_ASPECT_RATIO_KEEP_BY_EXPANDING 

Resizes the rectangle to completely enclose the target.

◆ ofScaleMode

Used to represent the available rectangle scaling modes.

ofScaleMode can usually be interpreted as a concise combination of an ofAspectRatioMode, an ofAlignVert and an ofAlignHorz.

Enumerator
OF_SCALEMODE_FIT 

Center and scale the rectangle to fit inside the target.

This centers the subject rectangle within the target rectangle and
resizes the subject rectangle to completely fit within the target
rectangle. 
OF_SCALEMODE_FILL 

Move and scale the rectangle to completely enclose the target.

This centers the subject rectangle within the target rectangle and
resizes the subject rectangle to completely encompass the target
rectangle. 
OF_SCALEMODE_CENTER 

Move the rectangle to be centered on the target.

This centers the subject rectangle within the target rectangle and
does not modify the Subject's size or aspect ratio. 
OF_SCALEMODE_STRETCH_TO_FILL 

Match the target rectangle's position and dimensions.