Image Component Library (ICL)
|
Text Texture. More...
#include <Primitive.h>
Public Member Functions | |
ICLGeom_API | TextPrimitive (int a, int b, int c, int d, const std::string &text, int textSize=20, const GeomColor &textColor=GeomColor(255, 255, 255, 255), int na=-1, int nb=-1, int nc=-1, int nd=-1, float billboardHeight=0, core::scalemode sm=core::interpolateLIN) |
constructor More... | |
ICLGeom_API | ~TextPrimitive () |
virtual ICLGeom_API void | render (const Primitive::RenderContext &ctx) |
render method More... | |
virtual Primitive * | copy () const |
deep copy method More... | |
void | updateText (const std::string &newText) |
sets new text More... | |
Public Member Functions inherited from icl::geom::TexturePrimitive | |
TexturePrimitive (int a, int b, int c, int d, const core::ImgBase *image=0, bool createTextureOnce=true, int na=-1, int nb=-1, int nc=-1, int nd=-1, core::scalemode sm=core::interpolateLIN) | |
create with given texture that is either copied once or everytime the primitive is rendered More... | |
TexturePrimitive (int a, int b, int c, int d, const core::Img8u &image, int na=-1, int nb=-1, int nc=-1, int nd=-1, core::scalemode sm=core::interpolateLIN) | |
create with given texture, that is copied once More... | |
Public Member Functions inherited from icl::geom::QuadPrimitive | |
QuadPrimitive (int a, int b, int c, int d, const GeomColor &color, int na=-1, int nb=-1, int nc=-1, int nd=-1, bool trySurfaceOptimization=false, int tesselationResolution=1) | |
constructor More... | |
int | i (int idx) const |
direct access to the i-th vertex/normal index More... | |
ICLGeom_API Vec | computeNormal (const std::vector< Vec > &vertices) const |
computes the normal for this quad More... | |
Public Member Functions inherited from icl::math::FixedColVector< int, 8 > | |
FixedColVector () | |
FixedColVector (const int &init) | |
FixedColVector (const int *srcData) | |
FixedColVector (const FixedMatrix< int, 1, DIM > &other) | |
FixedColVector (const int &v0, const int &v1, const int &v2=0, const int &v3=0, const int &v4=0, const int &v5=0, const int &v6=0, const int &v7=0, const int &v8=0, const int &v9=0, const int &v10=0, const int &v11=0) | |
FixedColVector (const FixedMatrixPart< int, DIM, Iterator > &r) | |
FixedColVector (const FixedMatrixPart< otherT, DIM, Iterator > &r) | |
Public Member Functions inherited from icl::math::FixedMatrix< int, 1, DIM > | |
DynMatrix< int > | dyn () |
creates a shallow copied DynMatrix instance wrapping this' data More... | |
const DynMatrix< int > | dyn () const |
creates a shallow copied DynMatrix instance wrapping this' data (const) More... | |
FixedMatrix () | |
Default constructor. More... | |
FixedMatrix (const int &initValue) | |
Create Matrix and initialize elements with given value. More... | |
FixedMatrix (const int *srcdata) | |
Create matrix with given data pointer (const version) More... | |
FixedMatrix (const int &v0, const int &v1, const int &v2=0, const int &v3=0, const int &v4=0, const int &v5=0, const int &v6=0, const int &v7=0, const int &v8=0, const int &v9=0, const int &v10=0, const int &v11=0, const int &v12=0, const int &v13=0, const int &v14=0, const int &v15=0) | |
Create matrix with given initializer elements (16 values max) More... | |
FixedMatrix (OtherIterator begin, OtherIterator end) | |
Range based constructor for STL compatiblitiy. More... | |
FixedMatrix (const FixedMatrix &other) | |
FixedMatrix (const FixedMatrix< otherT, COLS, ROWS > &other) | |
FixedMatrix (const FixedMatrixPart< int, DIM, Iterator > &r) | |
Create matrix of a sub-part of another matrix (identical types) More... | |
FixedMatrix (const FixedMatrixPart< otherT, DIM, Iterator > &r) | |
Create matrix of a sub-part of another matrix (compatible types) More... | |
FixedMatrix & | operator= (const FixedMatrix &other) |
Assignment operator (with compatible data type) (deep copy) More... | |
FixedMatrix & | operator= (const FixedMatrix< otherT, COLS, ROWS > &other) |
Assignment operator (with compatible data type) (deep copy) More... | |
FixedMatrix & | operator= (const int &t) |
Assign all elements with given value. More... | |
FixedMatrix & | operator= (const FixedMatrixPart< int, DIM, Iterator > &r) |
Assign matrix elements with sup-part of another matrix (identical types) More... | |
FixedMatrix & | operator= (const FixedMatrixPart< otherT, DIM, Iterator > &r) |
Assign matrix elements with sup-part of another matrix (compatible types) More... | |
FixedMatrix | operator/ (const FixedMatrix &m) const |
Matrix devision. More... | |
FixedMatrix | operator/ (int f) const |
Divide all elements by a scalar. More... | |
FixedMatrix & | operator/= (const FixedMatrix &m) |
Matrix devision (inplace) More... | |
FixedMatrix & | operator/= (int f) |
Divide all elements by a scalar. More... | |
FixedMatrix | operator * (int f) const |
Multiply all elements by a scalar. More... | |
FixedMatrix< int, MCOLS, ROWS > | operator * (const FixedMatrix< int, MCOLS, COLS > &m) const |
Matrix multiplication (essential) More... | |
FixedMatrix & | operator *= (int f) |
moved outside the class Multiply all elements by a scalar (inplace) More... | |
FixedMatrix | operator+ (const int &t) const |
Add a scalar to each element. More... | |
FixedMatrix | operator+ (const FixedMatrix &m) const |
Element-wise matrix addition. More... | |
FixedMatrix & | operator+= (const int &t) |
Add a scalar to each element (inplace) More... | |
FixedMatrix & | operator+= (const FixedMatrix &m) |
Element-wise matrix addition (inplace) More... | |
FixedMatrix | operator- (const int &t) const |
Substract a scalar from each element. More... | |
FixedMatrix | operator- (const FixedMatrix &m) const |
Element-wise matrix subtraction. More... | |
FixedMatrix | operator- () const |
Prefix - operator. More... | |
FixedMatrix & | operator-= (const int &t) |
Substract a scalar from each element (inplace) More... | |
FixedMatrix & | operator-= (const FixedMatrix &m) |
Element-wise matrix subtraction (inplace) More... | |
int & | operator() (unsigned int col, unsigned int row) |
Element access operator. More... | |
const int & | operator() (unsigned int col, unsigned int row) const |
Element access operator (const) More... | |
int & | at (unsigned int col, unsigned int row) |
Element access index save (with exception if index is invalid) More... | |
const int & | at (unsigned int col, unsigned int row) const |
Element access index save (with exception if index is invalid) (const) More... | |
int & | operator[] (unsigned int idx) |
linear data view element access More... | |
const int & | operator[] (unsigned int idx) const |
linear data view element access (const) More... | |
int * | data () |
return internal data pointer More... | |
const int * | data () const |
return internal data pointer (const) More... | |
iterator | begin () |
returns an iterator to first element iterating over each element (row-major order) More... | |
const_iterator | begin () const |
returns an iterator to first element iterating over each element (row-major order) (const) More... | |
iterator | end () |
returns an iterator after the last element More... | |
const_iterator | end () const |
returns an iterator after the last element (const) More... | |
col_iterator | col_begin (unsigned int col) |
returns an iterator iterating over a certain column More... | |
const_col_iterator | col_begin (unsigned int col) const |
returns an iterator iterating over a certain column (const) More... | |
col_iterator | col_end (unsigned int col) |
row end iterator More... | |
const_col_iterator | col_end (unsigned int col) const |
row end iterator const More... | |
row_iterator | row_begin (unsigned int row) |
returns an iterator iterating over a certain row More... | |
const_row_iterator | row_begin (unsigned int row) const |
returns an iterator iterating over a certain row (const) More... | |
row_iterator | row_end (unsigned int row) |
row end iterator More... | |
const_row_iterator | row_end (unsigned int row) const |
row end iterator (const) More... | |
void | mult (const FixedMatrix< int, MCOLS, COLS > &m, FixedMatrix< int, MCOLS, ROWS > &dst) const |
inplace matrix multiplication (dst = (*this)*m) More... | |
FixedMatrix | inv () const |
invert the matrix (only implemented with IPP_OPTIMIZATION and only for icl32f and icl64f) More... | |
int | det () const |
calculate matrix determinant (only implemented with IPP_OPTIMIZATION and only for icl32f and icl64f) More... | |
FixedMatrix< int, ROWS, COLS > | transp () const |
returns matrix's transposed More... | |
int | element_wise_inner_product (const FixedMatrix< int, OTHER_COLS, DIM/OTHER_COLS > &other) const |
inner product of data pointers (not matrix-mulitiplication) More... | |
FixedMatrix< int, OTHER_COLS, COLS > | dot (const FixedMatrix< int, OTHER_COLS, ROWS > &M) const |
returns the inner product of two matrices (i.e. dot-product) More... | |
double | cond (const double p=2) const |
computes the condition of a fixed matrix More... | |
int | trace () const |
computes the sum of all diagonal elements More... | |
FixedMatrixPart< int, COLS, row_iterator > | row (unsigned int idx) |
returns a matrix row-reference iterator pair More... | |
FixedMatrixPart< int, COLS, const_row_iterator > | row (unsigned int idx) const |
returns a matrix row-reference iterator pair (const) More... | |
FixedMatrixPart< int, ROWS, col_iterator > | col (unsigned int idx) |
returns a matrix col-reference iterator pair More... | |
FixedMatrixPart< int, ROWS, const_col_iterator > | col (unsigned int idx) const |
returns a matrix col-reference iterator pair (const) More... | |
FixedMatrixPart< int, WIDTH *HEIGHT, MatrixSubRectIterator< int > > | part () |
extracts a rectangular matrix sub region More... | |
const FixedMatrixPart< int, WIDTH *HEIGHT, MatrixSubRectIterator< int > > | part () const |
extracts a rectangular matrix sub region (const) More... | |
FixedMatrix< int, NEW_WIDTH, NEW_HEIGHT > | resize (const int &init=int(0)) const |
extends/shrinks matrix dimensions while preserving content on remaining elements (without scaling) More... | |
double | length (int norm=2) const |
Calculates the length of the matrix data vector. More... | |
void | normalize (int norm=2) |
inplace normalization More... | |
FixedMatrix< int, COLS, ROWS > | normalized (int norm=2) const |
create a normalized version of this matrix More... | |
bool | operator== (const FixedMatrix< otherT, COLS, ROWS > &m) const |
Element-wise comparison with other matrix. More... | |
bool | operator!= (const FixedMatrix< otherT, COLS, ROWS > &m) const |
Element-wise comparison with other matrix. More... | |
FixedMatrix< int, 1, ROWS > | diag () const |
returns a vector of the diagonal elements (only for squared matrices) More... | |
void | decompose_QR (FixedMatrix< int, COLS, ROWS > &Q, FixedMatrix< int, COLS, COLS > &R) const |
computes the QR decomposition of a matrix More... | |
void | decompose_RQ (FixedMatrix< int, ROWS, ROWS > &R, FixedMatrix< int, ROWS, ROWS > &Q) const |
computes the RQ decomposition of a matrix More... | |
void | svd (FixedMatrix< int, COLS, ROWS > &U, FixedMatrix< int, 1, COLS > &s, FixedMatrix< int, COLS, COLS > &V) const |
computes Singular Value Decomposition of this Matrix A = U diag(s) V' More... | |
FixedMatrix< int, ROWS, COLS > | pinv (bool useSVD=0, float zeroThreshold=0.00000000000000001) const |
Computes the Matrix's pseudo-inverse. More... | |
void | eigen (FixedMatrix &eigenvectors, FixedMatrix< int, 1, COLS > &eigenvalues) const |
Extracts the matrix's eigenvalues and eigenvectors. More... | |
Public Member Functions inherited from icl::utils::FixedArray< int, COLS *ROWS > | |
int & | operator[] (unsigned int idx) |
index access operator More... | |
const int & | operator[] (unsigned int idx) const |
index access operator (const) More... | |
Public Member Functions inherited from icl::geom::Primitive | |
Primitive (Type type=nothing, const GeomColor &color=GeomColor(255, 255, 255, 255)) | |
Default constructor. More... | |
virtual | ~Primitive () |
virtual, but empty destructor More... | |
Public Member Functions inherited from icl::geom::AlphaFuncProperty | |
ICLGeom_API | AlphaFuncProperty () |
base constructor setting up to GL_GREATER 0.1 More... | |
AlphaFuncProperty (int alphaFunc, float alphaValue) | |
void | setAlphaFunc (int func, float value) |
used for setting up the alpha func, that is used to render this texture primitive More... | |
ICLGeom_API void | restoreAlphaDefaults () |
Static Public Member Functions | |
static ICLGeom_API core::Img8u | create_texture (const std::string &text, const GeomColor &color, int textSize) |
utility method to creat a text texture More... | |
Static Public Member Functions inherited from icl::math::FixedMatrix< int, 1, DIM > | |
static const FixedMatrix & | null () |
returning a reference to a null matrix More... | |
static unsigned int | rows () |
compatibility-function returns template parameter ROWS More... | |
static unsigned int | cols () |
compatibility-function returns template parameter COLS More... | |
static unsigned int | dim () |
return static member variable DIM (COLS*ROWS) More... | |
static FixedMatrix< int, ROWS, COLS > | id () |
create identity matrix More... | |
Static Public Member Functions inherited from icl::math::FixedMatrixBase | |
template<class SrcIterator , class DstIterator , unsigned int N> | |
static void | optimized_copy (SrcIterator srcBegin, SrcIterator srcEnd, DstIterator dstBegin) |
Optimized copy function template (for N>30 using std::copy, otherwise a simple loop is used) More... | |
Public Attributes | |
int | textSize |
internal memory for the text size More... | |
GeomColor | textColor |
internal memory for the text color More... | |
float | billboardHeight |
used for billboard text More... | |
Public Attributes inherited from icl::geom::TexturePrimitive | |
qt::GLImg | texture |
< internal texture More... | |
const core::ImgBase * | image |
< set if the texture shall be updated every time it is drawn More... | |
Public Attributes inherited from icl::geom::QuadPrimitive | |
bool | trySurfaceOptimization |
visualization optimization flag More... | |
int | tesselationResolution |
number of sub-quads to render for better lighting More... | |
Public Attributes inherited from icl::utils::FixedArray< int, COLS *ROWS > | |
int | m_data [DIM] |
Public Attributes inherited from icl::geom::Primitive | |
Type | type |
the primitive type More... | |
GeomColor | color |
the color of this primitive More... | |
Public Attributes inherited from icl::geom::AlphaFuncProperty | |
int | alphaFunc |
< used for glAlphaFunc call glAlphaFunc((GLenum)alphaFunc,alphaValue) More... | |
float | alphaValue |
< used for glAlphaFunc call glAlphaFunc((GLenum)alphaFunc,alphaValue) More... | |
Additional Inherited Members | |
Public Types inherited from icl::geom::QuadPrimitive | |
typedef math::FixedColVector< int, 8 > | super |
super type More... | |
Public Types inherited from icl::math::FixedColVector< int, 8 > | |
typedef FixedMatrix< int, 1, DIM > | super |
Public Types inherited from icl::math::FixedMatrix< int, 1, DIM > | |
typedef int * | iterator |
iterator type More... | |
typedef const int * | const_iterator |
const iterator type More... | |
typedef int * | row_iterator |
row_iterator More... | |
typedef const int * | const_row_iterator |
const row_iterator More... | |
typedef const col_iterator | const_col_iterator |
Public Types inherited from icl::geom::Primitive | |
enum | Type { vertex = 1<<0, line = 1<<1, triangle = 1<<2, quad = 1<<3, polygon = 1<<4, texture = 1<<5, text = 1<<6, nothing = 1<<7, custom = 1<<20, PRIMITIVE_TYPE_COUNT = 8, all = (1<<PRIMITIVE_TYPE_COUNT)-1, faces = triangle | quad | polygon | texture | text } |
primitive type for dynamic handling of different primitives More... | |
Static Public Attributes inherited from icl::math::FixedMatrix< int, 1, DIM > | |
static const unsigned int | DIM |
count of matrix elements (COLS x ROWS) More... | |
Text Texture.
The text texture is implemented by a static common texture
ICLGeom_API icl::geom::TextPrimitive::TextPrimitive | ( | int | a, |
int | b, | ||
int | c, | ||
int | d, | ||
const std::string & | text, | ||
int | textSize = 20 , |
||
const GeomColor & | textColor = GeomColor(255, 255, 255, 255) , |
||
int | na = -1 , |
||
int | nb = -1 , |
||
int | nc = -1 , |
||
int | nd = -1 , |
||
float | billboardHeight = 0 , |
||
core::scalemode | sm = core::interpolateLIN |
||
) |
constructor
ICLGeom_API icl::geom::TextPrimitive::~TextPrimitive | ( | ) |
|
inlinevirtual |
deep copy method
Reimplemented from icl::geom::TexturePrimitive.
|
static |
utility method to creat a text texture
|
virtual |
render method
Reimplemented from icl::geom::TexturePrimitive.
|
inline |
sets new text
float icl::geom::TextPrimitive::billboardHeight |
used for billboard text
if the value is > 0, the text-texture will always be oriented towards the camera. the billboardHeight value is used as text-height (in scene units)
GeomColor icl::geom::TextPrimitive::textColor |
internal memory for the text color
int icl::geom::TextPrimitive::textSize |
internal memory for the text size