Ipelib: ipe::Image Class Reference

Ipelib

- Main Page
- Modules
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# ipe::Image Class Reference
Ipe Objects

The image object. More...

`#include <ipeimage.h>`

Inherits ipe::Object.

List of all members.

## 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
- virtual Image * asImage ()
- virtual Type type () const
- virtual void saveAsXml (Stream &stream, String layer) const
- virtual void draw (Painter &painter) const
- virtual void drawSimple (Painter &painter) const
- virtual void accept (Visitor &visitor) const
- virtual double distance (const Vector &v, const Matrix &m, double bound) const
- virtual void addToBBox (Rect &box, const Matrix &m, bool) const
- virtual void snapVtx (const Vector &mouse, const Matrix &m, Vector &pos, double &bound) const
- Rect rect () const
- Bitmap bitmap () const

## Detailed Description

The image object.

## Constructor & Destructor Documentation

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

Create a new image.

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

Create from XML stream.

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

Create from XML stream with given bitmap.

## Member Function Documentation

Object * Image::clone | ( |  | ) | const`[virtual]`

Clone object.

Implements ipe::Object.

Image * Image::asImage | ( |  | ) | `[virtual]`

Return pointer to this object.

Reimplemented from ipe::Object.

Object::Type Image::type | ( |  | ) | const`[virtual]`

Implements ipe::Object.

void Image::saveAsXml | ( | Stream & | stream,
|  | String | layer
| ) |  | const`[virtual]`

Save image in XML stream.

Implements ipe::Object.

void Image::draw | ( | Painter & | painter | ) | const`[virtual]`

Draw image.

Implements ipe::Object.

void Image::drawSimple | ( | Painter & | painter | ) | const`[virtual]`

Draw simple version for selecting and transforming.

Implements ipe::Object.

void Image::accept | ( | Visitor & | visitor | ) | const`[virtual]`

Call VisitImage of visitor.

Implements ipe::Object.

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

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

Implements ipe::Object.

void Image::addToBBox | ( | Rect & | box,
|  | const Matrix & | m,
|  | bool | cp
| ) |  | const`[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.

void Image::snapVtx | ( | const Vector & | mouse,
|  | const Matrix & | m,
|  | Vector & | pos,
|  | double & | bound
| ) |  | const`[virtual]`

Compute possible vertex snapping position for transformed object.

Looks only for positions closer than bound. If successful, modify pos and bound.

Implements ipe::Object.

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.

Bitmap ipe::Image::bitmap | ( |  | ) | const`[inline]`

Return Bitmap of the image.

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

- ipeimage.h
- ipeimage.cpp