Clipping quad. More...
#include <kanzi/node/clip_quad.hpp>
Public Member Functions | |
ClipQuad () | |
Empty constructor. More... | |
ClipQuad (float offsetX, float offsetY, float sizeX, float sizeY) | |
Constructor for coordinates only, individual values. More... | |
ClipQuad (Vector2 offset, Vector2 size) | |
Constructor for coordinates only. More... | |
ClipQuad (float offsetX, float offsetY, float sizeX, float sizeY, float texOffsetX, float texOffsetY, float tesxSizeX, float texSizeY) | |
Constructor with individual values. More... | |
ClipQuad (Vector2 offset, Vector2 size, Vector2 texOffset, Vector2 texSize) | |
Constructor for coordinates only. More... | |
void | set (float offsetX, float offsetY, float sizeX, float sizeY) |
Set content. More... | |
void | set (Vector2 offset, Vector2 size) |
Set content. More... | |
void | set (float offsetX, float offsetY, float sizeX, float sizeY, float texOffsetX, float texOffsetY, float tesxSizeX, float texSizeY) |
Set content. More... | |
void | set (Vector2 offset, Vector2 size, Vector2 texOffset, Vector2 texSize) |
Set content. More... | |
unsigned int | clipBottom (float border) |
Clip from bottom side. More... | |
unsigned int | clipLeft (float border) |
Clip from left side. More... | |
unsigned int | clipRight (float border) |
Clip from right side. More... | |
unsigned int | clipTop (float border) |
Clip from top side. More... | |
void | refresh () |
Recalculate data buffer for sending this brush to the GPU. More... | |
void | substract (const ClipQuad &other, unsigned int mask) |
Intersect with another clip quad. More... | |
void | tile (Vector2 tiling) |
Tile the quad. More... | |
Vector2 | getOffset () const |
Get quad offset. More... | |
Vector2 | getSize () const |
Get quad size. More... | |
Vector2 | getTextureOffset () const |
Get texture size. More... | |
Vector2 | getTextureSize () const |
Get texture size. More... | |
const float * | getVertexData () const |
Get vertex data. More... | |
const float * | getTexcoordData () const |
Get texcoord data. More... | |
size_t | getVertexCount () const |
Get vertex count. More... | |
Protected Member Functions | |
void | assignVertex (size_t index, float x, float y, float s, float t) |
Assign a vertex. More... | |
Clipping quad.
|
inline |
Empty constructor.
|
inline |
Constructor for coordinates only, individual values.
offsetX | X offset. |
offsetY | Y offset. |
sizeX | X size. |
sizeY | Y size. |
Constructor for coordinates only.
offset | Offset. |
size | Size. |
|
inline |
Constructor with individual values.
offsetX | X offset. |
offsetY | Y offset. |
sizeX | X size. |
sizeY | Y size. |
texOffsetX | X offset. |
texOffsetY | Y offset. |
texSizeX | X size. |
texSizeY | Y size. |
|
inline |
Set content.
offsetX | X offset. |
offsetY | Y offset. |
sizeX | X size. |
sizeY | Y size. |
Set content.
offset | Offset. |
size | Size. |
|
inline |
Set content.
offsetX | X offset. |
offsetY | Y offset. |
sizeX | X size. |
sizeY | Y size. |
texOffsetX | X offset. |
texOffsetY | Y offset. |
texSizeX | X size. |
texSizeY | Y size. |
unsigned int kanzi::ClipQuad::clipBottom | ( | float | border | ) |
Clip from bottom side.
border | Border to clip to. |
unsigned int kanzi::ClipQuad::clipLeft | ( | float | border | ) |
Clip from left side.
border | Border to clip to. |
unsigned int kanzi::ClipQuad::clipRight | ( | float | border | ) |
Clip from right side.
border | Border to clip to. |
unsigned int kanzi::ClipQuad::clipTop | ( | float | border | ) |
Clip from top side.
border | Border to clip to. |
void kanzi::ClipQuad::refresh | ( | ) |
Recalculate data buffer for sending this brush to the GPU.
void kanzi::ClipQuad::substract | ( | const ClipQuad & | other, |
unsigned int | mask | ||
) |
Intersect with another clip quad.
The other quad must be smaller or equal in size to this quad, i.e. it must have gone through the same clipping process. Otherwise results are undefined. Will write the coordinate buffer as a triangle strip and prepare the buffer as side effect.
other | Other quad to intersect with. |
mask | Mask signifying areas in this quad that exist in regard to the other quad. |
void kanzi::ClipQuad::tile | ( | Vector2 | tiling | ) |
Tile the quad.
Will alter texture coordinates to accomodate tiling.
tiling | Tiling vector. |
|
inline |
Get quad offset.
|
inline |
Get quad size.
|
inline |
Get texture size.
|
inline |
Get texture size.
|
inline |
Get vertex data.
|
inline |
Get texcoord data.
|
inline |
Get vertex count.
|
inlineprotected |
Assign a vertex.
To be used internally in functions that write vertices into the vertex buffer.
count | Total number of elements at end. |
index | Current index. |
x | X coordinate. |
y | Y coordinate. |
s | S texture coordinate. |
t | T texture coordinate. |