Board  0.9.4
Image.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
25 #ifndef _BOARD_IMAGE_H_
26 #define _BOARD_IMAGE_H_
27 
28 #include "board/Shapes.h"
29 #include "board/TransformMatrix.h"
30 #include <string>
31 
32 namespace LibBoard {
33 
39 struct Image : public Shape {
40 
56  Image( const char * filename,
57  double left, double top, double width, double height = 0.0,
58  int depth = -1 );
59 
69  Image( const char * filename, const Rect & rect, int depth = -1 );
70 
74  inline ~Image();
75 
81  const std::string & name() const;
82 
88  Image * clone() const;
89 
98  Shape & rotate( double angle, const Point & center );
99 
107  Shape & rotate( double angle );
108 
116  Image rotated(double angle) const;
117 
126  Image rotated(double angle, const Point & ) const;
127 
136  Shape & translate( double dx, double dy );
137 
146  Image translated(double dx, double dy) const;
147 
156  Shape & scale( double sx, double sy );
157 
165  Shape & scale( double s );
166 
175  Image scaled(double sx, double sy);
176 
183  Rect boundingBox(LineWidthFlag lineWidthFlag) const;
184 
191  void scaleAll( double s );
192 
200  void flushPostscript( std::ostream & stream,
201  const TransformEPS & transform ) const;
202 
210  void flushFIG( std::ostream & stream,
211  const TransformFIG & transform,
212  std::map<Color,int> & colormap ) const;
213 
221  void flushSVG( std::ostream & stream,
222  const TransformSVG & transform ) const;
223 
231  void flushTikZ( std::ostream & stream,
232  const TransformTikZ & transform ) const;
233 
234 private:
235  static const std::string _name;
236  Rectangle _rectangle;
237  Rectangle _originalRectangle;
238  TransformMatrix _transformMatrixSVG;
239  TransformMatrix _transformMatrixEPS;
240  std::string _filename;
241 };
242 
244 {}
245 
246 
247 } // namespace LibBoard
248 
249 #endif /* _SHAPE_H_ */
250 
Abstract structure for a 2D shape.
Definition: Shapes.h:62
Definition: TransformMatrix.h:35
Structure representing a scaling and translation suitable for an TikZ output.
Definition: Transforms.h:137
Definition: Board.h:41
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const
Definition: Image.cpp:214
Shape & scale(double sx, double sy)
Definition: Image.cpp:134
Rect boundingBox(LineWidthFlag lineWidthFlag) const
Definition: Image.cpp:163
Image translated(double dx, double dy) const
Definition: Image.cpp:128
Struct representing a 2D point.
Definition: Point.h:39
Structure representing a scaling and translation suitable for an XFig output.
Definition: Transforms.h:93
void flushSVG(std::ostream &stream, const TransformSVG &transform) const
Definition: Image.cpp:232
Structure representing a scaling and translation suitable for an SVG output.
Definition: Transforms.h:116
Shape & rotate(double angle, const Point &center)
Definition: Image.cpp:89
Structure for a bitmap image shape.
Definition: Image.h:39
void scaleAll(double s)
Definition: Image.cpp:169
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const
Definition: Image.cpp:258
Image * clone() const
Definition: Image.cpp:83
Image scaled(double sx, double sy)
Definition: Image.cpp:157
A rectangle.
Definition: Shapes.h:1080
Image(const char *filename, double left, double top, double width, double height=0.0, int depth=-1)
Definition: Image.cpp:43
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
~Image()
Definition: Image.h:243
Shape & translate(double dx, double dy)
Definition: Image.cpp:119
const std::string & name() const
Definition: Image.cpp:77
Structure representing a scaling and translation suitable for an EPS output.
Definition: Transforms.h:73
Image rotated(double angle) const
Definition: Image.cpp:108
virtual Point center(LineWidthFlag lineWidthFlag=IgnoreLineWidth) const
Definition: Shapes.cpp:101
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
Struct representing a rectangle on the plane.
Definition: Rect.h:38
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const
Definition: Image.cpp:177