Krita Source Code Documentation
Loading...
Searching...
No Matches
psd_image_data.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2011 Siddharth Sharma <siddharth.kde@gmail.com>
3 * SPDX-FileCopyrightText: 2021 L. E. Segovia <amy@amyspark.me>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#ifndef PSD_IMAGE_DATA_H
9#define PSD_IMAGE_DATA_H
10
11#include <kis_paint_device.h>
12#include <kis_types.h>
13
14#include <psd.h>
15#include <psd_header.h>
16#include <compression.h>
17#include <psd_layer_record.h>
18
19#include <QFile>
20class QIODevice;
21
22
24{
25
26public:
27 PSDImageData(PSDHeader *header);
28 virtual ~PSDImageData();
29
30 bool read(QIODevice &io, KisPaintDeviceSP dev);
31 bool write(QIODevice &io, KisPaintDeviceSP dev, bool hasAlpha, psd_compression_type compressionType);
32
33 QString error;
34
35private:
36 bool readRGB(QIODevice &io, KisPaintDeviceSP dev);
37 bool readCMYK(QIODevice &io, KisPaintDeviceSP dev);
38 bool readLAB(QIODevice &io, KisPaintDeviceSP dev);
39 bool readGrayscale(QIODevice &io, KisPaintDeviceSP dev);
40
41 PSDHeader *m_header {nullptr};
42
43 quint16 m_compression {0};
45 quint32 m_channelSize {0};
46
48 QVector<int> m_channelOffsets; // this doesn't need to be global
49};
50
51#endif // PSD_IMAGE_DATA_H
bool readCMYK(QIODevice &io, KisPaintDeviceSP dev)
quint32 m_channelSize
bool readGrayscale(QIODevice &io, KisPaintDeviceSP dev)
quint64 m_channelDataLength
quint16 m_compression
bool write(QIODevice &io, KisPaintDeviceSP dev, bool hasAlpha, psd_compression_type compressionType)
bool readRGB(QIODevice &io, KisPaintDeviceSP dev)
bool read(QIODevice &io, KisPaintDeviceSP dev)
bool readLAB(QIODevice &io, KisPaintDeviceSP dev)
virtual ~PSDImageData()
PSDHeader * m_header
PSDImageData(PSDHeader *header)
QVector< ChannelInfo > m_channelInfoRecords
QVector< int > m_channelOffsets
psd_compression_type
Definition psd.h:39