Equalizer  1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
eq::fabric::PixelViewport Class Reference

Holds a 2D pixel viewport with methods for manipulation. More...

#include <pixelViewport.h>

+ Collaboration diagram for eq::fabric::PixelViewport:

Public Member Functions

Constructors
 PixelViewport ()
 Construct a new, invalid pixel viewport. More...
 
 PixelViewport (const int32_t x_, const int32_t y_, const int32_t w_, const int32_t h_)
 Construct a new pixel viewport with default values. More...
 
 PixelViewport (const int32_t pvp[4])
 Construct a new pixel viewport with default values. More...
 
Data Access
void invalidate ()
 Invalidate the pixel viewport. More...
 
bool isValid () const
 
bool hasArea () const
 
uint32_t getArea () const
 
bool isInside (const int32_t pX, const int32_t pY) const
 
Operations
void apply (const Viewport &rhs)
 Apply a fractional viewport to this pixel viewport.
 
void apply (const Pixel &pixel)
 Apply a pixel decomposition to this pixel viewport.
 
void apply (const Zoom &zoom)
 Apply a zoom to this pixel viewport.
 
const Zoom getZoom (const PixelViewport &rhs) const
 
int32_t getXEnd () const
 
int32_t getYEnd () const
 
void convertToPlugin (uint64_t dims[4]) const
 Convert into a lunchbox::Plugin usable format. More...
 
void convertFromPlugin (const uint64_t dims[4])
 Convert from a lunchbox::Plugin format. More...
 
const PixelViewport operator+ (const Vector2i &offset) const
 
Viewport operator/ (const PixelViewport &rhs) const
 
const PixelViewportoperator-= (const Vector2i &offset)
 
void unapply (const Pixel &pixel)
 Perform the inverse operation of applying a pixel decomposition to this pixel viewport. More...
 
bool operator== (const PixelViewport &rhs) const
 
bool operator!= (const PixelViewport &rhs) const
 
void merge (const PixelViewport &rhs)
 Create a pixel viewport that includes both viewports (union). More...
 
void intersect (const PixelViewport &rhs)
 Create the intersection of the two pixel viewports. More...
 

Public Attributes

int32_t x
 
int32_t y
 
int32_t w
 
int32_t h
 

Detailed Description

Holds a 2D pixel viewport with methods for manipulation.

Definition at line 34 of file pixelViewport.h.

Constructor & Destructor Documentation

eq::fabric::PixelViewport::PixelViewport ( )
inline

Construct a new, invalid pixel viewport.

Version
1.0

Definition at line 40 of file pixelViewport.h.

Referenced by operator+().

+ Here is the caller graph for this function:

eq::fabric::PixelViewport::PixelViewport ( const int32_t  x_,
const int32_t  y_,
const int32_t  w_,
const int32_t  h_ 
)
inlineexplicit

Construct a new pixel viewport with default values.

Version
1.0

Definition at line 43 of file pixelViewport.h.

eq::fabric::PixelViewport::PixelViewport ( const int32_t  pvp[4])
inlineexplicit

Construct a new pixel viewport with default values.

Version
1.1.6

Definition at line 48 of file pixelViewport.h.

Member Function Documentation

void eq::fabric::PixelViewport::convertFromPlugin ( const uint64_t  dims[4])
inline

Convert from a lunchbox::Plugin format.

Version
1.5.2

Definition at line 174 of file pixelViewport.h.

void eq::fabric::PixelViewport::convertToPlugin ( uint64_t  dims[4]) const
inline

Convert into a lunchbox::Plugin usable format.

Version
1.5.2

Definition at line 165 of file pixelViewport.h.

uint32_t eq::fabric::PixelViewport::getArea ( ) const
inline
Returns
the area in pixels.
Version
1.0

Definition at line 72 of file pixelViewport.h.

int32_t eq::fabric::PixelViewport::getXEnd ( ) const
inline
Returns
the X end position.
Version
1.0

Definition at line 159 of file pixelViewport.h.

int32_t eq::fabric::PixelViewport::getYEnd ( ) const
inline
Returns
the Y end position.
Version
1.0

Definition at line 162 of file pixelViewport.h.

const Zoom eq::fabric::PixelViewport::getZoom ( const PixelViewport rhs) const
inline
Returns
the zoom which would result in the given rhs pixel viewport when applied to this pixel viewport.

Definition at line 145 of file pixelViewport.h.

References hasArea(), and eq::fabric::Zoom::NONE.

+ Here is the call graph for this function:

bool eq::fabric::PixelViewport::hasArea ( ) const
inline
Returns
true if the pixel viewport has a non-zero area, i.e, it is not empty.
Version
1.0

Definition at line 69 of file pixelViewport.h.

Referenced by getZoom(), intersect(), and merge().

+ Here is the caller graph for this function:

void eq::fabric::PixelViewport::intersect ( const PixelViewport rhs)
inline

Create the intersection of the two pixel viewports.

Version
1.0

Definition at line 273 of file pixelViewport.h.

References hasArea(), invalidate(), and isValid().

+ Here is the call graph for this function:

void eq::fabric::PixelViewport::invalidate ( )
inline

Invalidate the pixel viewport.

Version
1.0

Definition at line 55 of file pixelViewport.h.

Referenced by intersect().

+ Here is the caller graph for this function:

bool eq::fabric::PixelViewport::isInside ( const int32_t  pX,
const int32_t  pY 
) const
inline
Returns
true if the given point is inside the pixel viewport.
Version
1.0

Definition at line 78 of file pixelViewport.h.

bool eq::fabric::PixelViewport::isValid ( ) const
inline
Returns
true if the pixel viewport has a non-negative, but potentially empty, size.
Version
1.0

Definition at line 62 of file pixelViewport.h.

Referenced by intersect().

+ Here is the caller graph for this function:

void eq::fabric::PixelViewport::merge ( const PixelViewport rhs)
inline

Create a pixel viewport that includes both viewports (union).

Version
1.0

Definition at line 250 of file pixelViewport.h.

References hasArea().

+ Here is the call graph for this function:

bool eq::fabric::PixelViewport::operator!= ( const PixelViewport rhs) const
inline
Returns
true if the two pixel viewports are not identical.
Version
1.0

Definition at line 241 of file pixelViewport.h.

const PixelViewport eq::fabric::PixelViewport::operator+ ( const Vector2i offset) const
inline
Returns
the addition of this pvp with an offset.
Version
1.0

Definition at line 183 of file pixelViewport.h.

References PixelViewport().

+ Here is the call graph for this function:

const PixelViewport& eq::fabric::PixelViewport::operator-= ( const Vector2i offset)
inline
Returns
this pvp minus an offset.
Version
1.3.0

Definition at line 208 of file pixelViewport.h.

bool eq::fabric::PixelViewport::operator== ( const PixelViewport rhs) const
inline
Returns
true if the two pixel viewports are identical.
Version
1.0

Definition at line 232 of file pixelViewport.h.

void eq::fabric::PixelViewport::unapply ( const Pixel pixel)
inline

Perform the inverse operation of applying a pixel decomposition to this pixel viewport.

Version
1.0

Definition at line 220 of file pixelViewport.h.


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