Krita Source Code Documentation
Loading...
Searching...
No Matches
psd_resource_section.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2009 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef PSD_RESOURCE_SECTION_H
7#define PSD_RESOURCE_SECTION_H
8
9#include "kritapsd_export.h"
10
11#include <QMap>
12#include <QString>
13
14class QIODevice;
16
20class KRITAPSD_EXPORT PSDImageResourceSection
21{
22public:
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. */
96 ALTERNATE_SPOT =
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. */
123 CS6_AUTOSAVE_FILE_PATH =
124 1086, /* 0x043E - (Photoshop CS6) Auto Save File Path. Unicode string. It is recommended that you do not interpret or use this data. */
125 CS6_AUTOSAVE_FORMAT =
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 };
147
150
151 bool read(QIODevice &io);
152 bool write(QIODevice &io);
153 bool valid();
154
155 static QString idToString(PSDResourceID id);
156
157 QMap<PSDResourceID, PSDResourceBlock *> resources;
158
159 QString error;
160};
161
162#endif // PSD_RESOURCE_SECTION_H
QMap< PSDResourceID, PSDResourceBlock * > resources