|
Krita Source Code Documentation
|
The KisReferenceImage class represents a single reference image. More...
#include <KisReferenceImage.h>
Inheritance diagram for KisReferenceImage:Classes | |
| struct | Private |
| struct | SetSaturationCommand |
Public Member Functions | |
| KoShape * | cloneShape () const override |
| creates a deep copy of the shape or shape's subtree | |
| bool | embed () |
| QString | filename () const |
| QImage | getImage () |
| QColor | getPixel (QPointF position) |
| bool | hasLocalFile () |
| QString | internalFile () const |
| KisReferenceImage () | |
| KisReferenceImage (const KisReferenceImage &rhs) | |
| bool | loadImage (KoStore *store) |
| void | paint (QPainter &gc) const override |
Paint the shape fill The class extending this one is responsible for painting itself. painter is expected to be preconfigured to work in "document" pixels. | |
| qreal | saturation () const |
| bool | saveImage (KoStore *store) const |
| void | saveXml (QDomDocument &document, QDomElement &parentElement, int id) |
| void | setEmbed (bool embed) |
| void | setFilename (const QString &filename) |
| void | setSaturation (qreal saturation) |
| ~KisReferenceImage () | |
Public Member Functions inherited from KoShape | |
| QRectF | absoluteOutlineRect () const |
| QPointF | absolutePosition (KoFlake::AnchorPosition anchor=KoFlake::Center) const |
| QTransform | absoluteTransformation () const |
| bool | addDependee (KoShape *shape) |
| QString | additionalAttribute (const QString &name) const |
| void | addShapeChangeListener (ShapeChangeListener *listener) |
| KoShapeAnchor * | anchor () const |
| void | applyAbsoluteTransformation (const QTransform &matrix) |
| void | applyTransformation (const QTransform &matrix) |
| virtual QSharedPointer< KoShapeBackground > | background () const |
| virtual QRectF | boundingRect () const |
| Get the bounding box of the shape. | |
| virtual ChildZOrderPolicy | childZOrderPolicy () |
| KoClipMask * | clipMask () const |
| Returns the currently set clip mask or 0 if there is no clip mask set. | |
| KoClipPath * | clipPath () const |
| Returns the currently set clip path or 0 if there is no clip path set. | |
| KoShape * | cloneShapeAndBakeAbsoluteTransform () const |
creates a deep copy of the shape/shapes tree and bakes the absolute transform of this into the resulting shape. | |
| void | copySettings (const KoShape *shape) |
| QList< KoShape * > | dependees () const |
| Returns list of shapes depending on this shape. | |
| QPointF | documentToShape (const QPointF &point) const |
| Transforms point from document coordinates to shape coordinates. | |
| QRectF | documentToShape (const QRectF &rect) const |
| Transform rect from document coordinates to shape coordinates. | |
| bool | hasAdditionalAttribute (const QString &name) const |
| bool | hasCommonParent (const KoShape *shape) const |
| bool | hasDependee (KoShape *shape) const |
| Returns if the given shape is dependent on this shape. | |
| virtual bool | hasTransparency () const |
| virtual bool | hitTest (const QPointF &position) const |
| Check if the shape is hit on position. | |
| QString | hyperLink () const |
| bool | inheritBackground () const |
| inheritBackground shows if the shape inherits background from its parent | |
| bool | inheritPaintOrder () const |
| inheritPaintOrder | |
| bool | inheritsTransformFromAny (const QList< KoShape * > ancestorsInQuestion) const |
inheritsTransformFromAny checks if the shape inherits transformation from any of the shapes listed in ancestorsInQuestion. The inheritance is checked in recursive way. | |
| bool | inheritStroke () const |
| inheritStroke shows if the shape inherits the stroke from its parent | |
| bool | isContentProtected () const |
| bool | isGeometryProtected () const |
| bool | isPrintable () const |
| bool | isSelectable () const |
| virtual bool | isShapeEditable (bool recursive=true) const |
| checks recursively if the shape or one of its parents is not visible or locked | |
| bool | isVisible (bool recursive=true) const |
| bool | keepAspectRatio () const |
| KoShape () | |
| Constructor. | |
| qreal | minimumHeight () const |
| QString | name () const |
| void | notifyChanged () |
| virtual QPainterPath | outline () const |
| virtual QRectF | outlineRect () const |
| virtual void | paintMarkers (QPainter &painter) const |
| paintStroke paints the shape's markers | |
| virtual QVector< PaintOrder > | paintOrder () const |
| paintOrder | |
| virtual void | paintStroke (QPainter &painter) const |
| paintStroke paints the shape's stroked outline | |
| KoShapeContainer * | parent () const |
| QPointF | position () const |
| Get the position of the shape in pt. | |
| void | removeAdditionalAttribute (const QString &name) |
| void | removeAdditionalStyleAttribute (const char *name) |
| void | removeDependee (KoShape *shape) |
| void | removeShapeChangeListener (ShapeChangeListener *listener) |
| void | rotate (qreal angle) |
| Rotate the shape (relative) | |
| qreal | rotation () const |
| void | scale (qreal sx, qreal sy) |
| Scale the shape using the zero-point which is the top-left corner. | |
| void | setAbsolutePosition (const QPointF &newPosition, KoFlake::AnchorPosition anchor=KoFlake::Center) |
| void | setAdditionalAttribute (const QString &name, const QString &value) |
| void | setAdditionalStyleAttribute (const char *name, const QString &value) |
| void | setAnchor (KoShapeAnchor *anchor) |
| virtual void | setBackground (QSharedPointer< KoShapeBackground > background) |
| void | setClipMask (KoClipMask *clipMask) |
| Sets a new clip mask, removing the old one. The mask is owned by the shape. | |
| void | setClipPath (KoClipPath *clipPath) |
| Sets a new clip path, removing the old one. | |
| void | setContentProtected (bool protect) |
| void | setGeometryProtected (bool on) |
| void | setHyperLink (const QString &hyperLink) |
| void | setInheritBackground (bool value) |
| setInheritBackground marks a shape as inheriting the background from the parent shape. NOTE: The currently selected background is destroyed. | |
| void | setInheritPaintOrder (bool value) |
| setInheritPaintOrder set inherit paint order. | |
| void | setInheritStroke (bool value) |
| setInheritStroke marks a shape as inheriting the stroke from the parent shape. NOTE: The currently selected stroke is destroyed. | |
| void | setKeepAspectRatio (bool keepAspect) |
| void | setMinimumHeight (qreal height) |
| void | setName (const QString &name) |
| virtual void | setPaintOrder (PaintOrder first, PaintOrder second) |
| setPaintOrder set the paint order. As there's only three entries in any given paintorder, you only need to have the first and second entry to set it. | |
| void | setParent (KoShapeContainer *parent) |
| virtual void | setPosition (const QPointF &position) |
| Set the position of the shape in pt. | |
| void | setPrintable (bool on) |
| virtual void | setResolution (qreal xRes, qreal yRes) |
| void | setSelectable (bool selectable) |
| void | setShapeId (const QString &id) |
| virtual void | setSize (const QSizeF &size) |
| Resize the shape. | |
| virtual void | setStroke (KoShapeStrokeModelSP stroke) |
| void | setToolDelegates (const QSet< KoShape * > &delegates) |
| void | setTransformation (const QTransform &matrix) |
| void | setTransparency (qreal transparency) |
| void | setUserData (KoShapeUserData *userData) |
| void | setVisible (bool on) |
| void | setZIndex (qint16 zIndex) |
| QString | shapeId () const |
| QPointF | shapeToDocument (const QPointF &point) const |
| Transforms point from shape coordinates to document coordinates. | |
| QRectF | shapeToDocument (const QRectF &rect) const |
| Transforms rect from shape coordinates to document coordinates. | |
| void | shear (qreal sx, qreal sy) |
| Shear the shape The shape will be sheared using the zero-point which is the top-left corner. | |
| virtual QSizeF | size () const |
| Get the size of the shape in pt. | |
| virtual KoSnapData | snapData () const |
| Returns additional snap data the shape wants to have snapping to. | |
| virtual KoShapeStrokeModelSP | stroke () const |
| KoInsets | strokeInsets () const |
| QSet< KoShape * > | toolDelegates () const |
| QTransform | transformation () const |
| Returns the shapes local transformation matrix. | |
| qreal | transparency (bool recursive=false) const |
| virtual void | update () const |
| virtual void | updateAbsolute (const QRectF &rect) const |
| KoShapeUserData * | userData () const |
| virtual void | waitUntilReady (bool asynchronous=true) const |
| qint16 | zIndex () const |
| virtual | ~KoShape () |
| Destructor. | |
Static Public Member Functions | |
| static KisReferenceImage * | fromClipboard (const KisCoordinatesConverter &converter) |
| static KisReferenceImage * | fromFile (const QString &filename, const KisCoordinatesConverter &converter, QWidget *parent) |
| static KisReferenceImage * | fromPaintDevice (KisPaintDeviceSP src, const KisCoordinatesConverter &converter, QWidget *parent) |
| static KisReferenceImage * | fromQImage (const KisCoordinatesConverter &converter, const QImage &img) |
| static KisReferenceImage * | fromXml (const QDomElement &elem) |
Static Public Member Functions inherited from KoShape | |
| static QRectF | absoluteOutlineRect (const QList< KoShape * > &shapes) |
| static QRectF | boundingRect (const QList< KoShape * > &shapes) |
| static bool | compareShapeZIndex (KoShape *s1, KoShape *s2) |
| static KisHandlePainterHelper | createHandlePainterHelperDocument (QPainter *painter, KoShape *shape, qreal handleRadius, int decorationThickness) |
| static KisHandlePainterHelper | createHandlePainterHelperView (QPainter *painter, KoShape *shape, const KoViewConverter &converter, qreal handleRadius=0.0, int decorationThickness=1) |
| static QVector< PaintOrder > | defaultPaintOrder () |
| default paint order as per SVG specification | |
| static QList< KoShape * > | linearizeSubtree (const QList< KoShape * > &shapes) |
| static QList< KoShape * > | linearizeSubtreeSorted (const QList< KoShape * > &shapes) |
Private Attributes | |
| QSharedDataPointer< Private > | d |
Additional Inherited Members | |
Public Types inherited from KoShape | |
| enum | ChangeType { PositionChanged , RotationChanged , ScaleChanged , ShearChanged , SizeChanged , GenericMatrixChange , KeepAspectRatioChange , ParentChanged , Deleted , StrokeChanged , BackgroundChanged , BorderChanged , ParameterChanged , ContentChanged , TextContourMarginChanged , ChildChanged , ConnectionPointChanged , ClipPathChanged , ClipMaskChanged , TransparencyChanged } |
| Used by shapeChanged() to select which change was made. More... | |
| enum | ChildZOrderPolicy { ChildZDefault , ChildZParentChild = ChildZDefault , ChildZPassThrough } |
| Used by compareShapeZIndex() to order shapes. More... | |
| enum | PaintOrder { Fill , Stroke , Markers } |
Static Public Attributes inherited from KoShape | |
| static const qint16 | maxZIndex = std::numeric_limits<qint16>::max() |
| static const qint16 | minZIndex = std::numeric_limits<qint16>::min() |
Protected Member Functions inherited from KoShape | |
| KoShape (const KoShape &rhs) | |
| QList< ShapeChangeListener * > | listeners () const |
| void | setSizeImpl (const QSizeF &size) const |
| virtual void | shapeChanged (ChangeType type, KoShape *shape=0) |
| void | shapeChangedPriv (KoShape::ChangeType type) |
| QTransform | transform () const |
| return the current matrix that contains the rotation/scale/position of this shape | |
The KisReferenceImage class represents a single reference image.
Definition at line 29 of file KisReferenceImage.h.
| KisReferenceImage::KisReferenceImage | ( | ) |
Definition at line 147 of file KisReferenceImage.cpp.
References KoShape::setKeepAspectRatio().
| KisReferenceImage::KisReferenceImage | ( | const KisReferenceImage & | rhs | ) |
Definition at line 153 of file KisReferenceImage.cpp.
| KisReferenceImage::~KisReferenceImage | ( | ) |
Definition at line 158 of file KisReferenceImage.cpp.
|
overridevirtual |
creates a deep copy of the shape or shape's subtree
Reimplemented from KoShape.
Definition at line 423 of file KisReferenceImage.cpp.
References KisReferenceImage().
| bool KisReferenceImage::embed | ( | ) |
| QString KisReferenceImage::filename | ( | ) | const |
Definition at line 289 of file KisReferenceImage.cpp.
References d.
|
static |
Definition at line 184 of file KisReferenceImage.cpp.
References KisClipboard::clip, KisClipboard::clipSize(), fromPaintDevice(), and KisClipboard::instance().
|
static |
Load a reference image from specified file. If parent is provided and the image cannot be loaded, a warning message will be displayed to user.
Definition at line 161 of file KisReferenceImage.cpp.
References d, filename(), KisCoordinatesConverter::imageToDocument(), KisReferenceImage(), KoShape::parent(), and KoShape::setSize().
|
static |
Load a reference image from specified paint device.
Definition at line 192 of file KisReferenceImage.cpp.
References KisCoordinatesConverter::imageToDocument(), KoColorSpaceRegistry::instance(), KisReferenceImage(), and KoShape::size().
|
static |
Definition at line 208 of file KisReferenceImage.cpp.
References d, KisCoordinatesConverter::imageToDocument(), KisReferenceImage(), KoShape::setSize(), and KoShape::size().
|
static |
Definition at line 347 of file KisReferenceImage.cpp.
References KisReferenceImage(), saturation(), KisDomUtils::toDouble(), KoShape::transform(), and SvgTransformParser::transform().
| QImage KisReferenceImage::getImage | ( | ) |
| QColor KisReferenceImage::getPixel | ( | QPointF | position | ) |
Definition at line 305 of file KisReferenceImage.cpp.
References KoShape::absoluteTransformation(), d, KoShape::position(), KoShape::scale(), KoShape::size(), KoShape::transform(), and KoShape::transparency().
| bool KisReferenceImage::hasLocalFile | ( | ) |
Definition at line 284 of file KisReferenceImage.cpp.
References d.
| QString KisReferenceImage::internalFile | ( | ) | const |
Definition at line 294 of file KisReferenceImage.cpp.
References d.
| bool KisReferenceImage::loadImage | ( | KoStore * | store | ) |
Definition at line 396 of file KisReferenceImage.cpp.
References KoStore::close(), d, KoStore::open(), and KoStoreDevice::open().
|
overridevirtual |
Paint the shape fill The class extending this one is responsible for painting itself. painter is expected to be preconfigured to work in "document" pixels.
| painter | used for painting the shape |
Implements KoShape.
Definition at line 225 of file KisReferenceImage.cpp.
References d, KoShape::parent(), KoShape::scale(), KoShape::size(), and KoShape::transform().
| qreal KisReferenceImage::saturation | ( | ) | const |
Definition at line 268 of file KisReferenceImage.cpp.
References d.
| bool KisReferenceImage::saveImage | ( | KoStore * | store | ) | const |
Definition at line 378 of file KisReferenceImage.cpp.
References KoStore::close(), d, KoStore::open(), and KoStoreDevice::open().
| void KisReferenceImage::saveXml | ( | QDomDocument & | document, |
| QDomElement & | parentElement, | ||
| int | id ) |
Definition at line 322 of file KisReferenceImage.cpp.
References d, KoShape::keepAspectRatio(), KoShape::size(), KisDomUtils::toString(), KoShape::transform(), SvgUtil::transformToString(), and KoShape::transparency().
| void KisReferenceImage::setEmbed | ( | bool | embed | ) |
Definition at line 273 of file KisReferenceImage.cpp.
References d, embed(), and KIS_SAFE_ASSERT_RECOVER_RETURN.
| void KisReferenceImage::setFilename | ( | const QString & | filename | ) |
Definition at line 300 of file KisReferenceImage.cpp.
References d, and filename().
| void KisReferenceImage::setSaturation | ( | qreal | saturation | ) |
Definition at line 262 of file KisReferenceImage.cpp.
References d, and saturation().
|
private |
Definition at line 89 of file KisReferenceImage.h.