iPlug2 - C++ Audio Plug-in Framework
|
Used to manage a list of rectangular areas and optimize them for drawing to the screen. More...
#include <IGraphicsStructs.h>
Public Member Functions | |
IRECTList (const IRECTList &)=delete | |
IRECTList & | operator= (const IRECTList &)=delete |
int | Size () const |
void | Add (const IRECT &rect) |
Add a rectangle to the list. More... | |
void | Set (int idx, const IRECT &rect) |
Set a specific rectangle in the list (will crash if idx is invalid) More... | |
const IRECT & | Get (int idx) const |
Get an IRECT from the list (will crash if idx is invalid) More... | |
void | Clear () |
Clear the list. More... | |
IRECT | Bounds () |
Get a union of all rectangles in the list. More... | |
void | PixelAlign () |
Align the rectangles to pixel boundaries. More... | |
void | PixelAlign (float scale) |
Pixel-align the IRECTs at the given scale factor then scale them back down. More... | |
int | Find (float x, float y) const |
Find the first index of the rect that contains point x, y, if it exists. More... | |
void | Optimize () |
Remove rects that are contained by other rects and intersections and merge any rects that can be merged. More... | |
Static Public Member Functions | |
static bool | GetFracGrid (const IRECT &input, IRECTList &rects, const std::initializer_list< float > &rowFractions, const std::initializer_list< float > &colFractions, EDirection layoutDir=EDirection::Horizontal) |
Fill an IRECTList with divisons of an input IRECT. More... | |
Used to manage a list of rectangular areas and optimize them for drawing to the screen.
Definition at line 1740 of file IGraphicsStructs.h.
|
inline |
Definition at line 1743 of file IGraphicsStructs.h.
|
inline |
Add a rectangle to the list.
rect | The IRECT to add |
Definition at line 1754 of file IGraphicsStructs.h.
Referenced by IGraphics::AttachGestureRecognizerToRegion(), GetFracGrid(), and IGraphics::IsDirty().
|
inline |
Get a union of all rectangles in the list.
Definition at line 1783 of file IGraphicsStructs.h.
References Get(), and IRECT::Union().
Referenced by IGraphics::Draw(), and GetFracGrid().
|
inline |
Clear the list.
Definition at line 1776 of file IGraphicsStructs.h.
Referenced by IGraphics::ClearGestureRegions().
|
inline |
Find the first index of the rect that contains point x, y, if it exists.
x | Horizontal position to check |
y | Vertical position to check |
Definition at line 1818 of file IGraphicsStructs.h.
References IRECT::Contains(), Get(), and Size().
Referenced by IGraphics::OnGestureRecognized(), and IGraphics::RespondsToGesture().
|
inline |
Get an IRECT from the list (will crash if idx is invalid)
idx | The index to get |
Definition at line 1770 of file IGraphicsStructs.h.
Referenced by Bounds(), IGraphics::Draw(), Find(), Optimize(), and PixelAlign().
|
inlinestatic |
Fill an IRECTList with divisons of an input IRECT.
input | The input rectangle |
rects | The output IRECTList |
rowFractions | Initializer list of fractions for the grid rows (should sum to 1.0) |
colFractions | Initializer list of fractions for the grid columns (should sum to 1.0) |
layoutDir | By default the cell idx increases horizontally (by row). If set to EDirection::Vertical, cell idx increases vertically (by column). |
true
if the row and column fractions summed to 1.0, and grid creation was successful Definition at line 1836 of file IGraphicsStructs.h.
References Add(), Bounds(), IRECT::FracRectHorizontal(), IRECT::FracRectVertical(), IRECT::GetTranslated(), IRECT::H(), IRECT::Intersect(), and IRECT::W().
|
inline |
Remove rects that are contained by other rects and intersections and merge any rects that can be merged.
Definition at line 1898 of file IGraphicsStructs.h.
References IRECT::Contains(), Get(), IRECT::Intersect(), IRECT::Intersects(), IRECT::Mergeable(), Set(), and Size().
Referenced by IGraphics::Draw().
|
inline |
Align the rectangles to pixel boundaries.
Definition at line 1792 of file IGraphicsStructs.h.
References Get(), IRECT::PixelAlign(), Set(), and Size().
Referenced by IGraphics::Draw().
|
inline |
Pixel-align the IRECTs at the given scale factor then scale them back down.
scale | Scale value for the alignment |
Definition at line 1804 of file IGraphicsStructs.h.
References Get(), IRECT::PixelAlign(), Set(), and Size().
|
inline |
Set a specific rectangle in the list (will crash if idx is invalid)
idx | The index to set |
rect | The new IRECT |
Definition at line 1762 of file IGraphicsStructs.h.
Referenced by Optimize(), and PixelAlign().
|
inline |
Definition at line 1750 of file IGraphicsStructs.h.
Referenced by IGraphics::AttachGestureRecognizerToRegion(), IGraphics::Draw(), Find(), Optimize(), PixelAlign(), and IGraphics::RespondsToGesture().