Ipelib

Public Member Functions | List of all members
ipe::Image Class Reference
Ipe Objects

`#include <ipeimage.h>`

Inherits ipe::Object.

## Public Member Functions
| Image (const Rect &rect, Bitmap bitmap)
| Image (const XmlAttributes &attr, String data)
| Image (const XmlAttributes &attr, Bitmap bitmap)
virtual Object * | clone () const override
virtual Image * | asImage () override
virtual Type | type () const override
virtual void | saveAsXml (Stream &stream, String layer) const override
virtual void | draw (Painter &painter) const override
virtual void | drawSimple (Painter &painter) const override
virtual void | accept (Visitor &visitor) const override
virtual double | distance (const Vector &v, const Matrix &m, double bound) const override
virtual void | addToBBox (Rect &box, const Matrix &m, bool) const override
virtual void | snapCtl (const Vector &mouse, const Matrix &m, Vector &pos, double &bound) const override
Rect | rect () const
Bitmap | bitmap () const
virtual bool | setAttribute (Property prop, Attribute value) override
virtual Attribute | getAttribute (Property prop) const noexcept override
void | setOpacity (Attribute opaq)
Attribute | opacity () const
Public Member Functions inherited from ipe::Object
virtual | ~Object ()=0
virtual Group * | asGroup ()
virtual const Group * | asGroup () const
virtual Text * | asText ()
virtual Path * | asPath ()
virtual Reference * | asReference ()
virtual TPinned | pinned () const
void | setPinned (TPinned pin)
TTransformations | transformations () const
void | setTransformations (TTransformations trans)
virtual void | setMatrix (const Matrix &matrix)
const Matrix & | matrix () const
virtual void | snapVtx (const Vector &mouse, const Matrix &m, Vector &pos, double &bound) const
virtual void | snapBnd (const Vector &mouse, const Matrix &m, Vector &pos, double &bound) const
virtual void | checkStyle (const Cascade *sheet, AttributeSeq &seq) const

## Additional Inherited Members
Public Types inherited from ipe::Object
enum | Type { EGroup , EPath , EText , EImage , EReference }
Protected Member Functions inherited from ipe::Object
| Object ()
| Object (const AllAttributes &attr)
| Object (const Object &rhs)
| Object (const XmlAttributes &attr)
void | saveAttributesAsXml (Stream &stream, String layer) const
Static Protected Member Functions inherited from ipe::Object
static void | checkSymbol (Kind kind, Attribute attr, const Cascade *sheet, AttributeSeq &seq)
Protected Attributes inherited from ipe::Object
Matrix | iMatrix
TPinned | iPinned: 8
TTransformations | iTransformations: 8

## Detailed Description

The image object.

## Constructor & Destructor Documentation

## ◆ Image() [1/3]

Image::Image | ( | const Rect & | rect,
|  | Bitmap | bitmap
| ) |  |
| explicit

Create a new image.

References bitmap(), ipe::Bitmap::isNull(), ipe::Attribute::OPAQUE(), and rect().

## ◆ Image() [2/3]

Image::Image | ( | const XmlAttributes & | attr,
|  | String | data
| ) |  |
| explicit

Create from XML stream.

## ◆ Image() [3/3]

Image::Image | ( | const XmlAttributes & | attr,
|  | Bitmap | bitmap
| ) |  |
| explicit

Create from XML stream with given bitmap.

## Member Function Documentation

## ◆ clone()

Object * Image::clone | ( |  | ) | const
| override virtual

Clone object.

Implements ipe::Object.

## ◆ asImage()

Image * Image::asImage | ( |  | ) |
| override virtual

Return pointer to this object.

Reimplemented from ipe::Object.

## ◆ type()

Object::Type Image::type | ( |  | ) | const
| override virtual

Implements ipe::Object.

References ipe::Object::EImage.

## ◆ saveAsXml()

void Image::saveAsXml | ( | Stream & | stream,
|  | String | layer
| ) |  | const
| override virtual

Save image in XML stream.

Implements ipe::Object.

References ipe::Bitmap::objNum(), ipe::Attribute::OPAQUE(), rect(), ipe::Object::saveAttributesAsXml(), and ipe::Attribute::string().

## ◆ draw()

void Image::draw | ( | Painter & | painter | ) | const
| override virtual

Draw image.

Implements ipe::Object.

References ipe::Rect::bottomLeft(), ipe::Painter::drawBitmap(), ipe::Rect::height(), ipe::Object::matrix(), ipe::Painter::pop(), ipe::Painter::popMatrix(), ipe::Painter::push(), ipe::Painter::pushMatrix(), ipe::Painter::setOpacity(), ipe::Painter::transform(), ipe::Object::transformations(), ipe::Painter::untransform(), ipe::Rect::width(), ipe::Vector::x, and ipe::Vector::y.

## ◆ drawSimple()

void Image::drawSimple | ( | Painter & | painter | ) | const
| override virtual

Draw simple version for selecting and transforming.

Implements ipe::Object.

References ipe::Painter::drawPath(), ipe::EStrokedOnly, ipe::Object::matrix(), ipe::Painter::newPath(), ipe::Painter::popMatrix(), ipe::Painter::pushMatrix(), ipe::Painter::rect(), ipe::Painter::transform(), ipe::Object::transformations(), and ipe::Painter::untransform().

## ◆ accept()

void Image::accept | ( | Visitor & | visitor | ) | const
| override virtual

Call VisitImage of visitor.

Implements ipe::Object.

References ipe::Visitor::visitImage().

## ◆ distance()

double Image::distance | ( | const Vector & | v,
|  | const Matrix & | m,
|  | double | bound
| ) |  | const
| override virtual

Return distance of transformed object to point v. If larger than bound, can just return bound.

Implements ipe::Object.

References ipe::Rect::addPoint(), ipe::Rect::bottomLeft(), ipe::Rect::bottomRight(), ipe::Rect::certainClearance(), distance(), ipe::Object::matrix(), ipe::Rect::topLeft(), and ipe::Rect::topRight().

Referenced by distance().

## ◆ addToBBox()

void Image::addToBBox | ( | Rect & | box,
|  | const Matrix & | m,
|  | bool | cp
| ) |  | const
| override virtual

Extend box to include the object transformed by m.

For objects in a page, don't call this directly. The Page caches the bounding box of each object, so it is far more efficient to call Page::bbox.

Control points that lie outside the visual object are included if cp is true.

If called with an empty box and cp == `false`, the result of this function is a tight bounding box for the object, with a little leeway in case the boundary is determined by a spline (it has to be approximated to perform this operation).

Implements ipe::Object.

References ipe::Rect::addPoint(), ipe::Rect::bottomLeft(), ipe::Rect::bottomRight(), ipe::Object::matrix(), ipe::Rect::topLeft(), and ipe::Rect::topRight().

## ◆ snapCtl()

void Image::snapCtl | ( | const Vector & | mouse,
|  | const Matrix & | m,
|  | Vector & | pos,
|  | double & | bound
| ) |  | const
| override virtual

Compute control point snapping position for transformed object.

Looks only for positions closer than bound. If successful, modify pos and bound. The default implementation does nothing.

Reimplemented from ipe::Object.

References ipe::Rect::bottomLeft(), ipe::Rect::bottomRight(), ipe::Object::matrix(), ipe::Rect::topLeft(), and ipe::Rect::topRight().

## ◆ rect()

Rect ipe::Image::rect | ( |  | ) | const
| inline

Return the rectangle occupied by the image on the paper.

The transformation matrix is applied to this, of course.

Referenced by Image(), and saveAsXml().

## ◆ bitmap()

Bitmap ipe::Image::bitmap | ( |  | ) | const
| inline

Return Bitmap of the image.

Referenced by Image(), and ipe::BitmapFinder::visitImage().

## ◆ setAttribute()

bool Image::setAttribute | ( | Property | prop,
|  | Attribute | value
| ) |  |
| override virtual

Set an attribute on this object.

Returns true if an attribute was actually changed.

Reimplemented from ipe::Object.

References ipe::EPropOpacity, opacity(), ipe::Object::setAttribute(), and setOpacity().

## ◆ getAttribute()

Attribute Image::getAttribute | ( | Property | prop | ) | const
| override virtual noexcept

Get setting of an attribute of this object.

If object does not have this attribute, returnes "undefined" attribute.

Reimplemented from ipe::Object.

References ipe::EPropOpacity, and ipe::Object::getAttribute().

## ◆ setOpacity()

void Image::setOpacity | ( | Attribute | opaq | ) |

Set opacity of the object.

Referenced by setAttribute().

## ◆ opacity()

Attribute ipe::Image::opacity | ( |  | ) | const
| inline

Return opacity of the opject.

Referenced by setAttribute().

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

- ipeimage.h
- ipeimage.cpp