|
Krita Source Code Documentation
|
Write API docs here. More...
#include <KoPattern.h>
Inheritance diagram for KoPattern:Public Member Functions | |
| KoResourceSP | clone () const override |
| KoPatternSP | cloneWithoutAlpha () const |
| QString | defaultFileExtension () const override |
| bool | hasAlpha () const |
| qint32 | height () const |
| KoPattern (const KoPattern &rhs) | |
| KoPattern (const QImage &image, const QString &name, const QString &filename) | |
| KoPattern (const QString &filename) | |
| bool | loadFromDevice (QIODevice *dev, KisResourcesInterfaceSP resourcesInterface) override |
| bool | loadPatFromDevice (QIODevice *dev) |
| KoPattern & | operator= (const KoPattern &rhs)=delete |
| QImage | pattern () const |
| pattern the actual pattern image | |
| QPair< QString, QString > | resourceType () const override |
| bool | savePatToDevice (QIODevice *dev) const |
| bool | saveToDevice (QIODevice *dev) const override |
| qint32 | width () const |
| ~KoPattern () override | |
Public Member Functions inherited from KoResource | |
| bool | active () const |
| void | addMetaData (QString key, QVariant value) |
| store the given key, value pair in the resource | |
| virtual void | clearSideLoadedResources () |
| virtual QList< KoResourceLoadResult > | embeddedResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| QString | filename () const |
| QImage | image () const |
| bool | isDirty () const |
| virtual bool | isEphemeral () const |
| virtual bool | isSerializable () const |
| KoResource () | |
| KoResource (const KoResource &rhs) | |
| KoResource (const QString &filename) | |
| virtual QList< KoResourceLoadResult > | linkedResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| bool | load (KisResourcesInterfaceSP resourcesInterface) |
| QString | md5Sum (bool generateIfEmpty=true) const |
| QMap< QString, QVariant > | metadata () const |
| get a map with all the metadata | |
| virtual QString | name () const |
| KoResource & | operator= (const KoResource &rhs)=delete |
| bool | permanent () const |
| virtual QList< int > | requiredCanvasResources () const |
| QList< KoResourceLoadResult > | requiredResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| int | resourceId () const |
| bool | save () |
| void | setActive (bool active) |
| void | setDirty (bool value) |
| Mark the preset as modified but not saved. | |
| void | setFilename (const QString &filename) |
| void | setImage (const QImage &image) |
| void | setMD5Sum (const QString &md5sum) |
| Set the md5sum of this resource. It must be in hex-encoded string format. | |
| void | setName (const QString &name) |
| void | setPermanent (bool permanent) |
| void | setResourceId (int id) |
| void | setStorageLocation (const QString &location) |
| void | setValid (bool valid) |
| void | setVersion (int version) |
| virtual QList< KoResourceLoadResult > | sideLoadedResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| KoResourceSignature | signature () const |
| QString | storageLocation () const |
| QList< KoResourceLoadResult > | takeSideLoadedResources (KisResourcesInterfaceSP globalResourcesInterface) |
| virtual QImage | thumbnail () const |
| thumbnail the thumbnail image to use in resource selectors | |
| virtual QString | thumbnailPath () const |
| thumbnailPath returns the path to a separate thumbnail image, outside the actual resource file itself. If the path is relative, it is supposed start in the same location as the resource itself. If it's absolute, that is, it starts with "/", it is from the root of the storage. | |
| virtual void | updateThumbnail () |
| updateThumbnail updates the thumbnail for this resource. Reimplement if your thumbnail is something else than the image set with setImage. | |
| bool | valid () const |
| int | version () const |
| Get the version of the resource. | |
| virtual | ~KoResource () |
Public Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Private Member Functions | |
| void | checkForAlpha (const QImage &image) |
| void | setPatternImage (const QImage &image) |
Private Attributes | |
| bool | m_hasAlpha = false |
| QImage | m_pattern |
Additional Inherited Members | |
Public Attributes inherited from KoResource | |
| bool | active {true} |
| QString | filename |
| QImage | image |
| QString | md5sum |
| QMap< QString, QVariant > | metadata |
| bool | modified {false} |
| QString | name |
| bool | permanent {false} |
| int | resourceId {-1} |
| QString | storageLocation |
| bool | valid {false} |
| int | version {-1} |
Public Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Write API docs here.
Definition at line 20 of file KoPattern.h.
|
explicit |
Creates a new KoPattern object using filename. No file is opened in the constructor, you have to call load.
| filename | the file name to save and load from. |
Definition at line 50 of file KoPattern.cpp.
| KoPattern::KoPattern | ( | const QImage & | image, |
| const QString & | name, | ||
| const QString & | filename ) |
Create a new pattern from scratch, without loading it from a file
| image | the pattern |
| name | the name of the pattern |
| filename | the filename of the pattern (note that this filename does not need to exist) |
Definition at line 55 of file KoPattern.cpp.
References KoResource::filename, KoResource::image, KoResource::name, KoResource::setFilename(), KoResource::setName(), and setPatternImage().
|
override |
Definition at line 64 of file KoPattern.cpp.
| KoPattern::KoPattern | ( | const KoPattern & | rhs | ) |
Definition at line 68 of file KoPattern.cpp.
|
private |
Definition at line 359 of file KoPattern.cpp.
References KoResource::image, and m_hasAlpha.
|
overridevirtual |
| KoPatternSP KoPattern::cloneWithoutAlpha | ( | ) | const |
Create a copy of this pattern removing all the transparency from it. The fully transparent color becomes 100% black. The name and the filename of the new pattern are kept the same.
If hasAlpha() is false, the function just returns a simple clone of this pattern.
Definition at line 376 of file KoPattern.cpp.
References clone(), KoResource::filename, hasAlpha(), KoResource::image, KoPattern(), KoResource::name, and toQShared().
|
overridevirtual |
Reimplemented from KoResource.
Definition at line 348 of file KoPattern.cpp.
| bool KoPattern::hasAlpha | ( | ) | const |
Definition at line 371 of file KoPattern.cpp.
References m_hasAlpha.
| qint32 KoPattern::height | ( | ) | const |
Definition at line 334 of file KoPattern.cpp.
References m_pattern.
|
overridevirtual |
Implements KoResource.
Definition at line 283 of file KoPattern.cpp.
References KoResource::filename, KoResource::image, loadPatFromDevice(), KisMimeDatabase::mimeTypeForData(), and setPatternImage().
| bool KoPattern::loadPatFromDevice | ( | QIODevice * | dev | ) |
Definition at line 79 of file KoPattern.cpp.
References KoResource::filename, KoResource::name, pattern(), KoResource::setName(), setPatternImage(), and KoResource::setValid().
| QImage KoPattern::pattern | ( | ) | const |
pattern the actual pattern image
Definition at line 354 of file KoPattern.cpp.
References m_pattern.
|
inlineoverridevirtual |
Implements KoResource.
Definition at line 60 of file KoPattern.h.
References ResourceType::Patterns.
| bool KoPattern::savePatToDevice | ( | QIODevice * | dev | ) | const |
Definition at line 228 of file KoPattern.cpp.
References height(), m_pattern, KoResource::name, and width().
|
overridevirtual |
Reimplemented from KoResource.
Definition at line 308 of file KoPattern.cpp.
References KoResource::filename, m_pattern, and savePatToDevice().
|
private |
Definition at line 339 of file KoPattern.cpp.
References checkForAlpha(), KoResource::image, m_pattern, KoResource::setImage(), and KoResource::setValid().
| qint32 KoPattern::width | ( | ) | const |
Definition at line 329 of file KoPattern.cpp.
References m_pattern.
|
private |
Definition at line 89 of file KoPattern.h.
|
private |
Definition at line 88 of file KoPattern.h.