Krita Source Code Documentation
Loading...
Searching...
No Matches
psd_layer_record.cpp File Reference
#include "psd_layer_record.h"
#include <QtEndian>
#include <KoColor.h>
#include <QBuffer>
#include <QDataStream>
#include <QIODevice>
#include "kis_iterator_ng.h"
#include <algorithm>
#include <kis_debug.h>
#include <kis_node.h>
#include <kis_paint_layer.h>
#include "compression.h"
#include "psd.h"
#include "psd_header.h"
#include "psd_utils.h"
#include <KoColorSpace.h>
#include <KoColorSpaceMaths.h>
#include <KoColorSpaceRegistry.h>
#include <KoColorSpaceTraits.h>
#include <KoPathShape.h>
#include <KoPathSegment.h>
#include <KoPathPoint.h>
#include <asl/kis_asl_reader_utils.h>
#include <asl/kis_asl_writer_utils.h>
#include <asl/kis_offset_keeper.h>
#include "psd_pixel_utils.h"
#include <kundo2command.h>

Go to the source code of this file.

Functions

QString channelIdToChannelType (int channelId, psd_color_mode colormode)
 
QDebug operator<< (QDebug dbg, const ChannelInfo &channel)
 
QDebug operator<< (QDebug dbg, const PSDLayerRecord &layer)
 

Function Documentation

◆ channelIdToChannelType()

QString channelIdToChannelType ( int channelId,
psd_color_mode colormode )

Definition at line 44 of file psd_layer_record.cpp.

45{
46 switch (channelId) {
47 case -3:
48 return "Real User Supplied Layer Mask (when both a user mask and a vector mask are present";
49 case -2:
50 return "User Supplied Layer Mask";
51 case -1:
52 return "Transparency mask";
53 case 0:
54 switch (colormode) {
55 case Bitmap:
56 case Indexed:
57 return QString("bitmap or indexed: %1").arg(channelId);
58 case Grayscale:
59 case Gray16:
60 return "gray";
61 case RGB:
62 case RGB48:
63 return "red";
64 case Lab:
65 case Lab48:
66 return "L";
67 case CMYK:
68 case CMYK64:
69 return "cyan";
70 case MultiChannel:
72 return QString("multichannel channel %1").arg(channelId);
73 case DuoTone:
74 case Duotone16:
75 return QString("duotone channel %1").arg(channelId);
76 default:
77 return QString("unknown: %1").arg(channelId);
78 };
79 case 1:
80 switch (colormode) {
81 case Bitmap:
82 case Indexed:
83 return QString("WARNING bitmap or indexed: %1").arg(channelId);
84 case Grayscale:
85 case Gray16:
86 return QString("WARNING: %1").arg(channelId);
87 case RGB:
88 case RGB48:
89 return "green";
90 case Lab:
91 case Lab48:
92 return "a";
93 case CMYK:
94 case CMYK64:
95 return "Magenta";
96 case MultiChannel:
98 return QString("multichannel channel %1").arg(channelId);
99 case DuoTone:
100 case Duotone16:
101 return QString("duotone channel %1").arg(channelId);
102 default:
103 return QString("unknown: %1").arg(channelId);
104 };
105 case 2:
106 switch (colormode) {
107 case Bitmap:
108 case Indexed:
109 return QString("WARNING bitmap or indexed: %1").arg(channelId);
110 case Grayscale:
111 case Gray16:
112 return QString("WARNING: %1").arg(channelId);
113 case RGB:
114 case RGB48:
115 return "blue";
116 case Lab:
117 case Lab48:
118 return "b";
119 case CMYK:
120 case CMYK64:
121 return "yellow";
122 case MultiChannel:
123 case DeepMultichannel:
124 return QString("multichannel channel %1").arg(channelId);
125 case DuoTone:
126 case Duotone16:
127 return QString("duotone channel %1").arg(channelId);
128 default:
129 return QString("unknown: %1").arg(channelId);
130 };
131 case 3:
132 switch (colormode) {
133 case Bitmap:
134 case Indexed:
135 return QString("WARNING bitmap or indexed: %1").arg(channelId);
136 case Grayscale:
137 case Gray16:
138 return QString("WARNING: %1").arg(channelId);
139 case RGB:
140 case RGB48:
141 return QString("alpha: %1").arg(channelId);
142 case Lab:
143 case Lab48:
144 return QString("alpha: %1").arg(channelId);
145 case CMYK:
146 case CMYK64:
147 return "Key";
148 case MultiChannel:
149 case DeepMultichannel:
150 return QString("multichannel channel %1").arg(channelId);
151 case DuoTone:
152 case Duotone16:
153 return QString("duotone channel %1").arg(channelId);
154 default:
155 return QString("unknown: %1").arg(channelId);
156 };
157 default:
158 return QString("unknown: %1").arg(channelId);
159 };
160}
@ CMYK64
Definition psd.h:62
@ Lab
Definition psd.h:58
@ RGB
Definition psd.h:54
@ DuoTone
Definition psd.h:57
@ RGB48
Definition psd.h:60
@ Duotone16
Definition psd.h:64
@ CMYK
Definition psd.h:55
@ Gray16
Definition psd.h:59
@ Indexed
Definition psd.h:53
@ MultiChannel
Definition psd.h:56
@ DeepMultichannel
Definition psd.h:63
@ Grayscale
Definition psd.h:52
@ Bitmap
Definition psd.h:51
@ Lab48
Definition psd.h:61

References Bitmap, CMYK, CMYK64, DeepMultichannel, DuoTone, Duotone16, Gray16, Grayscale, Indexed, Lab, Lab48, MultiChannel, RGB, and RGB48.

◆ operator<<() [1/2]

QDebug operator<< ( QDebug dbg,
const ChannelInfo & channel )

Definition at line 1035 of file psd_layer_record.cpp.

1036{
1037#ifndef NODEBUG
1038 dbg.nospace() << "\tChannel type" << channel.channelId << "size: " << channel.channelDataLength << "compression type" << channel.compressionType << "\n";
1039#endif
1040 return dbg.nospace();
1041}
psd_compression_type compressionType
quint64 channelDataLength

References ChannelInfo::channelDataLength, ChannelInfo::channelId, and ChannelInfo::compressionType.

◆ operator<<() [2/2]

QDebug operator<< ( QDebug dbg,
const PSDLayerRecord & layer )

Definition at line 1012 of file psd_layer_record.cpp.

1013{
1014#ifndef NODEBUG
1015 dbg.nospace() << "valid: " << const_cast<PSDLayerRecord *>(&layer)->valid();
1016 dbg.nospace() << ", name: " << layer.layerName;
1017 dbg.nospace() << ", top: " << layer.top;
1018 dbg.nospace() << ", left:" << layer.left;
1019 dbg.nospace() << ", bottom: " << layer.bottom;
1020 dbg.nospace() << ", right: " << layer.right;
1021 dbg.nospace() << ", number of channels: " << layer.nChannels;
1022 dbg.nospace() << ", blendModeKey: " << layer.blendModeKey;
1023 dbg.nospace() << ", opacity: " << layer.opacity;
1024 dbg.nospace() << ", clipping: " << layer.clipping;
1025 dbg.nospace() << ", transparency protected: " << layer.transparencyProtected;
1026 dbg.nospace() << ", visible: " << layer.visible;
1027 dbg.nospace() << ", irrelevant: " << layer.irrelevant << "\n";
1028 Q_FOREACH (const ChannelInfo *channel, layer.channelInfoRecords) {
1029 dbg.space() << channel;
1030 }
1031#endif
1032 return dbg.nospace();
1033}
QVector< ChannelInfo * > channelInfoRecords

References PSDLayerRecord::blendModeKey, PSDLayerRecord::bottom, PSDLayerRecord::channelInfoRecords, PSDLayerRecord::clipping, PSDLayerRecord::irrelevant, PSDLayerRecord::layerName, PSDLayerRecord::left, PSDLayerRecord::nChannels, PSDLayerRecord::opacity, PSDLayerRecord::right, PSDLayerRecord::top, PSDLayerRecord::transparencyProtected, and PSDLayerRecord::visible.