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

#include <psd_export.h>

+ Inheritance diagram for psdExport:

Public Member Functions

KisImportExportErrorCode convert (KisDocument *document, QIODevice *io, KisPropertiesConfigurationSP configuration=0) override
 
bool exportSupportsGuides () const override
 exportSupportsGuides Because guides are in the document and not the image, checking for guides cannot be made an exportCheck.
 
void initializeCapabilities () override
 
 psdExport (QObject *parent, const QVariantList &)
 
 ~psdExport () override
 
- Public Member Functions inherited from KisImportExportFilter
virtual KisConfigWidgetcreateConfigurationWidget (QWidget *parent, const QByteArray &from="", const QByteArray &to="") const
 createConfigurationWidget creates a widget that can be used to define the settings for a given import/export filter
 
virtual KisPropertiesConfigurationSP defaultConfiguration (const QByteArray &from="", const QByteArray &to="") const
 defaultConfiguration defines the default settings for the given import export filter
 
virtual QMap< QString, KisExportCheckBase * > exportChecks ()
 generate and return the list of capabilities of this export filter. The list
 
KisPropertiesConfigurationSP lastSavedConfiguration (const QByteArray &from="", const QByteArray &to="") const
 lastSavedConfiguration return the last saved configuration for this filter
 
 Private ()
 
void setBatchMode (bool batchmode)
 
void setFilename (const QString &filename)
 
void setImportUserFeedBackInterface (KisImportUserFeedbackInterface *interface)
 
void setMimeType (const QString &mime)
 
void setRealFilename (const QString &filename)
 
void setUpdater (QPointer< KoUpdater > updater)
 
virtual bool supportsIO () const
 Override and return false for the filters that use a library that cannot handle file handles, only file names.
 
QPointer< KoUpdaterupdater ()
 
virtual QString verify (const QString &fileName) const
 Verify whether the given file is correct and readable.
 
 ~KisImportExportFilter () override
 
 ~Private ()
 

Additional Inherited Members

- Public Attributes inherited from KisImportExportFilter
bool batchmode
 
QMap< QString, KisExportCheckBase * > capabilities
 
QString filename
 
KisImportUserFeedbackInterfaceimportUserFeedBackInterface {nullptr}
 
QByteArray mime
 
QString realFilename
 
QPointer< KoUpdaterupdater
 
- Static Public Attributes inherited from KisImportExportFilter
static const QString CICPPrimariesTag = "CICPCompatiblePrimaries"
 
static const QString CICPTransferCharacteristicsTag = "CICPCompatibleTransferFunction"
 
static const QString ColorDepthIDTag = "ColorDepthID"
 
static const QString ColorModelIDTag = "ColorModelID"
 
static const QString HDRTag = "HDRSupported"
 
static const QString ImageContainsTransparencyTag = "ImageContainsTransparency"
 
static const QString sRGBTag = "sRGB"
 
- Protected Member Functions inherited from KisImportExportFilter
void addCapability (KisExportCheckBase *capability)
 
void addSupportedColorModels (QList< QPair< KoID, KoID > > supportedColorModels, const QString &name, KisExportCheckBase::Level level=KisExportCheckBase::PARTIALLY)
 
bool batchMode () const
 
QString filename () const
 
KisImportUserFeedbackInterfaceimportUserFeedBackInterface () const
 
 KisImportExportFilter (QObject *parent=0)
 
QByteArray mimeType () const
 
QString realFilename () const
 
void setProgress (int value)
 
QString verifyZiPBasedFiles (const QString &fileName, const QStringList &filesToCheck) const
 

Detailed Description

Definition at line 13 of file psd_export.h.

Constructor & Destructor Documentation

◆ psdExport()

psdExport::psdExport ( QObject * parent,
const QVariantList &  )

Definition at line 32 of file psd_export.cc.

32 : KisImportExportFilter(parent)
33{
34}
KisImportExportFilter(QObject *parent=0)

◆ ~psdExport()

psdExport::~psdExport ( )
override

Definition at line 36 of file psd_export.cc.

37{
38}

Member Function Documentation

◆ convert()

KisImportExportErrorCode psdExport::convert ( KisDocument * document,
QIODevice * io,
KisPropertiesConfigurationSP configuration = 0 )
overridevirtual

The filter chain calls this method to perform the actual conversion. The passed mimetypes should be a pair of those you specified in your .desktop file. You have to implement this method to make the filter work.

Returns
The error status, see the #ConversionStatus enum. KisImportExportFilter::OK means that everything is alright.

Implements KisImportExportFilter.

Definition at line 40 of file psd_export.cc.

41{
42 PSDSaver psdSaver(document);
43 return psdSaver.buildFile(*io);
44}

References PSDSaver::buildFile().

◆ exportSupportsGuides()

bool psdExport::exportSupportsGuides ( ) const
overridevirtual

exportSupportsGuides Because guides are in the document and not the image, checking for guides cannot be made an exportCheck.

Returns
whether this filter supports exporting guides

Reimplemented from KisImportExportFilter.

Definition at line 92 of file psd_export.cc.

93{
94 return true;
95}

◆ initializeCapabilities()

void psdExport::initializeCapabilities ( )
overridevirtual

Reimplemented from KisImportExportFilter.

Definition at line 46 of file psd_export.cc.

47{
56 addCapability(KisExportCheckRegistry::instance()->get("ColorModelHomogenousCheck")->create(KisExportCheckBase::UNSUPPORTED, i18nc("image conversion warning", "Your image contains one or more layers with a color model that is different from the image.")));
58
59 ImageSizeCheckFactory *factory = dynamic_cast<ImageSizeCheckFactory*>(KisExportCheckRegistry::instance()->get("ImageSizeCheck"));
60 if (factory) {
61 addCapability(factory->create(30000, 30000, KisExportCheckBase::SUPPORTED));
62 }
63
64 QList<QPair<KoID, KoID> > supportedColorModels;
65 supportedColorModels << QPair<KoID, KoID>()
66 << QPair<KoID, KoID>(RGBAColorModelID, Integer8BitsColorDepthID)
67 << QPair<KoID, KoID>(RGBAColorModelID, Integer16BitsColorDepthID)
68// << QPair<KoID, KoID>(RGBAColorModelID, Float16BitsColorDepthID)
69// << QPair<KoID, KoID>(RGBAColorModelID, Float32BitsColorDepthID)
70 << QPair<KoID, KoID>(GrayAColorModelID, Integer8BitsColorDepthID)
71 << QPair<KoID, KoID>(GrayAColorModelID, Integer16BitsColorDepthID)
72 << QPair<KoID, KoID>(CMYKAColorModelID, Integer8BitsColorDepthID)
73 << QPair<KoID, KoID>(CMYKAColorModelID, Integer16BitsColorDepthID)
74 << QPair<KoID, KoID>(LABAColorModelID, Integer8BitsColorDepthID)
75 << QPair<KoID, KoID>(LABAColorModelID, Integer16BitsColorDepthID);
76 addSupportedColorModels(supportedColorModels, "PSD");
77
81
83 addCapability(KisExportCheckRegistry::instance()->get("ShapeLayerTypeCheck/KoPathShape/RectangleShape")->create(KisExportCheckBase::SUPPORTED));
84 addCapability(KisExportCheckRegistry::instance()->get("ShapeLayerTypeCheck/KoPathShape/EllipseShape")->create(KisExportCheckBase::SUPPORTED));
85 addCapability(KisExportCheckRegistry::instance()->get("ShapeLayerTypeCheck/KoPathShape/StarShape")->create(KisExportCheckBase::SUPPORTED));
87
88 const QString textShapeWarning = i18nc("image conversion warning", "While text shapes can be saved to psd, only basic features are supported. Advanced features, like text-on-path and opentype features will not be saved.");
89 addCapability(KisExportCheckRegistry::instance()->get("ShapeLayerTypeCheck/KoSvgTextShapeID")->create(KisExportCheckBase::PARTIALLY, textShapeWarning));
90}
VertexDescriptor get(PredecessorMap const &m, VertexDescriptor v)
const KoID GrayAColorModelID("GRAYA", ki18n("Grayscale/Alpha"))
const KoID Integer8BitsColorDepthID("U8", ki18n("8-bit integer/channel"))
const KoID Integer16BitsColorDepthID("U16", ki18n("16-bit integer/channel"))
const KoID CMYKAColorModelID("CMYKA", ki18n("CMYK/Alpha"))
const KoID LABAColorModelID("LABA", ki18n("L*a*b*/Alpha"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
KisExportCheckBase * create(int maxWidth, int maxHeight, KisExportCheckBase::Level level, const QString &customWarning)
static KisExportCheckRegistry * instance()
void addSupportedColorModels(QList< QPair< KoID, KoID > > supportedColorModels, const QString &name, KisExportCheckBase::Level level=KisExportCheckBase::PARTIALLY)
void addCapability(KisExportCheckBase *capability)
T get(const QString &id) const
QPainterPath create(const char32_t codepoint, double height)
Creates a tofu missing glyph indicator representing the provided Unicode codepoint.

References KisImportExportFilter::addCapability(), KisImportExportFilter::addSupportedColorModels(), CMYKAColorModelID, ImageSizeCheckFactory::create(), KoGenericRegistry< T >::get(), get(), GrayAColorModelID, KisExportCheckRegistry::instance(), Integer16BitsColorDepthID, Integer8BitsColorDepthID, LABAColorModelID, KisExportCheckBase::PARTIALLY, RGBAColorModelID, KisExportCheckBase::SUPPORTED, and KisExportCheckBase::UNSUPPORTED.


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