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

#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 Objectclone () const override
 
virtual ImageasImage () 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 GroupasGroup ()
 
virtual const GroupasGroup () const
 
virtual TextasText ()
 
virtual PathasPath ()
 
virtual ReferenceasReference ()
 
virtual TPinned pinned () const
 
void setPinned (TPinned pin)
 
TTransformations transformations () const
 
void setTransformations (TTransformations trans)
 
virtual void setMatrix (const Matrix &matrix)
 
const Matrixmatrix () 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().

Referenced by clone().

◆ 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
overridevirtual

Clone object.

Implements ipe::Object.

References Image().

◆ asImage()

Image * Image::asImage ( )
overridevirtual

Return pointer to this object.

Reimplemented from ipe::Object.

◆ type()

Object::Type Image::type ( ) const
overridevirtual

Implements ipe::Object.

References ipe::Object::EImage.

◆ saveAsXml()

void Image::saveAsXml ( Stream stream,
String  layer 
) const
overridevirtual

◆ draw()

void Image::draw ( Painter painter) const
overridevirtual

◆ drawSimple()

void Image::drawSimple ( Painter painter) const
overridevirtual

◆ accept()

void Image::accept ( Visitor visitor) const
overridevirtual

Call VisitImage of visitor.

Implements ipe::Object.

References ipe::Visitor::visitImage().

◆ distance()

double Image::distance ( const Vector v,
const Matrix m,
double  bound 
) const
overridevirtual

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(), ipe::Object::matrix(), ipe::Rect::topLeft(), and ipe::Rect::topRight().

◆ addToBBox()

void Image::addToBBox ( Rect box,
const Matrix m,
bool  cp 
) const
overridevirtual

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
overridevirtual

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

 
virtual Attribute getAttribute (

Referenced by Rect ipe::Image::rect ( Bitmap inline

&tr class="separator:a87b7c4a9ced4bd7c536a841d00aa564d inherit pro_methods_classipe_1_1_objectbsp;snapCtl()

Canvas::magnify(),

left">
int ipe::CurveSegment::countCP ( ) const
ipe::Object.

References snapCtlpan class="permalink">Canvas::magnify(), ( ) const inline opacity () const

ipe::FileSource Member List

This is the complete list of members for ipe::FileSource, including all inherited members.

FileSource(std::FILE *file)explici href="classipe_1_1_pdf_writer.html#ae12fa3cc5b03c2387ss="memname">
( ) const
◆ saveRGB()f68716 inherit pub_methods_clasan="2">  virtual void