44 using namespace utils;
55 ClipRect(
float minx=0,
float maxx=0,
float miny=0,
float maxy=0):
56 minx(minx),maxx(maxx),miny(miny),maxy(maxy){}
61 bool in(
float x,
float y)
const{
62 return ((x >= minx) && (x<= maxx)
63 && (y >= miny) && (y <= maxy));
84 linecolor(255,0,0,255),fillcolor(0,0,0,0),
85 linewidth(1),pointsize(1),symsize(10),
93 return Point32f(state.
T(0,0)*x + state.
T(1,0)*y + state.
T(2,0),
94 state.
T(0,1)*x + state.
T(1,1)*y + state.
T(2,1));
96 inline bool clip(
float x,
float y)
const{
130 angle = acos(state.
T(0,0));
143 stack.push_back(state);
148 state = stack.back();
152 virtual void point(
float x,
float y);
153 virtual void line(
float x0,
float y0,
float x1,
float y1);
154 virtual void triangle(
float x0,
float y0,
float x1,
float y1,
float x2,
float y2);
155 virtual void sym(
char c,
float x,
float y) ;
156 virtual void linestrip(
int n,
const float *xs,
const float *ys,
157 int xStride=1,
int yStride=1,
bool loop=
false);
158 virtual void rect(
float x,
float y,
float w,
float h);
159 virtual void circle(
float cx,
float cy,
float r);
160 virtual void ellipse(
float cx,
float cy,
float rx,
float ry);
161 virtual void image(
const ImgBase *image,
float xanchor,
162 float yanchor,
float alpha,
164 bool centered=
false) ;
165 virtual void text(
const std::string &t,
float x,
float y,
bool centered =
false);
167 virtual void linecolor(
float r,
float g,
float b,
float a=255){
171 virtual void fillcolor(
float r,
float g,
float b,
float a=255){
191 virtual void fontname(
const std::string &fontname){
199 virtual void transform(
float tx,
float ty,
float angle){
201 const float sa = sin(angle), ca = cos(angle);
213 state.
T = Transform::id();
217 transform(0,0,angle);
226 virtual void scale(
float sx,
float sy){
virtual void scale(float s)
Definition: AbstractCanvas.h:222
virtual void linewidth(float width)
Definition: AbstractCanvas.h:175
AbstractCanvas::Color linecolor
Definition: AbstractCanvas.h:73
undocument this line if you encounter any issues!
Definition: Any.h:37
math::FixedColVector< icl8u, 3 > Color
Default color type of the ICL.
Definition: Color.h:42
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
ICLQt_API void triangle(ImgQ &image, int x1, int y1, int x2, int y2, int x3, int y3)
draws a triangle into an image
math::FixedMatrix< float, 3, 3 > Transform
Definition: AbstractCanvas.h:52
float minx
Definition: AbstractCanvas.h:57
ICLQt_API void fontsize(int size)
sets up current fontsize (only available with Qt-Support)
float y
y position of this point
Definition: Point32f.h:48
virtual const Transform & getTransform() const
Definition: AbstractCanvas.h:126
std::string fontname
Definition: AbstractCanvas.h:79
ICLQt_API void text(ImgQ &image, int x, int y, const string &text)
renders a text into an image (only available with Qt-Support)
virtual void fillcolor(float r, float g, float b, float a=255)
Definition: AbstractCanvas.h:171
virtual void fontname(const std::string &fontname)
Definition: AbstractCanvas.h:191
Definition: AbstractCanvas.h:54
float symsize
Definition: AbstractCanvas.h:77
virtual void pointsize(float size)
Definition: AbstractCanvas.h:179
virtual void scale(float sx, float sy)
Definition: AbstractCanvas.h:226
virtual void reset()
resets the transform
Definition: AbstractCanvas.h:212
virtual void transform(const Transform &T)
Definition: AbstractCanvas.h:195
virtual void fontsize(float size)
Definition: AbstractCanvas.h:187
ICLQt_API void line(ImgQ &image, int x1, int y1, int x2, int y2)
draws a line into an image
ClipRect clip
Definition: AbstractCanvas.h:80
utils::Point32f transform(float x, float y) const
Definition: AbstractCanvas.h:92
virtual void rotate(float angle)
Definition: AbstractCanvas.h:216
virtual void getTransform(float &angle, float &tx, float &ty) const
Definition: AbstractCanvas.h:129
Floating point precision implementation of the Rect class.
Definition: Rect32f.h:45
virtual void transform(float tx, float ty, float angle)
Definition: AbstractCanvas.h:199
ICLQt_API void linestrip(ImgQ &image, const std::vector< utils::Point > &pts, bool closeLoop=true)
draws a strip of connected lines
std::vector< State > stack
Definition: AbstractCanvas.h:90
virtual void symsize(float size)
Definition: AbstractCanvas.h:183
AbstractCanvas::Color fillcolor
Definition: AbstractCanvas.h:74
float linewidth
Definition: AbstractCanvas.h:75
bool clip(const Point32f &p) const
Definition: AbstractCanvas.h:99
virtual void pop()
Definition: AbstractCanvas.h:146
bool in(const Point32f &p) const
Definition: AbstractCanvas.h:65
State state
Definition: AbstractCanvas.h:89
virtual void linecolor(float r, float g, float b, float a=255)
Definition: AbstractCanvas.h:167
float maxy
Definition: AbstractCanvas.h:60
float fontsize
Definition: AbstractCanvas.h:78
float miny
Definition: AbstractCanvas.h:59
virtual ~AbstractCanvas()
Definition: AbstractCanvas.h:107
Definition: AbstractCanvas.h:71
AbstractCanvas()
Definition: AbstractCanvas.h:106
AbstractCanvas::Transform T
Definition: AbstractCanvas.h:72
Definition: AbstractCanvas.h:50
scalemode
for scaling of Img images theses functions are provided
Definition: Types.h:84
Single precission 3D Vectors Point class of the ICL.
Definition: Point32f.h:41
core::Color4D32f Color
Definition: AbstractCanvas.h:53
static void scale(const int deg, xcomplex *P)
Definition: PolynomialSolver.h:133
float x
x position of this point
Definition: Point32f.h:45
State()
Definition: AbstractCanvas.h:82
ICLQt_API void circle(ImgQ &image, int x, int y, int r)
renders a filled circle into an image
Base class for Exception handling in the ICL.
Definition: Exception.h:42
virtual void push()
Definition: AbstractCanvas.h:142
ICLQt_API void rect(ImgQ &image, int x, int y, int w, int h, int rounding=0)
draws a rect into an image
virtual Rect32f getClipRect()
Definition: AbstractCanvas.h:136
float maxx
Definition: AbstractCanvas.h:58
bool clip(float x, float y) const
Definition: AbstractCanvas.h:96
float pointsize
Definition: AbstractCanvas.h:76
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
#define ICLASSERT_THROW(X, OBJ)
Definition: Macros.h:155
bool in(float x, float y) const
Definition: AbstractCanvas.h:61
virtual void translate(float tx, float ty)
Definition: AbstractCanvas.h:219
#define ICLCore_API
Definition: CompatMacros.h:174
ClipRect(float minx=0, float maxx=0, float miny=0, float maxy=0)
Definition: AbstractCanvas.h:55