1
1
mirror of https://github.com/wader/fq.git synced 2024-11-23 00:57:15 +03:00
fq/format/jpeg/ps_irids.go
Mattias Wadman 2fc0a71a47 decode: Refactor scalar usage
Move scalar into own package.
Split scalar code into decode related scalar code (that reads etc) and
scalar code that just transform the scalar value.
Use a scalar.Mapper interface instead of just a function.
Make mappers, assert and validat impement the interface.
2021-12-02 17:39:26 +01:00

101 lines
12 KiB
Go

package jpeg
import "github.com/wader/fq/pkg/scalar"
// based on https://www.adobe.com/devnet-apps/photoshop/fileformatashtml
var psImageResourceBlockNames = scalar.UToScalar{
0x03E8: {Description: `Contains five 2-byte values: number of channels, rows, columns, depth, and mode`},
0x03E9: {Description: `Macintosh print manager print info record`},
0x03EA: {Description: `Macintosh page format information. No longer read by Photoshop. (Obsolete)`},
0x03EB: {Description: `Indexed color table`},
0x03ED: {Description: `ResolutionInfo structure. See Appendix A in Photoshop API Guide.pdf`},
0x03EE: {Description: `Names of the alpha channels as a series of Pascal strings`},
0x03EF: {Description: `(Obsolete) See ID 1077DisplayInfo structure. See Appendix A in Photoshop API Guide.pdf`},
0x03F0: {Description: `The caption as a Pascal string`},
0x03F1: {Description: `Border information. Contains a fixed number (2 bytes real, 2 bytes fraction) for the border width, and 2 bytes for border units (1 = inches, 2 = cm, 3 = points, 4 = picas, 5 = columns)`},
0x03F2: {Description: `Background color. See See Color structure`},
0x03F3: {Description: `Print flags. A series of one-byte boolean values (see Page Setup dialog): labels, crop marks, color bars, registration marks, negative, flip, interpolate, caption, print flags`},
0x03F4: {Description: `Grayscale and multichannel halftoning information`},
0x03F5: {Description: `Color halftoning information`},
0x03F6: {Description: `Duotone halftoning information`},
0x03F7: {Description: `Grayscale and multichannel transfer function`},
0x03F8: {Description: `Color transfer functions`},
0x03F9: {Description: `Duotone transfer functions`},
0x03FA: {Description: `Duotone image information`},
0x03FB: {Description: `Two bytes for the effective black and white values for the dot range`},
0x03FC: {Description: `(Obsolete)`},
0x03FD: {Description: `EPS options`},
0x03FE: {Description: `Quick Mask information. 2 bytes containing Quick Mask channel ID; 1- byte boolean indicating whether the mask was initially empty`},
0x03FF: {Description: `(Obsolete)`},
0x0400: {Description: `Layer state information. 2 bytes containing the index of target layer (0 = bottom layer)`},
0x0401: {Description: `Working path (not saved). See See Path resource format`},
0x0402: {Description: `Layers group information. 2 bytes per layer containing a group ID for the dragging groups. Layers in a group have the same group ID`},
0x0403: {Description: `(Obsolete)`},
0x0404: {Description: `IPTC-NAA record. Contains the File Info... information. See the documentation in the IPTC folder of the Documentation folder`},
0x0405: {Description: `Image mode for raw format files`},
0x0406: {Description: `JPEG quality. Private`},
0x0408: {Description: `(Photoshop 4.0) Grid and guides information. See See Grid and guides resource format`},
0x0409: {Description: `(Photoshop 4.0) Thumbnail resource for Photoshop 4.0 only. See See Thumbnail resource format`},
0x040A: {Description: `(Photoshop 4.0) Copyright flag. Boolean indicating whether image is copyrighted. Can be set via Property suite or by user in File Info`},
0x040B: {Description: `(Photoshop 4.0) URL. Handle of a text string with uniform resource locator. Can be set via Property suite or by user in File Info`},
0x040C: {Description: `(Photoshop 5.0) Thumbnail resource (supersedes resource 1033). See See Thumbnail resource format`},
0x040D: {Description: `(Photoshop 5.0) Global Angle. 4 bytes that contain an integer between 0 and 359, which is the global lighting angle for effects layer. If not present, assumed to be 30`},
0x040E: {Description: `(Obsolete) See ID 1073 below. (Photoshop 5.0) Color samplers resource. See See Color samplers resource format`},
0x040F: {Description: `(Photoshop 5.0) ICC Profile. The raw bytes of an ICC (International Color Consortium) format profile. See ICC1v42_2006-05.pdf in the Documentation folder and icProfileHeader.h in Sample Code\Common\Includes `},
0x0410: {Description: `(Photoshop 5.0) Watermark. One byte`},
0x0411: {Description: `(Photoshop 5.0) ICC Untagged Profile. 1 byte that disables any assumed profile handling when opening the file. 1 = intentionally untagged`},
0x0412: {Description: `(Photoshop 5.0) Effects visible. 1-byte global flag to show/hide all the effects layer. Only present when they are hidden`},
0x0413: {Description: `(Photoshop 5.0) Spot Halftone. 4 bytes for version, 4 bytes for length, and the variable length data`},
0x0414: {Description: `(Photoshop 5.0) Document-specific IDs seed number. 4 bytes: Base value, starting at which layer IDs will be generated (or a greater value if existing IDs already exceed it). Its purpose is to avoid the case where we add layers, flatten, save, open, and then add more layers that end up with the same IDs as the first set`},
0x0415: {Description: `(Photoshop 5.0) Unicode Alpha Names. Unicode string`},
0x0416: {Description: `(Photoshop 6.0) Indexed Color Table Count. 2 bytes for the number of colors in table that are actually defined`},
0x0417: {Description: `(Photoshop 6.0) Transparency Index. 2 bytes for the index of transparent color, if any`},
0x0419: {Description: `(Photoshop 6.0) Global Altitude. 4 byte entry for altitude`},
0x041A: {Description: `(Photoshop 6.0) Slices. See See Slices resource format`},
0x041B: {Description: `(Photoshop 6.0) Workflow URL. Unicode string`},
0x041C: {Description: `(Photoshop 6.0) Jump To XPEP. 2 bytes major version, 2 bytes minor version, 4 bytes count. Following is repeated for count: 4 bytes block size, 4 bytes key, if key = 'jtDd' , then next is a Boolean for the dirty flag; otherwise it's a 4 byte entry for the mod date`},
0x041D: {Description: `(Photoshop 6.0) Alpha Identifiers. 4 bytes of length, followed by 4 bytes each for every alpha identifier`},
0x041E: {Description: `(Photoshop 6.0) URL List. 4 byte count of URLs, followed by 4 byte long, 4 byte ID, and Unicode string for each count`},
0x0421: {Description: `(Photoshop 6.0) Version Info. 4 bytes version, 1 byte hasRealMergedData , Unicode string: writer name, Unicode string: reader name, 4 bytes file version`},
0x0422: {Description: `(Photoshop 7.0) EXIF data 1. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf`},
0x0423: {Description: `(Photoshop 7.0) EXIF data 3. See http://www.kodak.com/global/plugins/acrobat/en/service/digCam/exifStandard2.pdf`},
0x0424: {Description: `(Photoshop 7.0) XMP metadata. File info as XML description. See http://www.adobe.com/devnet/xmp/`},
0x0425: {Description: `(Photoshop 7.0) Caption digest. 16 bytes: RSA Data Security, MD5 message-digest algorithm`},
0x0426: {Description: `(Photoshop 7.0) Print scale. 2 bytes style (0 = centered, 1 = size to fit, 2 = user defined). 4 bytes x location (floating point). 4 bytes y location (floating point). 4 bytes scale (floating point)`},
0x0428: {Description: `(Photoshop CS) Pixel Aspect Ratio. 4 bytes (version = 1 or 2), 8 bytes double, x / y of a pixel. Version 2, attempting to correct values for NTSC and PAL, previously off by a factor of approx. 5%`},
0x0429: {Description: `(Photoshop CS) Layer Comps. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)`},
0x042A: {Description: `(Photoshop CS) Alternate Duotone Colors. 2 bytes (version = 1), 2 bytes count, following is repeated for each count: [ Color: 2 bytes 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 for L, a, b. This resource is not read or used by Photoshop`},
0x042B: {Description: `(Photoshop CS)Alternate Spot Colors. 2 bytes (version = 1), 2 bytes channel count, following is repeated for each count: 4 bytes channel ID, Color: 2 bytes for space followed by 4 * 2 byte color component. This resource is not read or used by Photoshop`},
0x042D: {Description: `(Photoshop CS2) Layer Selection ID(s). 2 bytes count, following is repeated for each count: 4 bytes layer ID`},
0x042E: {Description: `(Photoshop CS2) HDR Toning information`},
0x042F: {Description: `(Photoshop CS2) Print info`},
0x0430: {Description: `(Photoshop CS2) Layer Group(s) Enabled ID. 1 byte for each layer in the document, repeated by length of the resource. NOTE: Layer groups have start and end markers`},
0x0431: {Description: `(Photoshop CS3) Color samplers resource. Also see ID 1038 for old format. See See Color samplers resource format`},
0x0432: {Description: `(Photoshop CS3) Measurement Scale. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)`},
0x0433: {Description: `(Photoshop CS3) Timeline Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)`},
0x0434: {Description: `(Photoshop CS3) Sheet Disclosure. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)`},
0x0435: {Description: `(Photoshop CS3) DisplayInfo structure to support floating point clors. Also see ID 1007. See Appendix A in Photoshop API Guide.pdf `},
0x0436: {Description: `(Photoshop CS3) Onion Skins. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure)`},
0x0438: {Description: `(Photoshop CS4) Count Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the count in the document. See the Count Tool`},
0x043A: {Description: `(Photoshop CS5) Print Information. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print settings in the document. The color management options`},
0x043B: {Description: `(Photoshop CS5) Print Style. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current print style in the document. The printing marks, labels, ornaments, etc`},
0x043C: {Description: `(Photoshop CS5) Macintosh NSPrintInfo. Variable OS specific info for Macintosh. NSPrintInfo. It is recommended that you do not interpret or use this data`},
0x043D: {Description: `(Photoshop CS5) Windows DEVMODE. Variable OS specific info for Windows. DEVMODE. It is recommended that you do not interpret or use this data`},
0x043E: {Description: `(Photoshop CS6) Auto Save File Path. Unicode string. It is recommended that you do not interpret or use this data`},
0x043F: {Description: `(Photoshop CS6) Auto Save Format. Unicode string. It is recommended that you do not interpret or use this data`},
0x0440: {Description: `(Photoshop CC) Path Selection State. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the current path selection state`},
// 0x07D0 - 0x0BB6: `Path Information (saved paths). See See Path resource format`},
0x0BB7: {Description: `Name of clipping path. See See Path resource format`},
0x0BB8: {Description: `(Photoshop CC) Origin Path Info. 4 bytes (descriptor version = 16), Descriptor (see See Descriptor structure) Information about the origin path data`},
// 0x0FA0 - 0x1387: `Plug-In resource(s). Resources added by a plug-in. See the plug-in API found in the SDK documentation`},
0x1B58: {Description: `Image Ready variables. XML representation of variables definition`},
0x1B59: {Description: `Image Ready data sets`},
0x1B5A: {Description: `Image Ready default selected state`},
0x1B5B: {Description: `Image Ready 7 rollover expanded state`},
0x1B5C: {Description: `Image Ready rollover expanded state`},
0x1B5D: {Description: `Image Ready save layer settings`},
0x1B5E: {Description: `Image Ready version`},
0x1F40: {Description: `(Photoshop CS3) Lightroom workflow, if present the document is in the middle of a Lightroom workflow`},
0x2710: {Description: `Print flags information. 2 bytes version ( = 1), 1 byte center crop marks, 1 byte ( = 0), 4 bytes bleed width value, 2 bytes bleed width scale`},
}