Krita Source Code Documentation
Loading...
Searching...
No Matches
KisAnnotation Class Reference

A data extension mechanism for Krita. More...

#include <kis_annotation.h>

+ Inheritance diagram for KisAnnotation:

Public Member Functions

const QByteArray & annotation () const
 
virtual KisAnnotationclone () const
 
const QString & description () const
 
virtual QString displayText () const
 displayText: override this to return an interpreted version of the annotation
 
 KisAnnotation (const QString &type, const QString &description, const QByteArray &data)
 
void setAnnotation (const QByteArray ba)
 
const QString & type () const
 
virtual ~KisAnnotation ()
 
- Public Member Functions inherited from KisShared
bool deref ()
 
bool ref ()
 
int refCount ()
 
QAtomicInt * sharedWeakReference ()
 

Protected Member Functions

 KisAnnotation (const KisAnnotation &rhs)
 
- Protected Member Functions inherited from KisShared
 KisShared ()
 
 ~KisShared ()
 

Protected Attributes

QByteArray m_annotation
 
QString m_description
 
QString m_type
 

Detailed Description

A data extension mechanism for Krita.

An annotation can be of something like a QByteArray or a QString or a more specific datatype that can be attached to an image (or maybe later, if needed, to a layer) and contains data that must be associated with an image for purposes of import/export.

Annotations will be saved to krita images and may be exported in filetypes that support them.

Examples of annotations are EXIF data and ICC profiles.

Definition at line 41 of file kis_annotation.h.

Constructor & Destructor Documentation

◆ KisAnnotation() [1/2]

KisAnnotation::KisAnnotation ( const QString & type,
const QString & description,
const QByteArray & data )
inline

creates a new annotation object. The annotation object cannot be changed later.

Parameters
typea non-localized string identifying the type of the annotation. There can only be one annotation of a given type attached to an image.
descriptiona localized string describing the annotation
dataa binary blob containing the annotation data

Definition at line 56 of file kis_annotation.h.

57 : m_type(type)
59 , m_annotation(data) {}
QString m_description
QByteArray m_annotation
const QString & type() const
const QString & description() const

◆ ~KisAnnotation()

virtual KisAnnotation::~KisAnnotation ( )
inlinevirtual

Definition at line 61 of file kis_annotation.h.

61{}

◆ KisAnnotation() [2/2]

KisAnnotation::KisAnnotation ( const KisAnnotation & rhs)
inlineprotected

Definition at line 107 of file kis_annotation.h.

108 : KisShared(),
109 m_type(rhs.m_type),
112 {
113 }

Member Function Documentation

◆ annotation()

const QByteArray & KisAnnotation::annotation ( ) const
inline

gets a binary blob representation of this annotation

Returns
a binary blob representation of this annotation

Definition at line 91 of file kis_annotation.h.

91 {
92 return m_annotation;
93 }

◆ clone()

virtual KisAnnotation * KisAnnotation::clone ( ) const
inlinevirtual

Reimplemented in PSDResourceBlock, and KisAnimatedBrushAnnotation.

Definition at line 63 of file kis_annotation.h.

63 {
64 return new KisAnnotation(*this);
65 }
KisAnnotation(const QString &type, const QString &description, const QByteArray &data)

◆ description()

const QString & KisAnnotation::description ( ) const
inline

gets a localized string describing the type of annotations for used interface purposes.

Returns
a localized string describing the type of the annotations for user interface purposes.

Definition at line 83 of file kis_annotation.h.

83 {
84 return m_description;
85 }

◆ displayText()

virtual QString KisAnnotation::displayText ( ) const
inlinevirtual

displayText: override this to return an interpreted version of the annotation

Reimplemented in PSDResourceBlock.

Definition at line 102 of file kis_annotation.h.

102 {
103 return QString::fromUtf8(m_annotation);
104 }

◆ setAnnotation()

void KisAnnotation::setAnnotation ( const QByteArray ba)
inline

Definition at line 95 of file kis_annotation.h.

95 {
96 m_annotation = ba;
97 }

◆ type()

const QString & KisAnnotation::type ( ) const
inline

gets a non-localized string identifying the type of the annotation.

Returns
a non-localized string identifying the type of the annotation

Definition at line 73 of file kis_annotation.h.

73 {
74 return m_type;
75 }

Member Data Documentation

◆ m_annotation

QByteArray KisAnnotation::m_annotation
protected

Definition at line 119 of file kis_annotation.h.

◆ m_description

QString KisAnnotation::m_description
protected

Definition at line 118 of file kis_annotation.h.

◆ m_type

QString KisAnnotation::m_type
protected

Definition at line 117 of file kis_annotation.h.


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