xmpbase

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: 4 Imported by: 10

Documentation

Overview

Package xmpbase implements the XMP namespace as defined by XMP Specification Part 2.

Package xmpbase implements the XMP namespace as defined by XMP Specification Part 2.

Index

Constants

This section is empty.

Variables

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

Functions

func NewModel

func NewModel(name string) xmp.Model

Types

type Area

type Area struct {
	X    float64  `xmp:"stArea:x,attr"`
	Y    float64  `xmp:"stArea:y,attr"`
	W    float64  `xmp:"stArea:w,attr"`
	H    float64  `xmp:"stArea:h,attr"`
	D    float64  `xmp:"stArea:d,attr"`
	Unit AreaUnit `xmp:"stArea:unit,attr"`
}

Metadata Workinggroup Guidelines 2.0, 2010 stArea http://ns.adobe.com/xmp/sType/Area#

func (Area) IsZero

func (x Area) IsZero() bool

func (Area) MarshalXMP

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

type AreaUnit

type AreaUnit string
const (
	AreaUnitRatio AreaUnit = "normalized"
	AreaUnitPixel AreaUnit = "pixel"
)

type Identifier

type Identifier struct {
	ID     string `xmp:"rdf:value"`
	Scheme string `xmp:"xmpidq:Scheme"`
}

func (Identifier) MarshalText

func (x Identifier) MarshalText() ([]byte, error)

func (Identifier) MarshalXMP

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

func (*Identifier) UnmarshalText

func (x *Identifier) UnmarshalText(data []byte) error

func (*Identifier) UnmarshalXMP

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

type IdentifierArray

type IdentifierArray []Identifier

func NewIdentifierArray

func NewIdentifierArray(items ...interface{}) IdentifierArray

func (*IdentifierArray) Add

func (x *IdentifierArray) Add(value string)

func (*IdentifierArray) AddUnique

func (x *IdentifierArray) AddUnique(v string) error

func (*IdentifierArray) Contains

func (x *IdentifierArray) Contains(v string) bool

func (*IdentifierArray) Index

func (x *IdentifierArray) Index(val string) int

func (IdentifierArray) IsZero

func (x IdentifierArray) IsZero() bool

func (IdentifierArray) MarshalXMP

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

func (*IdentifierArray) Remove

func (x *IdentifierArray) Remove(v string)

func (IdentifierArray) Typ

func (x IdentifierArray) Typ() xmp.ArrayType

func (*IdentifierArray) UnmarshalXMP

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

type Rating

type Rating int
const (
	RatingRejected Rating = -1
	RatingUnrated  Rating = 0
	Rating1        Rating = 1
	Rating2        Rating = 2
	Rating3        Rating = 3
	Rating4        Rating = 4
	Rating5        Rating = 5
)

type Thumbnail

type Thumbnail struct {
	Format string `xmp:"xmpGImg:format"`
	Width  int64  `xmp:"xmpGImg:height"`
	Height int64  `xmp:"xmpGImg:width"`
	Image  []byte `xmp:"xmpGImg:image"`
}

Part 2: 1.2.2.4 Thumbnail

func (Thumbnail) IsZero

func (x Thumbnail) IsZero() bool

func (Thumbnail) MarshalXMP

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

type ThumbnailArray

type ThumbnailArray []Thumbnail

func (ThumbnailArray) MarshalXMP

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

func (ThumbnailArray) Typ

func (x ThumbnailArray) Typ() xmp.ArrayType

func (*ThumbnailArray) UnmarshalXMP

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

type XmpBase

type XmpBase struct {
	Advisory     xmp.StringArray         `xmp:"xmp:Advisory"`
	BaseURL      xmp.Uri                 `xmp:"xmp:BaseURL"`
	CreateDate   xmp.Date                `xmp:"xmp:CreateDate"`
	CreatorTool  xmp.AgentName           `xmp:"xmp:CreatorTool"`
	Identifier   IdentifierArray         `xmp:"xmp:Identifier"`
	Label        string                  `xmp:"xmp:Label"`
	MetadataDate xmp.Date                `xmp:"xmp:MetadataDate"`
	ModifyDate   xmp.Date                `xmp:"xmp:ModifyDate"`
	Nickname     string                  `xmp:"xmp:Nickname"`
	Rating       Rating                  `xmp:"xmp:Rating"`
	Thumbnails   ThumbnailArray          `xmp:"xmp:Thumbnails"`
	Extensions   xmp.NamedExtensionArray `xmp:"xmp:extension"`
}

func FindModel

func FindModel(d *xmp.Document) *XmpBase

func MakeModel

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

func (*XmpBase) AddID

func (x *XmpBase) AddID(id string)

func (*XmpBase) AddIDWithScheme

func (x *XmpBase) AddIDWithScheme(id, scheme string)

func (XmpBase) Can

func (x XmpBase) Can(nsName string) bool

func (*XmpBase) CanTag

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

func (*XmpBase) GetTag

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

func (XmpBase) Namespaces

func (x XmpBase) Namespaces() xmp.NamespaceList

func (*XmpBase) SetTag

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

func (*XmpBase) SyncFromXMP

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

func (*XmpBase) SyncModel

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

func (XmpBase) SyncToXMP

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

Jump to

Keyboard shortcuts

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