xmpmm

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: 3 Imported by: 2

Documentation

Overview

Package xmpmm implements the XMP Media Management namespace as defined by XMP Specification Part 2.

Package xmpmm implements the XMP Media Management namespace as defined by XMP Specification Part 2.

Index

Constants

This section is empty.

Variables

View Source
var (
	NsXmpMM = xmp.NewNamespace("xmpMM", "http://ns.adobe.com/xap/1.0/mm/", NewModel)
)

Functions

func NewModel

func NewModel(name string) xmp.Model

Types

type ActionType

type ActionType string
const (
	ActionConverted      ActionType = "converted"
	ActionCopied         ActionType = "copied"
	ActionCreated        ActionType = "created"
	ActionCropped        ActionType = "cropped"
	ActionEdited         ActionType = "edited"
	ActionFiltered       ActionType = "filtered"
	ActionFormatted      ActionType = "formatted"
	ActionVersionUpdated ActionType = "version_updated"
	ActionPrinted        ActionType = "printed"
	ActionPublished      ActionType = "published"
	ActionManaged        ActionType = "managed"
	ActionProduced       ActionType = "produced"
	ActionResized        ActionType = "resized"
	ActionSaved          ActionType = "saved"
	// more types not in XMP standard
	ActionAdded   ActionType = "media_added"
	ActionRemoved ActionType = "media_removed"
	ActionForked  ActionType = "forked"
	ActionMerged  ActionType = "merged"
)

type ResourceEvent

type ResourceEvent struct {
	Action        ActionType     `xmp:"stEvt:action,attr"`
	Changed       xmpdm.PartList `xmp:"stEvt:changed,attr"`
	InstanceID    xmp.GUID       `xmp:"stEvt:instanceID,attr"`
	Parameters    string         `xmp:"stEvt:parameters,attr"`
	SoftwareAgent xmp.AgentName  `xmp:"stEvt:softwareAgent,attr"`
	When          xmp.Date       `xmp:"stEvt:when,attr"`
}

1.2.4 ResourceEvent

type ResourceEventArray

type ResourceEventArray []*ResourceEvent

func (ResourceEventArray) MarshalXMP

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

func (ResourceEventArray) Typ

func (*ResourceEventArray) UnmarshalXMP

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

type ResourceRef

type ResourceRef struct {
	AlternatePaths     xmp.UriArray         `xmp:"stRef:alternatePaths"`
	OriginalDocumentID xmp.GUID             `xmp:"stRef:originalDocumentID,attr"`
	DocumentID         xmp.GUID             `xmp:"stRef:documentID,attr"`
	FilePath           xmp.Uri              `xmp:"stRef:filePath,attr"`
	FromPart           *xmpdm.Part          `xmp:"stRef:fromPart,attr"`
	InstanceID         xmp.GUID             `xmp:"stRef:instanceID,attr"`
	LastModifyDate     xmp.Date             `xmp:"stRef:lastModifyDate,attr"`
	Manager            xmp.AgentName        `xmp:"stRef:manager,attr"`
	ManagerVariant     string               `xmp:"stRef:managerVariant,attr"`
	ManageTo           xmp.Uri              `xmp:"stRef:manageTo,attr"`
	ManageUI           xmp.Uri              `xmp:"stRef:manageUI,attr"`
	MaskMarkers        xmpdm.MaskType       `xmp:"stRef:maskMarkers,attr"`
	PartMapping        string               `xmp:"stRef:partMapping,attr"`
	RenditionClass     xmpdm.RenditionClass `xmp:"stRef:renditionClass,attr"`
	RenditionParams    string               `xmp:"stRef:renditionParams,attr"`
	ToPart             *xmpdm.Part          `xmp:"stRef:toPart,attr"`
	VersionID          string               `xmp:"stRef:versionID,attr"`
}

Part 1: 8.2.2.9 ResourceRef + Part 2: 1.2.4.1 ResourceRef

func (ResourceRef) IsZero

func (x ResourceRef) IsZero() bool

func (ResourceRef) MarshalXMP

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

type ResourceRefArray

type ResourceRefArray []*ResourceRef

func (*ResourceRefArray) DeleteIndex

func (x *ResourceRefArray) DeleteIndex(idx int)

func (ResourceRefArray) Index

func (x ResourceRefArray) Index(did xmp.GUID) int

func (ResourceRefArray) MarshalXMP

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

func (ResourceRefArray) Typ

func (x ResourceRefArray) Typ() xmp.ArrayType

func (*ResourceRefArray) UnmarshalXMP

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

type StVersion

type StVersion struct {
	Comments   string        `xmp:"stVer:comments,attr"`
	Event      ResourceEvent `xmp:"stVer:event"`
	Modifier   string        `xmp:"stVer:modifier,attr"`
	ModifyDate xmp.Date      `xmp:"stVer:modifyDate,attr"`
	Version    string        `xmp:"stVer:version,attr"`
}

Part 2: 1.2.4.2 Version

type StVersionArray

type StVersionArray []*StVersion

func (StVersionArray) MarshalXMP

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

func (StVersionArray) Typ

func (x StVersionArray) Typ() xmp.ArrayType

func (*StVersionArray) UnmarshalXMP

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

type XmpMM

type XmpMM struct {
	DerivedFrom        *ResourceRef         `xmp:"xmpMM:DerivedFrom"`
	DocumentID         xmp.GUID             `xmp:"xmpMM:DocumentID"`
	History            ResourceEventArray   `xmp:"xmpMM:History"`
	Ingredients        ResourceRefArray     `xmp:"xmpMM:Ingredients"`
	InstanceID         xmp.GUID             `xmp:"xmpMM:InstanceID"`
	ManagedFrom        *ResourceRef         `xmp:"xmpMM:ManagedFrom"`
	Manager            xmp.AgentName        `xmp:"xmpMM:Manager"`
	ManageTo           xmp.Uri              `xmp:"xmpMM:ManageTo"`
	ManageUI           xmp.Uri              `xmp:"xmpMM:ManageUI"`
	ManagerVariant     string               `xmp:"xmpMM:ManagerVariant"`
	OriginalDocumentID xmp.GUID             `xmp:"xmpMM:OriginalDocumentID"`
	Pantry             xmp.ExtensionArray   `xmp:"xmpMM:Pantry,omitempty"`
	RenditionClass     xmpdm.RenditionClass `xmp:"xmpMM:RenditionClass"`
	RenditionParams    string               `xmp:"xmpMM:RenditionParams"`
	VersionID          string               `xmp:"xmpMM:VersionID"`
	Versions           StVersionArray       `xmp:"xmpMM:Versions"`
}

func FindModel

func FindModel(d *xmp.Document) *XmpMM

func MakeModel

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

func (*XmpMM) AddHistory

func (x *XmpMM) AddHistory(e *ResourceEvent)

func (*XmpMM) AddPantry

func (x *XmpMM) AddPantry(d *xmp.Document)

func (*XmpMM) AddVersion

func (x *XmpMM) AddVersion(v *StVersion)

func (*XmpMM) AppendVersionHistory

func (x *XmpMM) AppendVersionHistory(action ActionType, modifier, changed string, date xmp.Date)

assumes InstanceID and VersionID are changed outside

func (XmpMM) Can

func (x XmpMM) Can(nsName string) bool

func (*XmpMM) CanTag

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

func (*XmpMM) GetLastEvent

func (x *XmpMM) GetLastEvent() *ResourceEvent

func (*XmpMM) GetLastVersion

func (x *XmpMM) GetLastVersion() *StVersion

func (*XmpMM) GetLastVersionId

func (x *XmpMM) GetLastVersionId() string

func (*XmpMM) GetPreviousVersion

func (x *XmpMM) GetPreviousVersion() *StVersion

func (*XmpMM) GetPreviousVersionId

func (x *XmpMM) GetPreviousVersionId() string

func (*XmpMM) GetTag

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

func (XmpMM) Namespaces

func (x XmpMM) Namespaces() xmp.NamespaceList

func (*XmpMM) SelfResourceRef

func (x *XmpMM) SelfResourceRef(version string) *ResourceRef

func (*XmpMM) SetPreviousVersionId

func (x *XmpMM) SetPreviousVersionId(version string)

func (*XmpMM) SetTag

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

func (*XmpMM) SyncFromXMP

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

func (*XmpMM) SyncModel

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

func (XmpMM) SyncToXMP

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

Jump to

Keyboard shortcuts

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