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

#include <psd_resource_section.h>

Public Types

enum  PSDResourceID {
  UNKNOWN = 0 , PS2_IMAGE_INFO = 1000 , MAC_PRINT_INFO = 1001 , PS2_COLOR_TAB = 1003 ,
  RESN_INFO = 1005 , ALPHA_NAMES = 1006 , DISPLAY_INFO = 1007 , CAPTION = 1008 ,
  BORDER_INFO = 1009 , BACKGROUND_COL = 1010 , PRINT_FLAGS = 1011 , GREY_HALFTONE = 1012 ,
  COLOR_HALFTONE = 1013 , DUOTONE_HALFTONE = 1014 , GREY_XFER = 1015 , COLOR_XFER = 1016 ,
  DUOTONE_XFER = 1017 , DUOTONE_INFO = 1018 , EFFECTIVE_BW = 1019 , OBSOLETE_01 = 1020 ,
  EPS_OPT = 1021 , QUICK_MASK = 1022 , OBSOLETE_02 = 1023 , LAYER_STATE = 1024 ,
  WORKING_PATH = 1025 , LAYER_GROUP = 1026 , OBSOLETE_03 = 1027 , IPTC_NAA_DATA = 1028 ,
  IMAGE_MODE_RAW = 1029 , JPEG_QUAL = 1030 , GRID_GUIDE = 1032 , THUMB_RES = 1033 ,
  COPYRIGHT_FLG = 1034 , URL = 1035 , THUMB_RES2 = 1036 , GLOBAL_ANGLE = 1037 ,
  COLOR_SAMPLER = 1038 , ICC_PROFILE = 1039 , WATERMARK = 1040 , ICC_UNTAGGED = 1041 ,
  EFFECTS_VISIBLE = 1042 , SPOT_HALFTONE = 1043 , DOC_IDS = 1044 , ALPHA_NAMES_UNI = 1045 ,
  IDX_COL_TAB_CNT = 1046 , IDX_TRANSPARENT = 1047 , GLOBAL_ALT = 1049 , SLICES = 1050 ,
  WORKFLOW_URL_UNI = 1051 , JUMP_TO_XPEP = 1052 , ALPHA_ID = 1053 , URL_LIST_UNI = 1054 ,
  VERSION_INFO = 1057 , EXIF_DATA = 1058 , EXIF_DATA_3 = 1059 , XMP_DATA = 1060 ,
  CAPTION_DIGEST = 1061 , PRINT_SCALE = 1062 , PIXEL_ASPECT_RATION = 1064 , LAYER_COMPS = 1065 ,
  ALTERNATE_DUOTONE = 1066 , ALTERNATE_SPOT , LAYER_SELECTION_ID = 1069 , HDR_TONING = 1070 ,
  CS2_PRINT_INFO = 1071 , LAYER_GROUP_ENABLED_ID = 1072 , COLOR_SAMPLERS = 1073 , MEASUREMENT_SCALE = 1074 ,
  TIMELINE_INFO = 1075 , SHEET_DISCLOSURE = 1076 , CS3_DISPLAY_INFO = 1077 , ONION_SKINS = 1078 ,
  COUNT_INFO = 1080 , CS5_PRINT_INFO = 1082 , CS5_PRINT_STYLE = 1083 , CS5_NSPrintInfo = 1084 ,
  CS5_WIN_DEVMODE = 1085 , CS6_AUTOSAVE_FILE_PATH , CS6_AUTOSAVE_FORMAT , CC_PATH_SELECTION_SATE = 1088 ,
  PATH_INFO_FIRST = 2000 , PATH_INFO_LAST = 2998 , CLIPPING_PATH = 2999 , CC_ORIGIN_PATH_INFO = 3000 ,
  PLUGIN_RESOURCE_START = 4000 , PLUGIN_RESOURCE_END = 4999 , IMAGE_READY_VARS = 7000 , IMAGE_READY_DATA_SETS = 7001 ,
  LIGHTROOM_WORKFLOW = 8000 , PRINT_FLAGS_2 = 10000
}
 

Public Member Functions

 PSDImageResourceSection ()
 
bool read (QIODevice &io)
 
bool valid ()
 
bool write (QIODevice &io)
 
 ~PSDImageResourceSection ()
 

Static Public Member Functions

static QString idToString (PSDResourceID id)
 

Public Attributes

QString error
 
QMap< PSDResourceID, PSDResourceBlock * > resources
 

Detailed Description

loads all the resource sections

Definition at line 20 of file psd_resource_section.h.

Member Enumeration Documentation

◆ PSDResourceID

Enumerator
UNKNOWN 
PS2_IMAGE_INFO 
MAC_PRINT_INFO 
PS2_COLOR_TAB 
RESN_INFO 
ALPHA_NAMES 
DISPLAY_INFO 
CAPTION 
BORDER_INFO 
BACKGROUND_COL 
PRINT_FLAGS 
GREY_HALFTONE 
COLOR_HALFTONE 
DUOTONE_HALFTONE 
GREY_XFER 
COLOR_XFER 
DUOTONE_XFER 
DUOTONE_INFO 
EFFECTIVE_BW 
OBSOLETE_01 
EPS_OPT 
QUICK_MASK 
OBSOLETE_02 
LAYER_STATE 
WORKING_PATH 
LAYER_GROUP 
OBSOLETE_03 
IPTC_NAA_DATA 
IMAGE_MODE_RAW 
JPEG_QUAL 
GRID_GUIDE 
THUMB_RES 
COPYRIGHT_FLG 
URL 
THUMB_RES2 
GLOBAL_ANGLE 
COLOR_SAMPLER 
ICC_PROFILE 
WATERMARK 
ICC_UNTAGGED 
EFFECTS_VISIBLE 
SPOT_HALFTONE 
DOC_IDS 
ALPHA_NAMES_UNI 
IDX_COL_TAB_CNT 
IDX_TRANSPARENT 
GLOBAL_ALT 
SLICES 
WORKFLOW_URL_UNI 
JUMP_TO_XPEP 
ALPHA_ID 
URL_LIST_UNI 
VERSION_INFO 
EXIF_DATA 
EXIF_DATA_3 
XMP_DATA 
CAPTION_DIGEST 
PRINT_SCALE 
PIXEL_ASPECT_RATION 
LAYER_COMPS 
ALTERNATE_DUOTONE 
ALTERNATE_SPOT 
LAYER_SELECTION_ID 
HDR_TONING 
CS2_PRINT_INFO 
LAYER_GROUP_ENABLED_ID 
COLOR_SAMPLERS 
MEASUREMENT_SCALE 
TIMELINE_INFO 
SHEET_DISCLOSURE 
CS3_DISPLAY_INFO 
ONION_SKINS 
COUNT_INFO 
CS5_PRINT_INFO 
CS5_PRINT_STYLE 
CS5_NSPrintInfo 
CS5_WIN_DEVMODE 
CS6_AUTOSAVE_FILE_PATH 
CS6_AUTOSAVE_FORMAT 
CC_PATH_SELECTION_SATE 
PATH_INFO_FIRST 
PATH_INFO_LAST 
CLIPPING_PATH 
CC_ORIGIN_PATH_INFO 
PLUGIN_RESOURCE_START 
PLUGIN_RESOURCE_END 
IMAGE_READY_VARS 
IMAGE_READY_DATA_SETS 
LIGHTROOM_WORKFLOW 
PRINT_FLAGS_2 

Definition at line 23 of file psd_resource_section.h.

23 {
24 UNKNOWN = 0,
25
26 PS2_IMAGE_INFO = 1000, /* 0x03e8 - Obsolete - ps 2.0 image info */
27 MAC_PRINT_INFO = 1001, /* 0x03e9 - Optional - Mac print manager print info record */
28 PS2_COLOR_TAB = 1003, /* 0x03eb - Obsolete - ps 2.0 indexed color table */
29 RESN_INFO = 1005, /* 0x03ed - ResolutionInfo structure */
30 ALPHA_NAMES = 1006, /* 0x03ee - Alpha channel names */
31 DISPLAY_INFO = 1007, /* 0x03ef - DisplayInfo structure */
32 CAPTION = 1008, /* 0x03f0 - Optional - Caption string */
33 BORDER_INFO = 1009, /* 0x03f1 - Border info */
34
35 BACKGROUND_COL = 1010, /* 0x03f2 - Background color */
36 PRINT_FLAGS = 1011, /* 0x03f3 - Print flags */
37 GREY_HALFTONE = 1012, /* 0x03f4 - Greyscale and multichannel halftoning info */
38 COLOR_HALFTONE = 1013, /* 0x03f5 - Color halftoning info */
39 DUOTONE_HALFTONE = 1014, /* 0x03f6 - Duotone halftoning info */
40 GREY_XFER = 1015, /* 0x03f7 - Greyscale and multichannel transfer functions */
41 COLOR_XFER = 1016, /* 0x03f8 - Color transfer functions */
42 DUOTONE_XFER = 1017, /* 0x03f9 - Duotone transfer functions */
43 DUOTONE_INFO = 1018, /* 0x03fa - Duotone image information */
44 EFFECTIVE_BW = 1019, /* 0x03fb - Effective black & white values for dot range */
45
46 OBSOLETE_01 = 1020, /* 0x03fc - Obsolete */
47 EPS_OPT = 1021, /* 0x03fd - EPS options */
48 QUICK_MASK = 1022, /* 0x03fe - Quick mask info */
49 OBSOLETE_02 = 1023, /* 0x03ff - Obsolete */
50 LAYER_STATE = 1024, /* 0x0400 - Layer state info */
51 WORKING_PATH = 1025, /* 0x0401 - Working path (not saved) */
52 LAYER_GROUP = 1026, /* 0x0402 - Layers group info */
53 OBSOLETE_03 = 1027, /* 0x0403 - Obsolete */
54 IPTC_NAA_DATA = 1028, /* 0x0404 - IPTC-NAA record (IMV4.pdf) */
55 IMAGE_MODE_RAW = 1029, /* 0x0405 - Image mode for raw format files */
56
57 JPEG_QUAL = 1030, /* 0x0406 - JPEG quality */
58 GRID_GUIDE = 1032, /* 0x0408 - Grid & guide info */
59 THUMB_RES = 1033, /* 0x0409 - Thumbnail resource */
60 COPYRIGHT_FLG = 1034, /* 0x040a - Copyright flag */
61 URL = 1035, /* 0x040b - URL string */
62 THUMB_RES2 = 1036, /* 0x040c - Thumbnail resource */
63 GLOBAL_ANGLE = 1037, /* 0x040d - Global angle */
64 COLOR_SAMPLER = 1038, /* 0x040e - Color samplers resource */
65 ICC_PROFILE = 1039, /* 0x040f - ICC Profile */
66
67 WATERMARK = 1040, /* 0x0410 - Watermark */
68 ICC_UNTAGGED = 1041, /* 0x0411 - Do not use ICC profile flag */
69 EFFECTS_VISIBLE = 1042, /* 0x0412 - Show / hide all effects layers */
70 SPOT_HALFTONE = 1043, /* 0x0413 - Spot halftone */
71 DOC_IDS = 1044, /* 0x0414 - Document specific IDs */
72 ALPHA_NAMES_UNI = 1045, /* 0x0415 - Unicode alpha names */
73 IDX_COL_TAB_CNT = 1046, /* 0x0416 - Indexed color table count */
74 IDX_TRANSPARENT = 1047, /* 0x0417 - Index of transparent color (if any) */
75 GLOBAL_ALT = 1049, /* 0x0419 - Global altitude */
76
77 SLICES = 1050, /* 0x041a - Slices */
78 WORKFLOW_URL_UNI = 1051, /* 0x041b - Workflow URL - Unicode string */
79 JUMP_TO_XPEP = 1052, /* 0x041c - Jump to XPEP (?) */
80 ALPHA_ID = 1053, /* 0x041d - Alpha IDs */
81 URL_LIST_UNI = 1054, /* 0x041e - URL list - unicode */
82 VERSION_INFO = 1057, /* 0x0421 - Version info */
83 EXIF_DATA = 1058, /* 0x0422 - (Photoshop 7.0) EXIF data 1. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf */
84 EXIF_DATA_3 = 1059, /* 0x0423 - (Photoshop 7.0) EXIF data 3. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf */
85
86 XMP_DATA = 1060, /* 0x0424 - XMP data block */
87 CAPTION_DIGEST = 1061, /* 0x0425 - (Photoshop 7.0) Caption digest. 16 bytes: RSA Data Security, MD5 message-digest algorithm */
88 PRINT_SCALE = 1062, /* 0x0426 - (Photoshop 7.0) Print scale. 2 bytes style (0 = centered, 1 = size to fit, 2 = user defined). 4 bytes x location
89 (floating point). 4 bytes y location (floating point). 4 bytes scale (floating point) */
90 PIXEL_ASPECT_RATION = 1064, /* 0x0428 - (Photoshop CS) Pixel Aspect Ratio. 4 bytes (version = 1 or 2), 8 bytes double, x / y of a pixel. Version 2,
91 attempting to correct values for NTSC and PAL, previously off by a factor of approx. 5%. */
92 LAYER_COMPS = 1065, /* 0x0429 - (Photoshop CS) Layer Comps. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
93 ALTERNATE_DUOTONE = 1066, /* 0x042A - (Photoshop CS) Alternate Duotone Colors. 2 bytes (version = 1), 2 bytes count, following is repeated for each
94 count: [ Color: 2 bytes for space followed by 4 * 2 byte color component ], following this is another 2 byte count, usually
95 256, followed by Lab colors one byte each for L, a, b. This resource is not read or used by Photoshop. */
97 1067, /* 0x042B - (Photoshop CS)Alternate Spot Colors. 2 bytes (version = 1), 2 bytes channel count, following is repeated for each count: 4 bytes
98 channel ID, Color: 2 bytes for space followed by 4 * 2 byte color component. This resource is not read or used by Photoshop. */
99 LAYER_SELECTION_ID = 1069, /* 0x042D - (Photoshop CS2) Layer Selection ID(s). 2 bytes count, following is repeated for each count: 4 bytes layer ID */
100
101 HDR_TONING = 1070, /* 0x042E - (Photoshop CS2) HDR Toning information */
102 CS2_PRINT_INFO = 1071, /* 0x042F - (Photoshop CS2) Print info */
103 LAYER_GROUP_ENABLED_ID = 1072, /* 0x0430 - (Photoshop CS2) Layer Group(s) Enabled ID. 1 byte for each layer in the document, repeated by length of the
104 resource. NOTE: Layer groups have start and end markers */
105 COLOR_SAMPLERS = 1073, /* 0x0431 - (Photoshop CS3) Color samplers resource. Also see ID 1038 for old format. See Color samplers resource format. */
106 MEASUREMENT_SCALE = 1074, /* 0x0432 - (Photoshop CS3) Measurement Scale. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
107 TIMELINE_INFO = 1075, /* 0x0433 - (Photoshop CS3) Timeline Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
108 SHEET_DISCLOSURE = 1076, /* 0x0434 - (Photoshop CS3) Sheet Disclosure. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
109 CS3_DISPLAY_INFO = 1077, /* 0x0435 - (Photoshop CS3) DisplayInfo structure to support floating point colors. Also see ID 1007. See Appendix A in
110 Photoshop API Guide.pdf . */
111 ONION_SKINS = 1078, /* 0x0436 - (Photoshop CS3) Onion Skins. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) */
112
113 COUNT_INFO = 1080, /* 0x0438 - (Photoshop CS4) Count Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)
114 Information about the count in the document. See the Count Tool. */
115 CS5_PRINT_INFO = 1082, /* 0x043A - (Photoshop CS5) Print Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)
116 Information about the current print settings in the document. The color management options. */
117 CS5_PRINT_STYLE = 1083, /* 0x043B - (Photoshop CS5) Print Style. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)
118 Information about the current print style in the document. The printing marks, labels, ornaments, etc. */
119 CS5_NSPrintInfo = 1084, /* 0x043C - (Photoshop CS5) Macintosh NSPrintInfo. Variable OS specific info for Macintosh. NSPrintInfo. It is recommended that
120 you do not interpret or use this data. */
121 CS5_WIN_DEVMODE = 1085, /* 0x043D - (Photoshop CS5) Windows DEVMODE. Variable OS specific info for Windows. DEVMODE. It is recommended that you do not
122 interpret or use this data. */
124 1086, /* 0x043E - (Photoshop CS6) Auto Save File Path. Unicode string. It is recommended that you do not interpret or use this data. */
126 1087, /* 0x043F - (Photoshop CS6) Auto Save Format. Unicode string. It is recommended that you do not interpret or use this data. */
127 CC_PATH_SELECTION_SATE = 1088, /* 0x0440 - (Photoshop CC) Path Selection State. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor
128 structure) Information about the current path selection state. */
129
130 PATH_INFO_FIRST = 2000, /* 0x07d0 - First path info block */
131 PATH_INFO_LAST = 2998, /* 0x0bb6 - Last path info block */
132 CLIPPING_PATH = 2999, /* 0x0bb7 - Name of clipping path */
133
134 CC_ORIGIN_PATH_INFO = 3000, /* 0x0BB8 (Photoshop CC) Origin Path Info. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)
135 Information about the origin path data. */
136
137 PLUGIN_RESOURCE_START = 4000, /* 0x0FA0-0x1387 Plug-In resource(s). Resources added by a plug-in. See the plug-in API found in the SDK documentation */
138 PLUGIN_RESOURCE_END = 4999, /* Last plug-in resource */
139
140 IMAGE_READY_VARS = 7000, /* 0x1B58 Image Ready variables. XML representation of variables definition */
141 IMAGE_READY_DATA_SETS = 7001, /* 0x1B59 Image Ready data sets */
142
143 LIGHTROOM_WORKFLOW = 8000, /* 0x1F40 (Photoshop CS3) Lightroom workflow, if present the document is in the middle of a Lightroom workflow. */
144
145 PRINT_FLAGS_2 = 10000 /* 0x2710 - Print flags */
146 };

Constructor & Destructor Documentation

◆ PSDImageResourceSection()

PSDImageResourceSection::PSDImageResourceSection ( )

Definition at line 16 of file psd_resource_section.cpp.

17{
18}

◆ ~PSDImageResourceSection()

PSDImageResourceSection::~PSDImageResourceSection ( )

Definition at line 20 of file psd_resource_section.cpp.

21{
22 resources.clear();
23}
QMap< PSDResourceID, PSDResourceBlock * > resources

References resources.

Member Function Documentation

◆ idToString()

QString PSDImageResourceSection::idToString ( PSDImageResourceSection::PSDResourceID id)
static

Definition at line 101 of file psd_resource_section.cpp.

102{
103 switch (id) {
104 case UNKNOWN:
105 return "Unknown";
106
107 case PS2_IMAGE_INFO:
108 return "0x03e8 - Obsolete - ps 2.0 image info";
109 case MAC_PRINT_INFO:
110 return "0x03e9 - Optional - Mac print manager print info record";
111 case PS2_COLOR_TAB:
112 return "0x03eb - Obsolete - ps 2.0 indexed color table";
113 case RESN_INFO:
114 return "0x03ed - ResolutionInfo structure";
115 case ALPHA_NAMES:
116 return "0x03ee - Alpha channel names";
117 case DISPLAY_INFO:
118 return "0x03ef - DisplayInfo structure";
119 case CAPTION:
120 return "0x03f0 - Optional - Caption string";
121 case BORDER_INFO:
122 return "0x03f1 - Border info";
123
124 case BACKGROUND_COL:
125 return "0x03f2 - Background color";
126 case PRINT_FLAGS:
127 return "0x03f3 - Print flags";
128 case GREY_HALFTONE:
129 return "0x03f4 - Greyscale and multichannel halftoning info";
130 case COLOR_HALFTONE:
131 return "0x03f5 - Color halftoning info";
132 case DUOTONE_HALFTONE:
133 return "0x03f6 - Duotone halftoning info";
134 case GREY_XFER:
135 return "0x03f7 - Greyscale and multichannel transfer functions";
136 case COLOR_XFER:
137 return "0x03f8 - Color transfer functions";
138 case DUOTONE_XFER:
139 return "0x03f9 - Duotone transfer functions";
140 case DUOTONE_INFO:
141 return "0x03fa - Duotone image information";
142 case EFFECTIVE_BW:
143 return "0x03fb - Effective black & white values for dot range";
144
145 case OBSOLETE_01:
146 return "0x03fc - Obsolete";
147 case EPS_OPT:
148 return "0x03fd - EPS options";
149 case QUICK_MASK:
150 return "0x03fe - Quick mask info";
151 case OBSOLETE_02:
152 return "0x03ff - Obsolete";
153 case LAYER_STATE:
154 return "0x0400 - Layer state info";
155 case WORKING_PATH:
156 return "0x0401 - Working path (not saved)";
157 case LAYER_GROUP:
158 return "0x0402 - Layers group info";
159 case OBSOLETE_03:
160 return "0x0403 - Obsolete";
161 case IPTC_NAA_DATA:
162 return "0x0404 - IPTC-NAA record (IMV4.pdf)";
163 case IMAGE_MODE_RAW:
164 return "0x0405 - Image mode for raw format files";
165
166 case JPEG_QUAL:
167 return "0x0406 - JPEG quality";
168 case GRID_GUIDE:
169 return "0x0408 - Grid & guide info";
170 case THUMB_RES:
171 return "0x0409 - Thumbnail resource";
172 case COPYRIGHT_FLG:
173 return "0x040a - Copyright flag";
174 case URL:
175 return "0x040b - URL string";
176 case THUMB_RES2:
177 return "0x040c - Thumbnail resource";
178 case GLOBAL_ANGLE:
179 return "0x040d - Global angle";
180 case COLOR_SAMPLER:
181 return "0x040e - Color samplers resource";
182 case ICC_PROFILE:
183 return "0x040f - ICC Profile";
184
185 case WATERMARK:
186 return "0x0410 - Watermark";
187 case ICC_UNTAGGED:
188 return "0x0411 - Do not use ICC profile flag";
189 case EFFECTS_VISIBLE:
190 return "0x0412 - Show / hide all effects layers";
191 case SPOT_HALFTONE:
192 return "0x0413 - Spot halftone";
193 case DOC_IDS:
194 return "0x0414 - Document specific IDs";
195 case ALPHA_NAMES_UNI:
196 return "0x0415 - Unicode alpha names";
197 case IDX_COL_TAB_CNT:
198 return "0x0416 - Indexed color table count";
199 case IDX_TRANSPARENT:
200 return "0x0417 - Index of transparent color (if any)";
201 case GLOBAL_ALT:
202 return "0x0419 - Global altitude";
203
204 case SLICES:
205 return "0x041a - Slices";
206 case WORKFLOW_URL_UNI:
207 return "0x041b - Workflow URL - Unicode string";
208 case JUMP_TO_XPEP:
209 return "0x041c - Jump to XPEP (?)";
210 case ALPHA_ID:
211 return "0x041d - Alpha IDs";
212 case URL_LIST_UNI:
213 return "0x041e - URL list - unicode";
214 case VERSION_INFO:
215 return "0x0421 - Version info";
216 case EXIF_DATA:
217 return "0x0422 - (Photoshop 7.0) EXIF data 1. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf";
218 case EXIF_DATA_3:
219 return "0x0423 - (Photoshop 7.0) EXIF data 3. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf";
220
221 case XMP_DATA:
222 return "0x0424 - XMP data block";
223 case CAPTION_DIGEST:
224 return "0x0425 - (Photoshop 7.0) Caption digest. 16 bytes: RSA Data Security, MD5 message-digest algorithm";
225 case PRINT_SCALE:
226 return "0x0426 - (Photoshop 7.0) Print scale. 2 bytes style (0 = centered, 1 = size to fit, 2 = user defined). 4 bytes x location (floating point). 4 "
227 "bytes y location (floating point). 4 bytes scale (floating point)";
229 return "0x0428 - (Photoshop CS) Pixel Aspect Ratio. 4 bytes (version = 1 or 2), 8 bytes double, x / y of a pixel. Version 2, attempting to correct "
230 "values for NTSC and PAL, previously off by a factor of approx. 5%.";
231 case LAYER_COMPS:
232 return "0x0429 - (Photoshop CS) Layer Comps. 4 bytes (descriptor version = 16), Descriptor (see Descriptor structure)";
234 return "0x042A - (Photoshop CS) Alternate Duotone Colors. 2 bytes (version = 1), 2 bytes count, following is repeated for each count: [ Color: 2 bytes "
235 "for space followed by 4 * 2 byte color component ], following this is another 2 byte count, usually 256, followed by Lab colors one byte each "
236 "for L, a, b. This resource is not read or used by Photoshop.";
237 case ALTERNATE_SPOT:
238 return "0x042B - (Photoshop CS)Alternate Spot Colors. 2 bytes (version = 1), 2 bytes channel count, following is repeated for each count: 4 bytes "
239 "channel ID, Color: 2 bytes for space followed by 4 * 2 byte color component. This resource is not read or used by Photoshop.";
241 return "0x042D - (Photoshop CS2) Layer Selection ID(s). 2 bytes count, following is repeated for each count: 4 bytes layer ID";
242
243 case HDR_TONING:
244 return "0x042E - (Photoshop CS2) HDR Toning information";
245 case CS2_PRINT_INFO:
246 return "0x042F - (Photoshop CS2) Print info";
248 return "0x0430 - (Photoshop CS2) Layer Group(s) Enabled ID. 1 byte for each layer in the document, repeated by length of the resource. NOTE: Layer "
249 "groups have start and end markers";
250 case COLOR_SAMPLERS:
251 return "0x0431 - (Photoshop CS3) Color samplers resource. Also see ID 1038 for old format. See Color samplers resource format.";
253 return "0x0432 - (Photoshop CS3) Measurement Scale. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)";
254 case TIMELINE_INFO:
255 return "0x0433 - (Photoshop CS3) Timeline Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)";
256 case SHEET_DISCLOSURE:
257 return "0x0434 - (Photoshop CS3) Sheet Disclosure. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)";
258 case CS3_DISPLAY_INFO:
259 return "0x0435 - (Photoshop CS3) DisplayInfo structure to support floating point colors. Also see ID 1007. See Appendix A in Photoshop API Guide.pdf .";
260 case ONION_SKINS:
261 return "0x0436 - (Photoshop CS3) Onion Skins. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)";
262
263 case COUNT_INFO:
264 return "0x0438 - (Photoshop CS4) Count Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the "
265 "count in the document. See the Count Tool.";
266 case CS5_PRINT_INFO:
267 return "0x043A - (Photoshop CS5) Print Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the "
268 "current print settings in the document. The color management options.";
269 case CS5_PRINT_STYLE:
270 return "0x043B - (Photoshop CS5) Print Style. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the "
271 "current print style in the document. The printing marks, labels, ornaments, etc.";
272 case CS5_NSPrintInfo:
273 return "0x043C - (Photoshop CS5) Macintosh NSPrintInfo. Variable OS specific info for Macintosh. NSPrintInfo. It is recommended that you do not "
274 "interpret or use this data.";
275 case CS5_WIN_DEVMODE:
276 return "0x043D - (Photoshop CS5) Windows DEVMODE. Variable OS specific info for Windows. DEVMODE. It is recommended that you do not interpret or use "
277 "this data.";
279 return "0x043E - (Photoshop CS6) Auto Save File Path. Unicode string. It is recommended that you do not interpret or use this data.";
281 return "0x043F - (Photoshop CS6) Auto Save Format. Unicode string. It is recommended that you do not interpret or use this data.";
283 return "0x0440 - (Photoshop CC) Path Selection State. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about "
284 "the current path selection state.";
285
286 case PATH_INFO_FIRST:
287 return "0x07d0 - First path info block";
288 case PATH_INFO_LAST:
289 return "0x0bb6 - Last path info block";
290 case CLIPPING_PATH:
291 return "0x0bb7 - Name of clipping path";
292
294 return "0x0BB8 (Photoshop CC) Origin Path Info. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the "
295 "origin path data.";
296
298 return "0x0FA0-0x1387 Plug-In resource(s). Resources added by a plug-in. See the plug-in API found in the SDK documentation ";
300 return "Last plug-in resource";
301
302 case IMAGE_READY_VARS:
303 return "0x1B58 Image Ready variables. XML representation of variables definition";
305 return "0x1B59 Image Ready data sets";
306
308 return "0x1F40 (Photoshop CS3) Lightroom workflow, if present the document is in the middle of a Lightroom workflow.";
309
310 case PRINT_FLAGS_2:
311 return "0x2710 - Print flags";
312 default: {
313 if (id > PATH_INFO_FIRST && id < PATH_INFO_LAST)
314 return "Path Info Block";
316 return "Plug-In Resource";
317 }
318 };
319 return QString("Unknown Resource Block: %1").arg(id);
320}

References ALPHA_ID, ALPHA_NAMES, ALPHA_NAMES_UNI, ALTERNATE_DUOTONE, ALTERNATE_SPOT, BACKGROUND_COL, BORDER_INFO, CAPTION, CAPTION_DIGEST, CC_ORIGIN_PATH_INFO, CC_PATH_SELECTION_SATE, CLIPPING_PATH, COLOR_HALFTONE, COLOR_SAMPLER, COLOR_SAMPLERS, COLOR_XFER, COPYRIGHT_FLG, COUNT_INFO, CS2_PRINT_INFO, CS3_DISPLAY_INFO, CS5_NSPrintInfo, CS5_PRINT_INFO, CS5_PRINT_STYLE, CS5_WIN_DEVMODE, CS6_AUTOSAVE_FILE_PATH, CS6_AUTOSAVE_FORMAT, DISPLAY_INFO, DOC_IDS, DUOTONE_HALFTONE, DUOTONE_INFO, DUOTONE_XFER, EFFECTIVE_BW, EFFECTS_VISIBLE, EPS_OPT, EXIF_DATA, EXIF_DATA_3, GLOBAL_ALT, GLOBAL_ANGLE, GREY_HALFTONE, GREY_XFER, GRID_GUIDE, HDR_TONING, ICC_PROFILE, ICC_UNTAGGED, IDX_COL_TAB_CNT, IDX_TRANSPARENT, IMAGE_MODE_RAW, IMAGE_READY_DATA_SETS, IMAGE_READY_VARS, IPTC_NAA_DATA, JPEG_QUAL, JUMP_TO_XPEP, LAYER_COMPS, LAYER_GROUP, LAYER_GROUP_ENABLED_ID, LAYER_SELECTION_ID, LAYER_STATE, LIGHTROOM_WORKFLOW, MAC_PRINT_INFO, MEASUREMENT_SCALE, OBSOLETE_01, OBSOLETE_02, OBSOLETE_03, ONION_SKINS, PATH_INFO_FIRST, PATH_INFO_LAST, PIXEL_ASPECT_RATION, PLUGIN_RESOURCE_END, PLUGIN_RESOURCE_START, PRINT_FLAGS, PRINT_FLAGS_2, PRINT_SCALE, PS2_COLOR_TAB, PS2_IMAGE_INFO, QUICK_MASK, RESN_INFO, SHEET_DISCLOSURE, SLICES, SPOT_HALFTONE, THUMB_RES, THUMB_RES2, TIMELINE_INFO, UNKNOWN, URL, URL_LIST_UNI, VERSION_INFO, WATERMARK, WORKFLOW_URL_UNI, WORKING_PATH, and XMP_DATA.

◆ read()

bool PSDImageResourceSection::read ( QIODevice & io)

Definition at line 25 of file psd_resource_section.cpp.

26{
27 quint32 resourceSectionLength = 0;
28 if (!psdread(io, resourceSectionLength)) {
29 error = "Could not read image resource section length";
30 return false;
31 }
32
33 dbgFile << "Image Resource Sectionlength:" << resourceSectionLength << ", starts at:" << io.pos();
34
35 QByteArray ba = io.read(resourceSectionLength);
36 if ((quint32)ba.size() != resourceSectionLength) {
37 error = "Could not read all resources";
38 return false;
39 }
40
41 QBuffer buf;
42 buf.setBuffer(&ba);
43 buf.open(QBuffer::ReadOnly);
44
45 while (!buf.atEnd()) {
47 if (!block->read(buf)) {
48 error = "Error reading block: " + block->error;
49 dbgFile << error << ", skipping.";
50 delete block;
51 continue;
52 }
53 dbgFile << "resource block created. Type:" << block->identifier << "name" << block->name << "size" << block->dataSize << "," << buf.bytesAvailable()
54 << "bytes to go";
55
56 resources[(PSDResourceID)block->identifier] = block;
57 }
58
59 dbgFile << "Read" << resources.size() << "Image Resource Blocks";
60
61 return valid();
62}
#define dbgFile
Definition kis_debug.h:53
std::enable_if_t< std::is_arithmetic< T >::value, bool > psdread(QIODevice &io, T &v)
Definition psd_utils.h:397

References dbgFile, error, psdread(), resources, and valid().

◆ valid()

bool PSDImageResourceSection::valid ( )

Definition at line 96 of file psd_resource_section.cpp.

97{
98 return true;
99}

◆ write()

bool PSDImageResourceSection::write ( QIODevice & io)

Definition at line 64 of file psd_resource_section.cpp.

65{
66 Q_UNUSED(io);
67
68 if (!valid()) {
69 error = "Resource Section is Invalid";
70 return false;
71 }
72 // First write all the sections
73 QByteArray ba;
74 QBuffer buf;
75 buf.setBuffer(&ba);
76 buf.open(QBuffer::WriteOnly);
77
78 Q_FOREACH (PSDResourceBlock *block, resources) {
79 if (!block->write(buf)) {
80 error = block->error;
81 return false;
82 }
83 }
84
85 buf.close();
86
87 // Then get the size
88 quint32 resourceBlockLength = ba.size();
89 dbgFile << "resource section has size" << resourceBlockLength;
90 psdwrite(io, resourceBlockLength);
91
92 // and write the whole buffer;
93 return (io.write(ba.constData(), ba.size()) == resourceBlockLength);
94}
std::enable_if_t< std::is_arithmetic< T >::value, bool > psdwrite(QIODevice &io, T v)
Definition psd_utils.h:170

References dbgFile, error, psdwrite(), resources, and valid().

Member Data Documentation

◆ error

QString PSDImageResourceSection::error

Definition at line 159 of file psd_resource_section.h.

◆ resources

QMap<PSDResourceID, PSDResourceBlock *> PSDImageResourceSection::resources

Definition at line 157 of file psd_resource_section.h.


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