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

#include <kis_tiff_psd_resource_record.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

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

Static Public Member Functions

static QString idToString (PSDResourceID id)
 

Public Attributes

QString error
 
QMap< PSDResourceID, PSDResourceBlock * > resources
 

Detailed Description

This class hosts all resource blocks from a TIFF's TIFFTAG_PHOTOSHOP field. Unlike its PSD counterpart (PSDResourceSection), TIFF's is only a concatenation of blocks.

WARNING: This record is always in big endian, irrespective of the container's endianness.

Definition at line 28 of file kis_tiff_psd_resource_record.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 31 of file kis_tiff_psd_resource_record.h.

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

Constructor & Destructor Documentation

◆ KisTiffPsdResourceRecord()

KisTiffPsdResourceRecord::KisTiffPsdResourceRecord ( )

Definition at line 16 of file kis_tiff_psd_resource_record.cpp.

17{
18}

◆ ~KisTiffPsdResourceRecord()

KisTiffPsdResourceRecord::~KisTiffPsdResourceRecord ( )

Definition at line 20 of file kis_tiff_psd_resource_record.cpp.

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

References resources.

Member Function Documentation

◆ idToString()

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

Definition at line 81 of file kis_tiff_psd_resource_record.cpp.

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

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 KisTiffPsdResourceRecord::read ( QIODevice & io)

Definition at line 25 of file kis_tiff_psd_resource_record.cpp.

26{
27 // Unlike its PSD counterpart (PSDResourceSection), TIFF resource
28 // records are just a concatenation of resource blocks.
29
30 while (!buf.atEnd()) {
32 if (!block->read(buf)) {
33 error = "Error reading block: " + block->error;
34 dbgFile << error << ", skipping.";
35 delete block;
36 continue;
37 }
38 dbgFile << "resource block created. Type:" << block->identifier << "name" << block->name << "size" << block->dataSize << "," << buf.bytesAvailable()
39 << "bytes to go";
40
41 resources[(PSDResourceID)block->identifier] = block;
42 }
43
44 dbgFile << "Read" << resources.size() << "Image Resource Blocks";
45
46 return valid();
47}
#define dbgFile
Definition kis_debug.h:53

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

◆ valid()

bool KisTiffPsdResourceRecord::valid ( )

Definition at line 76 of file kis_tiff_psd_resource_record.cpp.

77{
78 return true;
79}

◆ write()

bool KisTiffPsdResourceRecord::write ( QIODevice & io)

Definition at line 49 of file kis_tiff_psd_resource_record.cpp.

50{
51 if (!valid()) {
52 error = "Resource Section is Invalid";
53 return false;
54 }
55 // write all the sections
56 QBuffer buf;
57 buf.open(QBuffer::WriteOnly);
58
59 for (const PSDResourceBlock *block : resources) {
60 if (!block->write(buf)) {
61 error = block->error;
62 return false;
63 }
64 }
65
66 buf.close();
67
68 // Then get the size
69 qint64 resourceSectionLength = buf.size();
70 dbgFile << "resource section has size" << resourceSectionLength;
71
72 // and write the whole buffer
73 return (io.write(buf.data()) == resourceSectionLength);
74}

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

Member Data Documentation

◆ error

QString KisTiffPsdResourceRecord::error

Definition at line 167 of file kis_tiff_psd_resource_record.h.

◆ resources

QMap<PSDResourceID, PSDResourceBlock *> KisTiffPsdResourceRecord::resources

Definition at line 165 of file kis_tiff_psd_resource_record.h.


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