Board  0.9.4
Public Member Functions | List of all members
LibBoard::Image Struct Reference

Structure for a bitmap image shape. More...

#include <Image.h>

Inheritance diagram for LibBoard::Image:
LibBoard::Shape

Public Member Functions

 Image (const char *filename, double left, double top, double width, double height=0.0, int depth=-1)
 
 Image (const char *filename, const Rect &rect, int depth=-1)
 
 ~Image ()
 
const std::string & name () const
 
Imageclone () const
 
Shaperotate (double angle, const Point &center)
 
Shaperotate (double angle)
 
Image rotated (double angle) const
 
Image rotated (double angle, const Point &) const
 
Shapetranslate (double dx, double dy)
 
Image translated (double dx, double dy) const
 
Shapescale (double sx, double sy)
 
Shapescale (double s)
 
Image scaled (double sx, double sy)
 
Rect boundingBox (LineWidthFlag lineWidthFlag) const
 
void scaleAll (double s)
 
void flushPostscript (std::ostream &stream, const TransformEPS &transform) const
 
void flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const
 
void flushSVG (std::ostream &stream, const TransformSVG &transform) const
 
void flushTikZ (std::ostream &stream, const TransformTikZ &transform) const
 
- Public Member Functions inherited from LibBoard::Shape
 Shape (Color penColor, Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join, int depth)
 
virtual ~Shape ()
 
bool filled () const
 
virtual Point center (LineWidthFlag lineWidthFlag=IgnoreLineWidth) const
 
ShaperotateDeg (double angle, const Point &center)
 
ShaperotateDeg (double angle)
 
ShapemoveCenter (double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth)
 
ShapemoveCenter (Point p, LineWidthFlag lineWidthFlag=IgnoreLineWidth)
 
ShapescaleToWidth (double w, LineWidthFlag lineWidthFlag)
 
ShapescaleToHeight (double h, LineWidthFlag lineWidthFlag)
 
Rect bbox (LineWidthFlag) const
 
Shapeoperator-- ()
 
Shapeoperator++ ()
 
int depth () const
 
virtual void depth (int)
 
virtual void shiftDepth (int shift)
 
const ColorpenColor () const
 
const ColorfillColor () const
 
virtual void accept (ShapeVisitor &visitor)
 Accepts a visitor object. More...
 
virtual void accept (const ShapeVisitor &visitor)
 Accepts a visitor object. More...
 

Additional Inherited Members

- Public Types inherited from LibBoard::Shape
enum  LineCap { ButtCap = 0, RoundCap, SquareCap }
 
enum  LineJoin { MiterJoin = 0, RoundJoin, BevelJoin }
 
enum  LineStyle {
  SolidStyle = 0, DashStyle, DotStyle, DashDotStyle,
  DashDotDotStyle, DashDotDotDotStyle
}
 
enum  LineWidthFlag { IgnoreLineWidth, UseLineWidth }
 
- Static Public Member Functions inherited from LibBoard::Shape
static void enableLineWidthScaling ()
 
static void disableLineWidthScaling ()
 
static void setLineWidthScaling (bool)
 
static void setDefaultLineWidth (double)
 
static void setDefaultPenColor (Color)
 
static void setDefaultFillColor (Color)
 
static void setDefaultLineStyle (Shape::LineStyle)
 
static void setDefaultLineCap (Shape::LineCap)
 
static void setDefaultLineJoin (Shape::LineJoin)
 
static double defaultLineWidth ()
 defaultLineWidth More...
 
static Color defaultPenColor ()
 defaultPenColor More...
 
static Color defaultFillColor ()
 defaultFillColor More...
 
static Shape::LineStyle defaultLineStyle ()
 defaultLineStyle More...
 
static Shape::LineCap defaultLineCap ()
 defaultLineCap More...
 
static Shape::LineJoin defaultLineJoin ()
 defaultLineJoin More...
 
- Protected Member Functions inherited from LibBoard::Shape
void updateLineWidth (double s)
 
std::string svgProperties (const TransformSVG &transform) const
 
std::string postscriptProperties (const TransformEPS &transform) const
 
std::string tikzProperties (const TransformTikZ &transform) const
 
- Protected Attributes inherited from LibBoard::Shape
int _depth
 
Color _penColor
 
Color _fillColor
 
double _lineWidth
 
LineStyle _lineStyle
 
LineCap _lineCap
 
LineJoin _lineJoin
 
- Static Protected Attributes inherited from LibBoard::Shape
static bool _lineWidthScaling = true
 
static double _defaultLineWidth = 1.0
 
static Color _defaultPenColor = Color::Black
 
static Color _defaultFillColor = Color::Null
 
static Shape::LineStyle _defaultLineStyle = Shape::SolidStyle
 
static Shape::LineCap _defaultLineCap = Shape::ButtCap
 
static Shape::LineJoin _defaultLineJoin = Shape::MiterJoin
 

Detailed Description

Structure for a bitmap image shape.

Image structure.

Constructor & Destructor Documentation

LibBoard::Image::Image ( const char *  filename,
double  left,
double  top,
double  width,
double  height = 0.0,
int  depth = -1 
)

Construct an Image given a filename, a size and (possibly) a depth. If the height parameter is 0.0, then the correct height is computed according to the actual aspect ratio of the bitmap image, obtained from the file.

Parameters
filename
left
top
width
height
depth

Referenced by clone(), rotated(), scaled(), and translated().

LibBoard::Image::Image ( const char *  filename,
const Rect rect,
int  depth = -1 
)

Construct an Image given a filename, a size and (possibly) a depth.

Parameters
filenameThe image filename
rectThe position and size of the image
depthThe depth (default -1)
LibBoard::Image::~Image ( )
inline

Image destructor.

Member Function Documentation

Rect LibBoard::Image::boundingBox ( LineWidthFlag  lineWidthFlag) const
virtual

Returns the bounding box of the figure.

Parameters
lineWidthFlagShould the line width be considered when computing bounding boxes.
Returns
The rectangle of the bounding box.

Implements LibBoard::Shape.

References LibBoard::Polyline::boundingBox().

Image * LibBoard::Image::clone ( ) const
virtual

Return a copy of the shape.

Returns

Implements LibBoard::Shape.

References Image().

void LibBoard::Image::flushFIG ( std::ostream &  stream,
const TransformFIG transform,
std::map< Color, int > &  colormap 
) const
virtual

Writes the FIG code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.

Implements LibBoard::Shape.

References LibBoard::Shape::_depth, LibBoard::Shape::bbox(), LibBoard::Polyline::boundingBox(), and LibBoard::Rectangle::flushFIG().

void LibBoard::Image::flushPostscript ( std::ostream &  stream,
const TransformEPS transform 
) const
virtual

Writes the EPS code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.

Implements LibBoard::Shape.

References LibBoard::Rect::height, and LibBoard::Rect::width.

void LibBoard::Image::flushSVG ( std::ostream &  stream,
const TransformSVG transform 
) const
virtual

Writes the SVG code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.

Implements LibBoard::Shape.

void LibBoard::Image::flushTikZ ( std::ostream &  stream,
const TransformTikZ transform 
) const
virtual

Writes the TikZ code of the shape in a stream according to a transform.

Parameters
streamThe output stream.
transformA 2D transform to be applied.

Implements LibBoard::Shape.

References LibBoard::Rectangle::flushTikZ().

const std::string & LibBoard::Image::name ( ) const
virtual

Returns the generic name of the shape (Image)

Returns

Reimplemented from LibBoard::Shape.

Shape & LibBoard::Image::rotate ( double  angle,
const Point center 
)
virtual

Rotate the shape around a given center of rotation.

Parameters
angleThe rotation angle in radian.
centerThe center of rotation.
Returns
A reference to the shape itself.

Implements LibBoard::Shape.

References LibBoard::Polyline::rotate().

Shape & LibBoard::Image::rotate ( double  angle)
virtual

Rotate the shape around its center.

Parameters
angleThe rotation angle in radian.
Returns
A reference to the shape itself.

Implements LibBoard::Shape.

References LibBoard::Shape::center(), and LibBoard::Polyline::rotate().

Image LibBoard::Image::rotated ( double  angle) const

Returns a rotated copy of the image.

Parameters
angleThe rotation angle in radian.
Returns
A rotated copy of the image.

References Image().

Image LibBoard::Image::rotated ( double  angle,
const Point center 
) const

Returns a rotated copy of the image.

Parameters
angleThe rotation angle in radian.
centerThe center of rotation.
Returns
A rotated copy of the image.

References Image().

Shape & LibBoard::Image::scale ( double  sx,
double  sy 
)
virtual

Scale the shape along the x an y axis.

Parameters
sxThe scale factor along the x axis.
syThe scale factor along the y axis.
Returns
The shape itself.

Implements LibBoard::Shape.

References LibBoard::Shape::center(), and LibBoard::Polyline::scale().

Referenced by scale().

Shape & LibBoard::Image::scale ( double  s)
virtual

Scale the shape along both axis.

Parameters
sThe scale factor along both axis.
Returns
The shape itself.

Implements LibBoard::Shape.

References scale().

void LibBoard::Image::scaleAll ( double  s)
virtual

Scales all the values (positions, dimensions, etc.) associated with the shape.

Parameters
sThe scaling factor.

Implements LibBoard::Shape.

References LibBoard::Rectangle::scaleAll().

Image LibBoard::Image::scaled ( double  sx,
double  sy 
)

Returns a scaled copy of the image.

Parameters
sxScale factor along the x axis.
syScale factor along the y axis.
Returns
A scaled copy of the image.

References Image().

Shape & LibBoard::Image::translate ( double  dx,
double  dy 
)
virtual

Translate the shape by a given offset.

Parameters
dxThe x offset.
dyThe y offset.
Returns
A reference to the shape itself.

Implements LibBoard::Shape.

References LibBoard::Polyline::translate().

Image LibBoard::Image::translated ( double  dx,
double  dy 
) const

Returns a translated copy of the image.

Parameters
dxThe x offset.
dyThe y offset.
Returns
A translated copy of the image.

References Image().


The documentation for this struct was generated from the following files: