1 module psd; 2 3 public import psd.parse : parsePSD; 4 public import psd.layer; 5 import asdf; 6 import psd.parse.sections.header; 7 import psd.parse.sections.imgres; 8 9 /** 10 Section of the PSD 11 */ 12 struct Section { 13 /** 14 The offset from the start of the file where this section is stored. 15 */ 16 ulong offset; 17 18 /** 19 The length of the section. 20 */ 21 uint length; 22 } 23 24 /** 25 A photoshop file 26 */ 27 struct PSD { 28 /** 29 Whether the file is actually a psb rather than psd file. 30 */ 31 bool psbFile; 32 33 PSD_Header header; 34 35 /** 36 Color mode data section. 37 */ 38 Section colorModeDataSection; 39 40 /** 41 Image Resources section. 42 */ 43 Section imageResourcesSection; 44 45 /** 46 Layer Mask Info section. 47 */ 48 Section layerMaskInfoSection; 49 50 /** 51 Image Data section. 52 */ 53 Section imageDataSection; 54 55 /** 56 ImageResourcesData 57 */ 58 ImageResourcesData imageResourcesData; 59 60 /** 61 Data for color mode 62 */ 63 ubyte[] colorData; 64 65 /** 66 Whether alpha is merged 67 */ 68 bool mergedAlpha; 69 70 /** 71 Layers 72 */ 73 Layer[] layers; 74 75 /** 76 Full image data encoded as 8-bit RGBA 77 */ 78 @serdeIgnore 79 ubyte[] fullImage; 80 } 81