image

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: BSD-3-Clause Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncodingOptions

type EncodingOptions struct {
	Quality int
	Format  string
}

type FormatInstruction

type FormatInstruction struct {
	Format string
}

type Image

type Image interface {
	Identifier() string
	Transform(*Transformation) error // http://iiif.io/api/image/2.1/#order-of-implementation
	//Format() string
	Height() int
	Width() int
}

type NativeImage

type NativeImage struct {
	Image
	ID     string
	Bimg   stdimage.Image
	Config stdimage.Config
	Format string
}

NativeImage ...

func NewNativeImage

func NewNativeImage(id string, body []byte) (*NativeImage, error)

NewNativeImage ...

func (*NativeImage) Encode

func (im *NativeImage) Encode(opts *EncodingOptions) ([]byte, error)

Identifier ...

func (*NativeImage) Height

func (im *NativeImage) Height() int

Height ...

func (*NativeImage) Identifier

func (im *NativeImage) Identifier() string

Identifier ...

func (*NativeImage) Transform

func (im *NativeImage) Transform(t *Transformation) (*NativeImage, error)

func (*NativeImage) Width

func (im *NativeImage) Width() int

Width ....

type RegionInstruction

type RegionInstruction struct {
	X         int
	Y         int
	Height    int
	Width     int
	SmartCrop bool
}

type RotationInstruction

type RotationInstruction struct {
	Flip         bool
	Angle        float64
	NoAutoRotate bool // see notes in image/vips.go for why we need to do this (20180607/thisisaaronland)
}

type SizeInstruction

type SizeInstruction struct {
	Height int
	Width  int
	Force  bool
}

type Transformation

type Transformation struct {
	Region   string
	Size     string
	Rotation string
	Quality  string
	Format   string
	// contains filtered or unexported fields
}

func NewTransformation

func NewTransformation(level iiiflevel.Level, region string, size string, rotation string, quality string, format string) (*Transformation, error)

func (*Transformation) FormatInstructions

func (t *Transformation) FormatInstructions(im *NativeImage) (*FormatInstruction, error)

func (*Transformation) HasTransformation

func (t *Transformation) HasTransformation() bool

func (*Transformation) RegionInstructions

func (t *Transformation) RegionInstructions(im *NativeImage) (*RegionInstruction, error)

func (*Transformation) RotationInstructions

func (t *Transformation) RotationInstructions(im *NativeImage) (*RotationInstruction, error)

func (*Transformation) SizeInstructions

func (t *Transformation) SizeInstructions(im *NativeImage) (*SizeInstruction, error)

func (*Transformation) ToURI

func (t *Transformation) ToURI(id string) (string, error)

Jump to

Keyboard shortcuts

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