ps

package
v0.0.0-...-f9b6ca6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2020 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Overview

Package ps implements Adobe Photoshop metadata as defined by XMP Specification Part 2 Chapter 3.2.

Index

Constants

View Source
const (
	ColorModeBitmap       = 0 // 0 = Bitmap
	ColorModeGrayscale    = 1 // 1 = Gray scale
	ColorModeIndexed      = 2 // 2 = Indexed colour
	ColorModeRGB          = 3 // 3 = RGB colour
	ColorModeCMYK         = 4 // 4 = CMYK colour
	ColorModeMultiChannel = 7 // 7 = Multi-channel
	ColorModeDuotone      = 8 // 8 = Duotone
	ColorModeLAB          = 9 // 9 = LAB colour
)

Variables

View Source
var (
	NsPhotoshop = xmp.NewNamespace("photoshop", "http://ns.adobe.com/photoshop/1.0/", NewModel)
)

Functions

func NewModel

func NewModel(name string) xmp.Model

Types

type Anchestor

type Anchestor struct {
	AncestorID xmp.Uri `xmp:"photoshop:AncestorID"`
}

3.2.1.1 Ancestor

type AnchestorArray

type AnchestorArray []Anchestor

func (AnchestorArray) MarshalXMP

func (x AnchestorArray) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (AnchestorArray) Typ

func (x AnchestorArray) Typ() xmp.ArrayType

func (*AnchestorArray) UnmarshalXMP

func (x *AnchestorArray) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error

type ColorMode

type ColorMode int

type Layer

type Layer struct {
	LayerName string `xmp:"photoshop:LayerName"`
	LayerText string `xmp:"photoshop:LayerText"`
}

3.2.1.2 Layer

func (Layer) IsZero

func (x Layer) IsZero() bool

type LayerList

type LayerList []Layer

func (LayerList) MarshalXMP

func (x LayerList) MarshalXMP(e *xmp.Encoder, node *xmp.Node, m xmp.Model) error

func (LayerList) Typ

func (x LayerList) Typ() xmp.ArrayType

func (*LayerList) UnmarshalXMP

func (x *LayerList) UnmarshalXMP(d *xmp.Decoder, node *xmp.Node, m xmp.Model) error

type PhotoshopInfo

type PhotoshopInfo struct {
	AuthorsPosition        string          `xmp:"photoshop:AuthorsPosition"`
	CaptionWriter          string          `xmp:"photoshop:CaptionWriter"`
	Category               string          `xmp:"photoshop:Category"`
	City                   string          `xmp:"photoshop:City"`
	ColorMode              ColorMode       `xmp:"photoshop:ColorMode"`
	Country                string          `xmp:"photoshop:Country"`
	Credit                 string          `xmp:"photoshop:Credit"`
	DateCreated            xmp.Date        `xmp:"photoshop:DateCreated"`
	DocumentAncestors      AnchestorArray  `xmp:"photoshop:DocumentAncestors"`
	Headline               string          `xmp:"photoshop:Headline"`
	History                string          `xmp:"photoshop:History"`
	ICCProfile             string          `xmp:"photoshop:ICCProfile"`
	Instructions           string          `xmp:"photoshop:Instructions"`
	Layer                  *Layer          `xmp:"photoshop:Layer"`
	SidecarForExtension    string          `xmp:"photoshop:SidecarForExtension"` // "NEF"
	Source                 string          `xmp:"photoshop:Source"`
	State                  string          `xmp:"photoshop:State"`
	SupplementalCategories xmp.StringArray `xmp:"photoshop:SupplementalCategories"`
	TextLayers             LayerList       `xmp:"photoshop:TextLayers"`
	TransmissionReference  string          `xmp:"photoshop:TransmissionReference"`
	Urgency                int             `xmp:"photoshop:Urgency"` // 1 - 8

	EmbeddedXMPDigest string `xmp:"photoshop:EmbeddedXMPDigest,omit"` // "00000000000000000000000000000000"
	LegacyIPTCDigest  string `xmp:"photoshop:LegacyIPTCDigest,omit"`  // "AA5133A9479EA0F732E6A7414060A81F"
}

func FindModel

func FindModel(d *xmp.Document) *PhotoshopInfo

func MakeModel

func MakeModel(d *xmp.Document) (*PhotoshopInfo, error)

func (PhotoshopInfo) Can

func (x PhotoshopInfo) Can(nsName string) bool

func (*PhotoshopInfo) CanTag

func (x *PhotoshopInfo) CanTag(tag string) bool

func (*PhotoshopInfo) GetTag

func (x *PhotoshopInfo) GetTag(tag string) (string, error)

func (PhotoshopInfo) Namespaces

func (x PhotoshopInfo) Namespaces() xmp.NamespaceList

func (*PhotoshopInfo) SetTag

func (x *PhotoshopInfo) SetTag(tag, value string) error

func (*PhotoshopInfo) SyncFromXMP

func (x *PhotoshopInfo) SyncFromXMP(d *xmp.Document) error

func (*PhotoshopInfo) SyncModel

func (x *PhotoshopInfo) SyncModel(d *xmp.Document) error

func (PhotoshopInfo) SyncToXMP

func (x PhotoshopInfo) SyncToXMP(d *xmp.Document) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL