11#include <QApplication>
15#include <kpluginfactory.h>
37#define GET_RED(x) (x >> RED_SHIFT)
38#define GET_GREEN(x) (x >> GREEN_SHIFT)
39#define GET_BLUE(x) (x >> BLUE_SHIFT)
40#define GET_ALPHA(x) (x >> ALPHA_SHIFT)
97 dbgFile <<
"Unknown mode: " << mode;
109 for (; i < layers.size(); ++i) {
111 if (group && (layers[i].depth == layer.
depth -1)) {
120 for(
int i = 0; i < layers.size(); i++) {
121 const Layer &layer = layers[i];
122 if (layer.
depth == depth) {
146 dbgFile <<
"Start decoding file";
147 QByteArray data = io->readAll();
155 document->setErrorMessage(i18n(
"This XCF file is too new; Krita cannot support XCF files written by GIMP 2.9 or newer."));
182 maxDepth = qMax(maxDepth, xcflayer.
pathLength);
187 switch (xcflayer.
type) {
216 layer.
layer = kisLayer;
224 int left = xcflayer.
dim.
c.
l;
225 int top = xcflayer.
dim.
c.
t;
252 }
while (it->nextPixel());
256 it->rawData()[0] =
GET_RED(*data);
259 }
while (it->nextPixel());
295 }
while (it->nextPixel());
306 layers.append(layer);
309 for (
uint i = 0; i <= maxDepth; ++i) {
313 document->setCurrentImage(image);
318#include "kis_xcf_import.moc"
const KoID GrayAColorModelID("GRAYA", ki18n("Grayscale/Alpha"))
const KoID Integer8BitsColorDepthID("U8", ki18n("8-bit integer/channel"))
const QString COMPOSITE_OVER
const QString COMPOSITE_COPY
const QString COMPOSITE_DARKEN
const QString COMPOSITE_OVERLAY
const QString COMPOSITE_DIVIDE
const QString COMPOSITE_DODGE
const QString COMPOSITE_ADD
const QString COMPOSITE_LIGHTEN
const QString COMPOSITE_VALUE
const QString COMPOSITE_GRAIN_MERGE
const QString COMPOSITE_MULT
const QString COMPOSITE_HUE_HSL
const QString COMPOSITE_HARD_LIGHT
const QString COMPOSITE_SCREEN
const QString COMPOSITE_DIFF
const QString COMPOSITE_ERASE
const QString COMPOSITE_SUBTRACT
const QString COMPOSITE_DISSOLVE
const QString COMPOSITE_BURN
const QString COMPOSITE_COLOR_HSL
const QString COMPOSITE_GRAIN_EXTRACT
const QString COMPOSITE_SATURATION_HSV
KisGroupLayerSP rootLayer() const
The base class for import and export filters.
KisHLineIteratorSP createHLineIteratorNG(qint32 x, qint32 y, qint32 w)
KisImportExportErrorCode convert(KisDocument *document, QIODevice *io, KisPropertiesConfigurationSP configuration=0) override
KisXCFImport(QObject *parent, const QVariantList &)
@ GIMP_NORMAL_NOPARTIAL_MODE
@ GIMP_GRAIN_EXTRACT_MODE
K_PLUGIN_FACTORY_WITH_JSON(KritaASCCDLFactory, "kritaasccdl.json", registerPlugin< KritaASCCDL >();) KritaASCCDL
void addLayers(const QVector< Layer > &layers, KisImageSP image, int depth)
KisGroupLayerSP findGroup(const QVector< Layer > &layers, const Layer &layer, int i)
QString layerModeG2K(GimpLayerModeEffects mode)
@ FormatFeaturesUnsupported
int initLayer(struct xcfLayer *layer)
void freeTile(struct Tile *tile)
struct Tile * getMaskOrLayerTile(struct tileDimensions *dim, struct xcfTiles *tiles, struct rect want)
virtual void setVisible(bool visible, bool loading=false)
virtual KisPaintDeviceSP paintDevice() const =0
void setCompositeOpId(const QString &compositeOpId)
void disableAlphaChannel(bool disable)
void initSelection(KisSelectionSP copyFrom, KisLayerSP parentLayer)
initSelection initializes the selection for the mask from the given selection's projection.
KisPaintDeviceSP paintDevice() const override
bool addNode(KisNodeSP node, KisNodeSP parent=KisNodeSP(), KisNodeAdditionFlags flags=KisNodeAdditionFlag::None)
static void setRed(quint8 *data, channels_type nv)
Set the red component.
static void setGreen(quint8 *data, channels_type nv)
Set the green component.
static void setBlue(quint8 *data, channels_type nv)
Set the blue component.
const KoColorSpace * colorSpace(const QString &colorModelId, const QString &colorDepthId, const KoColorProfile *profile)
static KoColorSpaceRegistry * instance()
const KoColorSpace * rgb8(const QString &profileName=QString())
static void setOpacity(quint8 *pixels, quint8 alpha, qint32 nPixels)
rgba pixels[TILE_WIDTH *TILE_HEIGHT]
GimpLayerModeEffects mode
struct tileDimensions dim
int getBasicXcfInfo(void)