Documentation ¶
Index ¶
Constants ¶
const ( BlendModePassThrough = BlendMode("pass") BlendModeNormal = BlendMode("norm") BlendModeDissolve = BlendMode("diss") BlendModeDarken = BlendMode("dark") BlendModeMultiply = BlendMode("mul ") BlendModeColorBurn = BlendMode("idiv") BlendModeLinearBurn = BlendMode("lbrn") BlendModeDarkerColor = BlendMode("dkCl") BlendModeLighten = BlendMode("lite") BlendModeScreen = BlendMode("scrn") BlendModeColorDodge = BlendMode("div ") BlendModeLinearDodge = BlendMode("lddg") BlendModeLighterColor = BlendMode("lgCl") BlendModeOverlay = BlendMode("over") BlendModeSoftLight = BlendMode("sLit") BlendModeHardLight = BlendMode("hLit") BlendModeVividLight = BlendMode("vLit") BlendModeLinearLight = BlendMode("lLit") BlendModePinLight = BlendMode("pLit") BlendModeHardMix = BlendMode("hMix") BlendModeDifference = BlendMode("diff") BlendModeExclusion = BlendMode("smud") BlendModeSubtract = BlendMode("fsub") BlendModeDivide = BlendMode("fdiv") BlendModeHue = BlendMode("hue ") BlendModeSaturation = BlendMode("sat ") BlendModeColor = BlendMode("colr") BlendModeLuminosity = BlendMode("lum ") )
These blend modes are defined in this document.
http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_13084
const ( ColorModeBitmap = ColorMode(0) ColorModeGrayscale = ColorMode(1) ColorModeIndexed = ColorMode(2) ColorModeRGB = ColorMode(3) ColorModeCMYK = ColorMode(4) ColorModeMultichannel = ColorMode(7) ColorModeDuotone = ColorMode(8) ColorModeLab = ColorMode(9) )
These color modes are defined in this document.
http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_19840
const ( CompressionMethodRaw = CompressionMethod(0) CompressionMethodRLE = CompressionMethod(1) CompressionMethodZIPWithoutPrediction = CompressionMethod(2) CompressionMethodZIPWithPrediction = CompressionMethod(3) )
These compression methods are defined in this document.
http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_pgfId-1054855
const ( AdditionalInfoKeyLayerInfo = AdditionalInfoKey("Layr") AdditionalInfoKeyLayerInfo16 = AdditionalInfoKey("Lr16") AdditionalInfoKeyLayerInfo32 = AdditionalInfoKey("Lr32") AdditionalInfoKeyUnicodeLayerName = AdditionalInfoKey("luni") AdditionalInfoKeyBlendClippingElements = AdditionalInfoKey("clbl") AdditionalInfoKeySectionDividerSetting = AdditionalInfoKey("lsct") AdditionalInfoKeySectionDividerSetting2 = AdditionalInfoKey("lsdk") )
These keys are defined in this document.
http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577409_71546
Variables ¶
var Debug logger
Debug is useful for debugging.
You can use by performing the following steps.
psd.Debug = log.New(os.Stdout, "psd: ", log.Lshortfile)
Functions ¶
This section is empty.
Types ¶
type AdditionalInfoKey ¶
type AdditionalInfoKey string
AdditionalInfoKey represents the key of the additional layer information.
func (AdditionalInfoKey) LenSize ¶
func (a AdditionalInfoKey) LenSize(largeDocument bool) int
LenSize returns bytes of the length for this key.
type BlendMode ¶
type BlendMode string
BlendMode represents the blend mode.
func (BlendMode) String ¶
String implements fmt.Stringer interface.
The return value respects blend name that is described in "Compositing and Blending Level 1"(https://www.w3.org/TR/compositing-1/#blending).
type CompressionMethod ¶
type CompressionMethod int16
CompressionMethod represents compression method that is used in psd file.
func (CompressionMethod) Decode ¶
func (cm CompressionMethod) Decode(dest []byte, r io.Reader, sizeHint int64, rect image.Rectangle, depth int, channels int, large bool) (read int, err error)
Decode decodes the compressed image data from r.
You can pass 0 to sizeHint if unknown, but in this case may read more data than necessary from r.
type Config ¶
type Config struct { Version int Rect image.Rectangle Channels int Depth int // 1 or 8 or 16 or 32 ColorMode ColorMode ColorModeData []byte Res map[int]ImageResource }
Config represents Photoshop image file configuration.
func DecodeConfig ¶
DecodeConfig returns the color model and dimensions of a image without decoding the entire image.
type DecodeOptions ¶
type DecodeOptions struct { SkipLayerImage bool SkipMergedImage bool ConfigLoaded func(cfg Config) error LayerImageLoaded func(layer *Layer, index int, total int) }
DecodeOptions are the decoding options.
type ImageResource ¶
ImageResource represents the image resource that is used in psd file.
type Layer ¶
type Layer struct { SeqID int Name string UnicodeName string MBCSName string Rect image.Rectangle // Channel key is the channel ID. // 0 = red, 1 = green, etc. // -1 = transparency mask // -2 = user supplied layer mask // -3 = real user supplied layer mask // (when both a user mask and a vector mask are present) Channel map[int]Channel BlendMode BlendMode Opacity uint8 Clipping bool BlendClippedElements bool Flags uint8 Mask Mask Picker image.Image AdditionalLayerInfo map[AdditionalInfoKey][]byte SectionDividerSetting struct { Type int BlendMode BlendMode SubType int } Layer []Layer }
Layer represents layer.
func (*Layer) FolderIsOpen ¶
FolderIsOpen returns whether the folder is opened when layer is folder.
func (*Layer) TransparencyProtected ¶
TransparencyProtected returns whether the layer's transparency being protected.
type Mask ¶
type Mask struct { Rect image.Rectangle DefaultColor int Flags int RealRect image.Rectangle RealBackgroundColor int RealFlags int UserMaskDensity int UserMaskFeather float64 VectorMaskDensity int VectorMaskFeather float64 }
Mask represents layer mask and vector mask.
func (*Mask) RealEnabled ¶
RealEnabled returns whether the user real mask is enabled.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Code generated by genrgba2nrgba.go.
|
Code generated by genrgba2nrgba.go. |
Package composite implements PSD image compositor.
|
Package composite implements PSD image compositor. |