#include <kis_tiff_psd_layer_record.h>
Definition at line 19 of file kis_tiff_psd_layer_record.h.
◆ KisTiffPsdLayerRecord()
| KisTiffPsdLayerRecord::KisTiffPsdLayerRecord |
( |
bool | isBigEndian, |
|
|
uint32_t | width, |
|
|
uint32_t | height, |
|
|
uint16_t | channelDepth, |
|
|
uint16_t | nChannels, |
|
|
uint16_t | photometricInterpretation, |
|
|
bool | hasTransparency = false ) |
Definition at line 21 of file kis_tiff_psd_layer_record.cpp.
35{
36 if (photometricInterpretation == PHOTOMETRIC_MINISWHITE || photometricInterpretation == PHOTOMETRIC_MINISBLACK) {
38 } else if (photometricInterpretation == PHOTOMETRIC_RGB) {
40 } else if (photometricInterpretation == PHOTOMETRIC_SEPARATED) {
41 dbgFile <<
"PSD warning: assuming CMYK for color separations";
43 } else if (photometricInterpretation == PHOTOMETRIC_CIELAB || photometricInterpretation == PHOTOMETRIC_ICCLAB) {
45 } else if (photometricInterpretation == PHOTOMETRIC_PALETTE) {
47 } else {
48 dbgFile <<
"TIFF PSD error: " << photometricInterpretation <<
"does not map to a Photoshop supported mode";
50 }
51}
uint16_t channelDepth() const
psd_byte_order m_byteOrder
psd_color_mode m_colorMode
References CMYK, COLORMODE_UNKNOWN, dbgFile, Grayscale, Indexed, Lab, m_colorMode, and RGB.
◆ channelDepth()
| uint16_t KisTiffPsdLayerRecord::channelDepth |
( |
| ) |
const |
|
inline |
◆ colorMode()
◆ read()
| bool KisTiffPsdLayerRecord::read |
( |
QIODevice & | io | ) |
|
◆ readImpl()
| bool KisTiffPsdLayerRecord::readImpl |
( |
QIODevice & | device | ) |
|
|
private |
Definition at line 74 of file kis_tiff_psd_layer_record.cpp.
75{
85 m_record = std::make_shared<PSDLayerMaskSection>(header);
86
87 QLatin1String signature("Adobe Photoshop Document Data Block");
88 QByteArray
b = device.read(signature.size() + 1);
89 if (
b.size() != signature.size() + 1 || QLatin1String(b) != signature) {
90 m_record->error = QString(
"Invalid Photoshop data block: %1").arg(QLatin1String(b));
91 return false;
92 }
93
96 return false;
97 }
98
100
102
103 return true;
104}
std::shared_ptr< PSDLayerMaskSection > m_record
References PSDHeader::byteOrder, PSDHeader::channelDepth, PSDHeader::colormode, dbgFile, PSDHeader::height, m_channelDepth, m_colorMode, m_height, m_nChannels, m_record, m_valid, m_width, PSDHeader::nChannels, PSDHeader::tiffStyleLayerBlock, PSDHeader::version, and PSDHeader::width.
◆ record()
◆ valid()
| bool KisTiffPsdLayerRecord::valid |
( |
| ) |
const |
◆ write()
◆ writeImpl()
Definition at line 107 of file kis_tiff_psd_layer_record.cpp.
108{
118 m_record = std::make_shared<PSDLayerMaskSection>(header);
120
121 QBuffer buf;
122 buf.open(QIODevice::WriteOnly);
123
124 psdwrite(buf,
"Adobe Photoshop Document Data Block");
126
127 if (!
m_record->write(buf, rootLayer, compressionType)) {
129 return false;
130 }
131
132 buf.close();
133
134
135 qint64 layerSectionLength = buf.size();
136 dbgFile <<
"layer section has size" << layerSectionLength;
137
138
139 return (device.write(buf.data()) == layerSectionLength);
140}
bool psdpad(QIODevice &io, quint32 padding)
std::enable_if_t< std::is_arithmetic< T >::value, bool > psdwrite(QIODevice &io, T v)
References PSDHeader::byteOrder, PSDHeader::channelDepth, PSDHeader::colormode, dbgFile, PSDHeader::height, m_channelDepth, m_colorMode, m_hasTransparency, m_height, m_nChannels, m_record, m_width, PSDHeader::nChannels, psdpad(), psdwrite(), PSDHeader::tiffStyleLayerBlock, PSDHeader::version, and PSDHeader::width.
◆ m_byteOrder
◆ m_channelDepth
| uint16_t KisTiffPsdLayerRecord::m_channelDepth |
|
private |
◆ m_colorMode
◆ m_hasTransparency
| bool KisTiffPsdLayerRecord::m_hasTransparency |
|
private |
◆ m_height
| uint32_t KisTiffPsdLayerRecord::m_height |
|
private |
◆ m_nChannels
| uint16_t KisTiffPsdLayerRecord::m_nChannels |
|
private |
◆ m_record
◆ m_valid
| bool KisTiffPsdLayerRecord::m_valid |
|
private |
◆ m_width
| uint32_t KisTiffPsdLayerRecord::m_width |
|
private |
The documentation for this class was generated from the following files: