|
Krita Source Code Documentation
|
#include <Document.h>
Inheritance diagram for Document:Public Slots | |
| Node * | activeNode () const |
| activeNode retrieve the node that is currently active in the currently active window | |
| int | animationLength () |
| get total frame range for animation | |
| QByteArray | annotation (const QString &type) |
| annotation the actual data for the annotation for this type. It's a simple QByteArray, what's in it depends on the type of the annotation | |
| QString | annotationDescription (const QString &type) const |
| annotationDescription gets the pretty description for the current annotation | |
| QStringList | annotationTypes () const |
| annotationTypes returns the list of annotations present in the document. Each annotation type is unique. | |
| qreal | audioLevel () const |
| Return current audio level for document. | |
| QList< QString > | audioTracks () const |
| Return a list of current audio tracks for document. | |
| bool | autosave () |
| Return autosave status for document Notes: | |
| QColor | backgroundColor () |
| backgroundColor returns the current background color of the document. The color will also include the opacity. | |
| bool | batchmode () const |
| QRect | bounds () const |
| bounds return the bounds of the image | |
| Document * | clone () const |
| clone create a shallow clone of this document. | |
| bool | close () |
| close Close the document: remove it from Krita's internal list of documents and close all views. If the document is modified, you should save it first. There will be no prompt for saving. | |
| QString | colorDepth () const |
| QString | colorModel () const |
| colorModel retrieve the current color model of this document: | |
| QString | colorProfile () const |
| CloneLayer * | createCloneLayer (const QString &name, const Node *source) |
| createCloneLayer | |
| ColorizeMask * | createColorizeMask (const QString &name) |
| createColorizeMask Creates a colorize mask, which can be used to color fill via keystrokes. | |
| FileLayer * | createFileLayer (const QString &name, const QString fileName, const QString scalingMethod, const QString scalingFilter="Bicubic") |
| createFileLayer returns a layer that shows an external image. | |
| FillLayer * | createFillLayer (const QString &name, const QString generatorName, InfoObject &configuration, Selection &selection) |
| createFillLayer creates a fill layer object, which is a layer | |
| FilterLayer * | createFilterLayer (const QString &name, Filter &filter, Selection &selection) |
| createFilterLayer creates a filter layer, which is a layer that represents a filter applied non-destructively. | |
| FilterMask * | createFilterMask (const QString &name, Filter &filter, const Node *selection_source) |
| createFilterMask Creates a filter mask object that much like a filterlayer can apply a filter non-destructively. | |
| FilterMask * | createFilterMask (const QString &name, Filter &filter, Selection &selection) |
| createFilterMask Creates a filter mask object that much like a filterlayer can apply a filter non-destructively. | |
| GroupLayer * | createGroupLayer (const QString &name) |
| createGroupLayer Returns a grouplayer object. Grouplayers are nodes that can have other layers as children and have the passthrough mode. | |
| Node * | createNode (const QString &name, const QString &nodeType) |
| SelectionMask * | createSelectionMask (const QString &name) |
| createSelectionMask Creates a selection mask, which can be used to store selections. | |
| TransformMask * | createTransformMask (const QString &name) |
| createTransformMask Creates a transform mask, which can be used to apply a transformation non-destructively. | |
| TransparencyMask * | createTransparencyMask (const QString &name) |
| createTransparencyMask Creates a transparency mask, which can be used to assign transparency to regions. | |
| VectorLayer * | createVectorLayer (const QString &name) |
| createVectorLayer Creates a vector layer that can contain vector shapes. | |
| void | crop (int x, int y, int w, int h) |
crop the image to rectangle described by x, y, w and h | |
| int | currentTime () |
| get current frame selected of animation | |
| QString | documentInfo () const |
| documentInfo creates and XML document representing document and author information. | |
| bool | exportImage (const QString &filename, const InfoObject &exportConfiguration) |
| exportImage export the image, without changing its URL to the given path. | |
| QString | fileName () const |
| void | flatten () |
| flatten all layers in the image | |
| int | framesPerSecond () |
| frames per second of document | |
| int | fullClipRangeEndTime () |
| get the full clip range end time | |
| int | fullClipRangeStartTime () |
| get the full clip range start time | |
| GridConfig * | gridConfig () |
| Returns a GridConfig grid configuration for current document. | |
| GuidesConfig * | guidesConfig () |
| Returns a GuidesConfig guides configuration for current document. | |
| Q_DECL_DEPRECATED bool | guidesLocked () const |
| DEPRECATED - use guidesConfig() instead Returns guide lockedness. | |
| Q_DECL_DEPRECATED bool | guidesVisible () const |
| DEPRECATED - use guidesConfig() instead Returns guide visibility. | |
| int | height () const |
| Q_DECL_DEPRECATED QList< qreal > | horizontalGuides () const |
| DEPRECATED - use guidesConfig() instead The horizontal guides. | |
| bool | importAnimation (const QList< QString > &files, int firstFrame, int step) |
| Import an image sequence of files from a directory. This will grab all images from the directory and import them with a potential offset (firstFrame) and step (images on 2s, 3s, etc) | |
| void | lock () |
| bool | modified () const |
| modified returns true if the document has unsaved modifications. | |
| QString | name () const |
| Node * | nodeByName (const QString &name) const |
| nodeByName searches the node tree for a node with the given name and returns it | |
| Node * | nodeByUniqueID (const QUuid &id) const |
| nodeByUniqueID searches the node tree for a node with the given name and returns it. | |
| QByteArray | pixelData (int x, int y, int w, int h) const |
| pixelData reads the given rectangle from the image projection and returns it as a byte array. The pixel data starts top-left, and is ordered row-first. | |
| int | playBackEndTime () |
| get end time of current playback | |
| int | playBackStartTime () |
| get start time of current playback | |
| QImage | projection (int x=0, int y=0, int w=0, int h=0) const |
| projection creates a QImage from the rendered image or a cutout rectangle. | |
| void | refreshProjection () |
| void | removeAnnotation (const QString &type) |
| removeAnnotation remove the specified annotation from the image | |
| void | resizeImage (int x, int y, int w, int h) |
| resizeImage resizes the canvas to the given left edge, top edge, width and height. Note: This doesn't scale, use scale image for that. | |
| int | resolution () const |
| Node * | rootNode () const |
| rootNode the root node is the invisible group layer that contains the entire node hierarchy. | |
| void | rotateImage (double radians) |
| rotateImage Rotate the image by the given radians. | |
| bool | save () |
| save the image to its currently set path. The modified flag of the document will be reset | |
| bool | saveAs (const QString &filename) |
saveAs save the document under the filename. The document's filename will be reset to filename. | |
| void | scaleImage (int w, int h, int xres, int yres, QString strategy) |
| scaleImage | |
| Selection * | selection () const |
| selection Create a Selection object around the global selection, if there is one. | |
| void | setActiveNode (Node *value) |
| setActiveNode make the given node active in the currently active view and window | |
| void | setAnnotation (const QString &type, const QString &description, const QByteArray &annotation) |
| setAnnotation Add the given annotation to the document | |
| void | setAudioLevel (const qreal level) |
| Set current audio level for document. | |
| bool | setAudioTracks (const QList< QString > files) const |
| Set a list of audio tracks for document Note: the function allows to add more than one file while from Krita's UI, importing a file will replace the complete list. | |
| void | setAutosave (bool active) |
| Allow to activate/deactivate autosave for document When activated, it will use default Krita autosave settings It means that even when autosave is set to True, under condition Krita will not proceed to automatic save of document: | |
| bool | setBackgroundColor (const QColor &color) |
| setBackgroundColor sets the background color of the document. It will trigger a projection update. | |
| void | setBatchmode (bool value) |
| bool | setColorProfile (const QString &colorProfile) |
| setColorProfile set the color profile of the image to the given profile. The profile has to be registered with krita and be compatible with the current color model and depth; the image data is not converted. | |
| bool | setColorSpace (const QString &colorModel, const QString &colorDepth, const QString &colorProfile) |
| setColorSpace convert the nodes and the image to the given colorspace. The conversion is done with Perceptual as intent, High Quality and No LCMS Optimizations as flags and no blackpoint compensation. | |
| void | setCurrentTime (int time) |
| set current time of document's animation | |
| void | setDocumentInfo (const QString &document) |
| setDocumentInfo set the Document information to the information contained in document | |
| void | setFileName (QString value) |
| setFileName set the full path of the document to | |
| void | setFramesPerSecond (int fps) |
| set frames per second of document | |
| void | setFullClipRangeEndTime (int endTime) |
| set full clip range end time | |
| void | setFullClipRangeStartTime (int startTime) |
| set start time of animation | |
| void | setGridConfig (GridConfig *gridConfig) |
| void | setGuidesConfig (GuidesConfig *guidesConfig) |
| Q_DECL_DEPRECATED void | setGuidesLocked (bool locked) |
| DEPRECATED - use guidesConfig() instead set guides locked on this document. | |
| Q_DECL_DEPRECATED void | setGuidesVisible (bool visible) |
| DEPRECATED - use guidesConfig() instead set guides visible on this document. | |
| void | setHeight (int value) |
| setHeight resize the document to | |
| Q_DECL_DEPRECATED void | setHorizontalGuides (const QList< qreal > &lines) |
| DEPRECATED - use guidesConfig() instead replace all existing horizontal guides with the entries in the list. | |
| void | setModified (bool modified) |
| setModified sets the modified status of the document | |
| void | setName (QString value) |
setName sets the name of the document to value. This is the title field in the documentInfo | |
| void | setPlayBackRange (int start, int stop) |
| set temporary playback range of document | |
| void | setResolution (int value) |
| setResolution set the resolution of the image; this does not scale the image | |
| void | setSelection (Selection *value) |
| setSelection set or replace the global selection | |
| Q_DECL_DEPRECATED void | setVerticalGuides (const QList< qreal > &lines) |
| DEPRECATED - use guidesConfig() instead replace all existing horizontal guides with the entries in the list. | |
| void | setWidth (int value) |
| setWidth resize the document to | |
| void | setXOffset (int x) |
setXOffset sets the left edge of the canvas to x. | |
| void | setXRes (double xRes) const |
| setXRes set the horizontal resolution of the image to xRes in pixels per inch | |
| void | setYOffset (int y) |
setYOffset sets the top edge of the canvas to y. | |
| void | setYRes (double yRes) const |
| setYRes set the vertical resolution of the image to yRes in pixels per inch | |
| void | shearImage (double angleX, double angleY) |
| shearImage shear the whole image. | |
| QImage | thumbnail (int w, int h) const |
| thumbnail create a thumbnail of the given dimensions. | |
| QList< Node * > | topLevelNodes () const |
| toplevelNodes return a list with all top level nodes in the image graph | |
| bool | tryBarrierLock () |
| Tries to lock the image without waiting for the jobs to finish. | |
| void | unlock () |
| Q_DECL_DEPRECATED QList< qreal > | verticalGuides () const |
| DEPRECATED - use guidesConfig() instead The vertical guide lines. | |
| void | waitForDone () |
| int | width () const |
| int | xOffset () const |
| double | xRes () const |
| int | yOffset () const |
| double | yRes () const |
Public Member Functions | |
| Document (KisDocument *document, bool ownsDocument, QObject *parent=0) | |
| bool | operator!= (const Document &other) const |
| bool | operator== (const Document &other) const |
| ~Document () override | |
Private Member Functions | |
| QPointer< KisDocument > | document () const |
| void | setOwnsDocument (bool ownsDocument) |
Private Attributes | |
| Private *const | d |
Friends | |
| class | Filter |
| class | Krita |
| class | Shape |
| Freehand and shapes like ellipses and lines. | |
| class | VectorLayer |
| class | View |
| Assistance tools: guides, reference, etc. | |
| class | Window |
The Document class encapsulates a Krita Document/Image. A Krita document is an Image with a filename. Libkis does not differentiate between a document and an image, like Krita does internally.
Definition at line 36 of file Document.h.
|
explicit |
Definition at line 79 of file Document.cpp.
References d, krita::Document::Private::document, document(), and krita::Document::Private::ownsDocument.
|
override |
Definition at line 87 of file Document.cpp.
References d, krita::Document::Private::document, KisPart::instance(), krita::Document::Private::ownsDocument, and KisPart::removeDocument().
|
slot |
activeNode retrieve the node that is currently active in the currently active window
Definition at line 118 of file Document.cpp.
References LibKisUtils::createNodeList(), d, krita::Document::Private::document, KisSynchronizedConnectionBase::forceDeliverAllSynchronizedEvents(), and KisPart::instance().
|
slot |
get total frame range for animation
Definition at line 1048 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
annotation the actual data for the annotation for this type. It's a simple QByteArray, what's in it depends on the type of the annotation
| type | the type of the annotation |
Definition at line 1131 of file Document.cpp.
References KisImage::annotation(), annotation(), d, and krita::Document::Private::document.
|
slot |
annotationDescription gets the pretty description for the current annotation
| type | the type of the annotation |
Definition at line 1124 of file Document.cpp.
References KisImage::annotation(), annotation(), d, and krita::Document::Private::document.
|
slot |
annotationTypes returns the list of annotations present in the document. Each annotation type is unique.
Definition at line 1097 of file Document.cpp.
References KisImage::beginAnnotations(), d, krita::Document::Private::document, and KisImage::endAnnotations().
|
slot |
Return current audio level for document.
Definition at line 1268 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
Return a list of current audio tracks for document.
Definition at line 1278 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
Return autosave status for document Notes:
Definition at line 1162 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
backgroundColor returns the current background color of the document. The color will also include the opacity.
Definition at line 236 of file Document.cpp.
References d, krita::Document::Private::document, and KoColor::toQColor().
|
slot |
Batchmode means that no actions on the document should show dialogs or popups.
Definition at line 106 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
bounds return the bounds of the image
Definition at line 964 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
clone create a shallow clone of this document.
We set ownsDocument to true, it will be reset automatically as soon as we create the first view for the document
Definition at line 890 of file Document.cpp.
References clone(), d, krita::Document::Private::document, and Document().
|
slot |
close Close the document: remove it from Krita's internal list of documents and close all views. If the document is modified, you should save it first. There will be no prompt for saving.
After closing the document it becomes invalid.
Definition at line 488 of file Document.cpp.
References KisView::closeView(), d, krita::Document::Private::document, KisView::document, KisPart::instance(), krita::Document::Private::ownsDocument, and KisPart::removeDocument().
|
slot |
colorDepth A string describing the color depth of the image:
Definition at line 192 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
colorModel retrieve the current color model of this document:
Definition at line 198 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
Definition at line 204 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
createCloneLayer
| name | |
| source |
Definition at line 709 of file Document.cpp.
References d, krita::Document::Private::document, name(), and source().
|
slot |
createColorizeMask Creates a colorize mask, which can be used to color fill via keystrokes.
| name | - the name of the layer. |
Definition at line 792 of file Document.cpp.
References d, krita::Document::Private::document, and name().
|
slot |
createFileLayer returns a layer that shows an external image.
| name | name of the file layer. |
| fileName | the absolute filename of the file referenced. Symlinks will be resolved. |
| scalingMethod | how the dimensions of the file are interpreted can be either "None", "ImageToSize" or "ImageToPPI" |
| scalingFilter | filter used to scale the file can be "Bicubic", "Hermite", "NearestNeighbor", "Bilinear", "Bell", "BSpline", "Lanczos3", "Mitchell" |
Definition at line 672 of file Document.cpp.
References d, krita::Document::Private::document, fileName(), and name().
|
slot |
createFillLayer creates a fill layer object, which is a layer
| name | |
| generatorName | - name of the generation filter. |
| configuration | - the configuration for the generation filter. |
| selection | - the selection. |
Definition at line 690 of file Document.cpp.
References d, krita::Document::Private::document, KisBaseProcessor::factoryConfiguration(), KisGeneratorRegistry::instance(), KisGlobalResourcesInterface::instance(), name(), InfoObject::properties(), InfoObject::property(), selection(), and KoGenericRegistry< T >::value().
|
slot |
createFilterLayer creates a filter layer, which is a layer that represents a filter applied non-destructively.
| name | name of the filterLayer |
| filter | the filter that this filter layer will us. |
| selection | the selection. |
Definition at line 681 of file Document.cpp.
References d, krita::Document::Private::document, name(), and selection().
|
slot |
createFilterMask Creates a filter mask object that much like a filterlayer can apply a filter non-destructively.
| name | the name of the layer. |
| filter | the filter assigned. |
| selection_source | a node from which the selection should be initialized |
Definition at line 728 of file Document.cpp.
References d, KisSharedPtr< T >::data(), krita::Document::Private::document, KisSharedPtr< T >::isNull(), name(), and Node::node().
|
slot |
createFilterMask Creates a filter mask object that much like a filterlayer can apply a filter non-destructively.
| name | the name of the layer. |
| filter | the filter assigned. |
| selection | the selection to be used by the filter mask |
Definition at line 750 of file Document.cpp.
References d, KisSharedPtr< T >::data(), krita::Document::Private::document, name(), Node::node(), selection(), and Selection::selection().
|
slot |
createGroupLayer Returns a grouplayer object. Grouplayers are nodes that can have other layers as children and have the passthrough mode.
| name | the name of the layer. |
Definition at line 663 of file Document.cpp.
References d, krita::Document::Private::document, and name().
|
slot |
@brief createNode create a new node of the given type. The node is not added
to the node hierarchy; you need to do that by finding the right parent node,
getting its list of child nodes and adding the node in the right place, then
calling Node::SetChildNodes
@param name The name of the node
@param nodeType The type of the node. Valid types are:
<ul>
<li>paintlayer
<li>grouplayer
<li>filelayer
<li>filterlayer
<li>filllayer
<li>clonelayer
<li>vectorlayer
<li>transparencymask
<li>filtermask
<li>transformmask
<li>selectionmask
</ul>
When relevant, the new Node will have the colorspace of the image by default;
that can be changed with Node::setColorSpace.
The settings and selections for relevant layer and mask types can also be set
after the Node has been created.
Definition at line 615 of file Document.cpp.
References d, krita::Document::Private::document, name(), nodeType(), and OPACITY_OPAQUE_U8.
|
slot |
createSelectionMask Creates a selection mask, which can be used to store selections.
| name | - the name of the layer. |
Definition at line 765 of file Document.cpp.
References d, krita::Document::Private::document, and name().
|
slot |
createTransformMask Creates a transform mask, which can be used to apply a transformation non-destructively.
| name | - the name of the layer mask. |
Definition at line 783 of file Document.cpp.
References d, krita::Document::Private::document, and name().
|
slot |
createTransparencyMask Creates a transparency mask, which can be used to assign transparency to regions.
| name | - the name of the layer. |
Definition at line 774 of file Document.cpp.
References d, krita::Document::Private::document, and name().
|
slot |
createVectorLayer Creates a vector layer that can contain vector shapes.
| name | the name of this layer. |
Definition at line 719 of file Document.cpp.
References d, krita::Document::Private::document, name(), and VectorLayer.
|
slot |
crop the image to rectangle described by x, y, w and h
| x | x coordinate of the top left corner |
| y | y coordinate of the top left corner |
| w | width |
| h | height |
Definition at line 511 of file Document.cpp.
References KisImage::cropImage(), d, krita::Document::Private::document, and KisImage::waitForDone().
|
slot |
get current frame selected of animation
Definition at line 1081 of file Document.cpp.
References d, and krita::Document::Private::document.
|
private |
Definition at line 970 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
documentInfo creates and XML document representing document and author information.
https://phabricator.kde.org/source/krita/browse/master/krita/dtd/
Definition at line 259 of file Document.cpp.
References KisDocument::createDomDocument(), d, and krita::Document::Private::document.
|
slot |
exportImage export the image, without changing its URL to the given path.
| filename | the full path to which the image is to be saved |
| exportConfiguration | a configuration object appropriate to the file format. An InfoObject will used to that configuration. |
The supported formats have specific configurations that must be used when in batchmode. They are described below:
png
jpeg
Definition at line 521 of file Document.cpp.
References InfoObject::configuration(), d, krita::Document::Private::document, and KisMimeDatabase::mimeTypeForFile().
|
slot |
Definition at line 277 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
|
slot |
frames per second of document
Definition at line 997 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
get the full clip range end time
Definition at line 1040 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
get the full clip range start time
Definition at line 1022 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
Returns a GridConfig grid configuration for current document.
Definition at line 1254 of file Document.cpp.
References d, krita::Document::Private::document, and gridConfig().
|
slot |
Returns a GuidesConfig guides configuration for current document.
Definition at line 1167 of file Document.cpp.
References d, krita::Document::Private::document, KisGuidesConfig::horizontalGuideLines(), KisGuidesConfig::removeAllGuides(), KisGuidesConfig::setHorizontalGuideLines(), KisGuidesConfig::setVerticalGuideLines(), and KisGuidesConfig::verticalGuideLines().
|
slot |
DEPRECATED - use guidesConfig() instead Returns guide lockedness.
Definition at line 884 of file Document.cpp.
References d, krita::Document::Private::document, and warnScript.
|
slot |
DEPRECATED - use guidesConfig() instead Returns guide visibility.
Definition at line 878 of file Document.cpp.
References d, krita::Document::Private::document, and warnScript.
|
slot |
Definition at line 291 of file Document.cpp.
References d, krita::Document::Private::document, and KisImage::height().
|
slot |
DEPRECATED - use guidesConfig() instead The horizontal guides.
Definition at line 847 of file Document.cpp.
References d, krita::Document::Private::document, and warnScript.
|
slot |
Import an image sequence of files from a directory. This will grab all images from the directory and import them with a potential offset (firstFrame) and step (images on 2s, 3s, etc)
Definition at line 982 of file Document.cpp.
References KisMainWindow::activeView, KisViewManager::createUnthreadedUpdater(), KisPart::currentMainwindow(), d, krita::Document::Private::document, KisAnimationImporter::import(), KisPart::instance(), KisImportExportErrorCode::isOk(), and KisView::viewManager.
|
slot |
[low-level] Lock the image without waiting for all the internal job queues are processed
WARNING: Don't use it unless you really know what you are doing! Use barrierLock() instead!
Waits for all the currently running internal jobs to complete and locks the image for writing. Please note that this function does not wait for all the internal queues to process, so there might be some non-finished actions pending. It means that you just postpone these actions until you unlock() the image back. Until then, then image might easily be frozen in some inconsistent state.
The only sane usage for this function is to lock the image for emergency processing, when some internal action or scheduler got hung up, and you just want to fetch some data from the image without races.
In all other cases, please use barrierLock() instead!
Definition at line 814 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
modified returns true if the document has unsaved modifications.
Definition at line 952 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
Definition at line 310 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
nodeByName searches the node tree for a node with the given name and returns it
| name | the name of the node |
Definition at line 171 of file Document.cpp.
References Node::createNode(), d, krita::Document::Private::document, KisLayerUtils::findNodeByName(), KisSharedPtr< T >::isNull(), and name().
|
slot |
nodeByUniqueID searches the node tree for a node with the given name and returns it.
| uuid | the unique id of the node |
Definition at line 181 of file Document.cpp.
References Node::createNode(), d, krita::Document::Private::document, KisLayerUtils::findNodeByUuid(), and KisSharedPtr< T >::isNull().
| bool Document::operator!= | ( | const Document & | other | ) | const |
| bool Document::operator== | ( | const Document & | other | ) | const |
Definition at line 96 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
pixelData reads the given rectangle from the image projection and returns it as a byte array. The pixel data starts top-left, and is ordered row-first.
The byte array can be interpreted as follows: 8 bits images have one byte per channel, and as many bytes as there are channels. 16 bits integer images have two bytes per channel, representing an unsigned short. 16 bits float images have two bytes per channel, representing a half, or 16 bits float. 32 bits float images have four bytes per channel, representing a float.
You can read outside the image boundaries; those pixels will be transparent black.
The order of channels is:
The byte array is a copy of the original image data. In Python, you can use bytes, bytearray and the struct module to interpret the data and construct, for instance, a Pillow Image object.
| x | x position from where to start reading |
| y | y position from where to start reading |
| w | row length to read |
| h | number of rows to read |
Definition at line 474 of file Document.cpp.
References d, krita::Document::Private::document, KisPaintDevice::pixelSize(), KisImage::projection(), and KisPaintDevice::readBytes().
|
slot |
get end time of current playback
Definition at line 1073 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
get start time of current playback
Definition at line 1065 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
projection creates a QImage from the rendered image or a cutout rectangle.
Definition at line 801 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
Starts a synchronous recomposition of the projection: everything will wait until the image is fully recomputed.
Definition at line 839 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
removeAnnotation remove the specified annotation from the image
| type | the type defining the annotation |
Definition at line 1151 of file Document.cpp.
References d, krita::Document::Private::document, and KisImage::removeAnnotation().
|
slot |
resizeImage resizes the canvas to the given left edge, top edge, width and height. Note: This doesn't scale, use scale image for that.
| x | the new left edge |
| y | the new top edge |
| w | the new width |
| h | the new height |
Definition at line 539 of file Document.cpp.
References d, krita::Document::Private::document, KisImage::resizeImage(), and KisImage::waitForDone().
|
slot |
Definition at line 323 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
rootNode the root node is the invisible group layer that contains the entire node hierarchy.
Definition at line 346 of file Document.cpp.
References Node::createNode(), d, krita::Document::Private::document, and KisNodeFacade::root.
|
slot |
rotateImage Rotate the image by the given radians.
| radians | the amount you wish to rotate the image in radians |
Definition at line 570 of file Document.cpp.
References d, krita::Document::Private::document, KisImage::rotateImage(), and KisImage::waitForDone().
|
slot |
save the image to its currently set path. The modified flag of the document will be reset
Definition at line 588 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
saveAs save the document under the filename. The document's filename will be reset to filename.
| filename | the new filename (full path) for the document |
Definition at line 599 of file Document.cpp.
References d, krita::Document::Private::document, KisMimeDatabase::mimeTypeForFile(), and setFileName().
|
slot |
scaleImage
| w | the new width |
| h | the new height |
| xres | the new xres |
| yres | the new yres |
| strategy | the scaling strategy. There's several ones amongst these that aren't available in the regular UI. The list of filters is extensible and can be retrieved with Krita::filter
|
Definition at line 554 of file Document.cpp.
References KisImage::bounds(), d, krita::Document::Private::document, KoGenericRegistry< T >::get(), KisFilterStrategyRegistry::instance(), KisImage::scaleImage(), and KisImage::waitForDone().
|
slot |
selection Create a Selection object around the global selection, if there is one.
Definition at line 355 of file Document.cpp.
References d, and krita::Document::Private::document.
setActiveNode make the given node active in the currently active view and window
| value | the node to make active. |
If we created any nodes via the same script, then dummies state may be not synchronized with the actual state of the nodes in the image. Hence, we should explicitly deliver the synchronized events before we try to manipulate with the GUI representation of nodes.
Definition at line 138 of file Document.cpp.
References KisPart::currentMainwindow(), d, krita::Document::Private::document, KisViewManager::document(), KisSynchronizedConnectionBase::forceDeliverAllSynchronizedEvents(), KisPart::instance(), KisViewManager::nodeManager(), KisNodeManager::nodeSelectionAdapter(), KisNodeSelectionAdapter::setActiveNode(), value(), and KisMainWindow::viewManager.
|
slot |
setAnnotation Add the given annotation to the document
| type | the unique type of the annotation |
| description | the user-visible description of the annotation |
| annotation | the annotation itself |
Definition at line 1143 of file Document.cpp.
References KisImage::addAnnotation(), annotation(), d, and krita::Document::Private::document.
|
slot |
Set current audio level for document.
| level | Audio volume between 0.0 and 1.0 (1.0 = 100%) |
Definition at line 1273 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
Set a list of audio tracks for document Note: the function allows to add more than one file while from Krita's UI, importing a file will replace the complete list.
The reason why this method let the ability to provide more than one file is related to the internal's Krita method from KisDocument class: void KisDocument::setAudioTracks(QVector<QFileInfo> f)
| files | List of absolute path/file name of audio files |
Definition at line 1287 of file Document.cpp.
References d, krita::Document::Private::document, and fileName().
|
slot |
Allow to activate/deactivate autosave for document When activated, it will use default Krita autosave settings It means that even when autosave is set to True, under condition Krita will not proceed to automatic save of document:
Being able to deactivate autosave on a document can make sense when a plugin use internal document (document is not exposed in a view, only created for internal process purposes)
| active | True to activate autosave |
Definition at line 1157 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
setBackgroundColor sets the background color of the document. It will trigger a projection update.
| color | A QColor. The color will be converted from sRGB. |
Definition at line 245 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
Set batchmode to value. If batchmode is true, then there should be no popups or dialogs shown to the user.
Definition at line 112 of file Document.cpp.
References d, krita::Document::Private::document, and value().
|
slot |
setColorProfile set the color profile of the image to the given profile. The profile has to be registered with krita and be compatible with the current color model and depth; the image data is not converted.
| colorProfile |
Definition at line 210 of file Document.cpp.
References d, krita::Document::Private::document, KoColorSpaceRegistry::instance(), KoColorSpaceRegistry::profileByName(), and value().
|
slot |
setColorSpace convert the nodes and the image to the given colorspace. The conversion is done with Perceptual as intent, High Quality and No LCMS Optimizations as flags and no blackpoint compensation.
| colorModel | A string describing the color model of the image:
|
| colorDepth | A string describing the color depth of the image:
|
| colorProfile | a valid color profile for this color model and color depth combination. |
Definition at line 221 of file Document.cpp.
References colorDepth(), colorModel(), colorProfile(), KoColorSpaceRegistry::colorSpace(), d, krita::Document::Private::document, KoColorConversionTransformation::HighQuality, KoColorSpaceRegistry::instance(), KoColorConversionTransformation::IntentPerceptual, and KoColorConversionTransformation::NoOptimization.
|
slot |
set current time of document's animation
Definition at line 1089 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
setDocumentInfo set the Document information to the information contained in document
| document | A string containing a valid XML document that conforms to the document-info DTD that can be found here: |
https://phabricator.kde.org/source/krita/browse/master/krita/dtd/
Definition at line 267 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
setFileName set the full path of the document to
| value |
Definition at line 283 of file Document.cpp.
References d, krita::Document::Private::document, KisMimeDatabase::mimeTypeForFile(), and value().
|
slot |
set frames per second of document
Definition at line 1005 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
set full clip range end time
Definition at line 1031 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
set start time of animation
Definition at line 1013 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
@brief Set grid configuration for current document @param gridConfig a GridConfig object to apply for grid configuration To modify/set grid property on a document
Definition at line 1261 of file Document.cpp.
References d, krita::Document::Private::document, gridConfig(), and GridConfig::gridConfig().
|
slot |
@brief Set guides configuration for current document @param guidesConfig a GuidesConfig object to apply for guides configuration To modify/set guides property on a document
Definition at line 1219 of file Document.cpp.
References d, krita::Document::Private::document, guidesConfig(), GuidesConfig::guidesConfig(), KisGuidesConfig::horizontalGuideLines(), KisGuidesConfig::removeAllGuides(), KisGuidesConfig::setHorizontalGuideLines(), KisGuidesConfig::setVerticalGuideLines(), and KisGuidesConfig::verticalGuideLines().
|
slot |
DEPRECATED - use guidesConfig() instead set guides locked on this document.
| locked | whether or not to lock the guides on this document. |
Definition at line 943 of file Document.cpp.
References d, krita::Document::Private::document, KisGuidesConfig::setLockGuides(), and warnScript.
|
slot |
DEPRECATED - use guidesConfig() instead set guides visible on this document.
| visible | whether or not the guides are visible. |
Definition at line 934 of file Document.cpp.
References d, krita::Document::Private::document, KisGuidesConfig::setShowGuides(), and warnScript.
|
slot |
setHeight resize the document to
| value | height. This is a canvas resize, not a scale. |
Definition at line 299 of file Document.cpp.
References d, krita::Document::Private::document, resizeImage(), and value().
DEPRECATED - use guidesConfig() instead replace all existing horizontal guides with the entries in the list.
| lines | a list of floats containing the new guides. |
Definition at line 902 of file Document.cpp.
References d, krita::Document::Private::document, KisGuidesConfig::setHorizontalGuideLines(), and warnScript.
|
slot |
setModified sets the modified status of the document
| modified | if true, the document is considered modified and closing it will ask for saving. |
Definition at line 958 of file Document.cpp.
References d, krita::Document::Private::document, and modified().
|
slot |
setName sets the name of the document to value. This is the title field in the documentInfo
Definition at line 316 of file Document.cpp.
References d, krita::Document::Private::document, and value().
|
private |
Definition at line 975 of file Document.cpp.
References d, and krita::Document::Private::ownsDocument.
|
slot |
set temporary playback range of document
Definition at line 1056 of file Document.cpp.
References d, krita::Document::Private::document, and KisTimeSpan::fromTimeWithDuration().
|
slot |
setResolution set the resolution of the image; this does not scale the image
| value | the resolution in pixels per inch |
Definition at line 332 of file Document.cpp.
References d, krita::Document::Private::document, KoGenericRegistry< T >::get(), KisFilterStrategyRegistry::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN, KisImage::scaleImage(), KisImage::size(), value(), and KisImage::waitForDone().
setSelection set or replace the global selection
| value | a valid selection object. |
Definition at line 363 of file Document.cpp.
References d, krita::Document::Private::document, and value().
DEPRECATED - use guidesConfig() instead replace all existing horizontal guides with the entries in the list.
| lines | a list of floats containing the new guides. |
Definition at line 918 of file Document.cpp.
References d, krita::Document::Private::document, KisGuidesConfig::setVerticalGuideLines(), and warnScript.
|
slot |
setWidth resize the document to
| value | width. This is a canvas resize, not a scale. |
Definition at line 384 of file Document.cpp.
References d, krita::Document::Private::document, resizeImage(), and value().
|
slot |
setXOffset sets the left edge of the canvas to x.
Definition at line 403 of file Document.cpp.
References d, krita::Document::Private::document, and resizeImage().
|
slot |
setXRes set the horizontal resolution of the image to xRes in pixels per inch
Definition at line 440 of file Document.cpp.
References d, krita::Document::Private::document, KoGenericRegistry< T >::get(), KisFilterStrategyRegistry::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN, KisImage::scaleImage(), KisImage::size(), KisImage::waitForDone(), xRes(), and KisImage::yRes().
|
slot |
setYOffset sets the top edge of the canvas to y.
Definition at line 422 of file Document.cpp.
References d, krita::Document::Private::document, and resizeImage().
|
slot |
setYRes set the vertical resolution of the image to yRes in pixels per inch
Definition at line 460 of file Document.cpp.
References d, krita::Document::Private::document, KoGenericRegistry< T >::get(), KisFilterStrategyRegistry::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN, KisImage::scaleImage(), KisImage::size(), KisImage::waitForDone(), KisImage::xRes(), and yRes().
|
slot |
shearImage shear the whole image.
| angleX | the X-angle in degrees to shear by |
| angleY | the Y-angle in degrees to shear by |
Definition at line 579 of file Document.cpp.
References d, krita::Document::Private::document, KisImage::shear(), and KisImage::waitForDone().
|
slot |
thumbnail create a thumbnail of the given dimensions.
If the requested size is too big a null QImage is created.
Definition at line 807 of file Document.cpp.
References d, and krita::Document::Private::document.
toplevelNodes return a list with all top level nodes in the image graph
Definition at line 163 of file Document.cpp.
References Node::childNodes(), d, and krita::Document::Private::document.
|
slot |
Tries to lock the image without waiting for the jobs to finish.
Same as barrierLock(), but doesn't block execution of the calling thread until all the background jobs are finished. Instead, in case of presence of unfinished jobs in the queue, it just returns false
Definition at line 833 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
Unlocks the image and starts/resumes all the pending internal jobs. If the image has been locked for a non-readOnly access, then all the internal caches of the image (e.g. lod-planes) are reset and regeneration jobs are scheduled.
Definition at line 820 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
DEPRECATED - use guidesConfig() instead The vertical guide lines.
Definition at line 863 of file Document.cpp.
References d, krita::Document::Private::document, and warnScript.
|
slot |
Wait for all the internal image jobs to complete and return without locking the image. This function is handy for tests or other synchronous actions, when one needs to wait for the result of his actions.
Definition at line 826 of file Document.cpp.
References d, krita::Document::Private::document, and KisLayerUtils::forceAllDelayedNodesUpdate().
|
slot |
Definition at line 376 of file Document.cpp.
References d, krita::Document::Private::document, and KisImage::width().
|
slot |
Definition at line 395 of file Document.cpp.
References KisImage::bounds(), d, and krita::Document::Private::document.
|
slot |
Definition at line 433 of file Document.cpp.
References d, and krita::Document::Private::document.
|
slot |
Definition at line 414 of file Document.cpp.
References KisImage::bounds(), d, and krita::Document::Private::document.
|
slot |
Definition at line 453 of file Document.cpp.
References d, and krita::Document::Private::document.
|
friend |
Definition at line 1056 of file Document.h.
|
friend |
Definition at line 1054 of file Document.h.
|
friend |
Freehand and shapes like ellipses and lines.
Definition at line 1059 of file Document.h.
|
friend |
Definition at line 1058 of file Document.h.
|
friend |
Assistance tools: guides, reference, etc.
Definition at line 1057 of file Document.h.
|
friend |
Definition at line 1055 of file Document.h.
|
private |
Definition at line 1065 of file Document.h.