image

package
v0.0.0-...-e3fa223 Latest Latest
Warning

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

Go to latest
Published: May 24, 2018 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DitherImage

func DitherImage(im Image) error

func GolangImageToBytes

func GolangImageToBytes(goimg image.Image, content_type string) ([]byte, error)

func GolangImageToIIIFImage

func GolangImageToIIIFImage(goimg image.Image, im Image) error

func IIIFImageToGolangImage

func IIIFImageToGolangImage(im Image) (image.Image, error)

func PrimitiveImage

func PrimitiveImage(im Image, opts PrimitiveOptions) error

Types

type Dimensions

type Dimensions interface {
	Height() int
	Width() int
}

type FormatInstruction

type FormatInstruction struct {
	Format string
}

type GolangImageDimensions

type GolangImageDimensions struct {
	Dimensions
	// contains filtered or unexported fields
}

func (*GolangImageDimensions) Height

func (dims *GolangImageDimensions) Height() int

func (*GolangImageDimensions) Width

func (dims *GolangImageDimensions) Width() int

type Image

type Image interface {
	Identifier() string
	Rename(string) error
	Transform(*Transformation) error // http://iiif.io/api/image/2.1/#order-of-implementation
	Update([]byte) error
	Body() []byte
	Format() string
	ContentType() string
	Dimensions() (Dimensions, error)
}

func NewImageFromConfig

func NewImageFromConfig(config *iiifconfig.Config, id string) (Image, error)

func NewImageFromConfigWithCache

func NewImageFromConfigWithCache(config *iiifconfig.Config, cache iiifcache.Cache, id string) (Image, error)

func NewImageFromConfigWithSource

func NewImageFromConfigWithSource(config *iiifconfig.Config, source iiifsource.Source, id string) (Image, error)

type PrimitiveOptions

type PrimitiveOptions struct {
	Alpha      int
	Mode       int
	Iterations int
	Size       int
	Animated   bool
}

type RegionInstruction

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

type RotationInstruction

type RotationInstruction struct {
	Flip  bool
	Angle int64
}

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 Image) (*FormatInstruction, error)

func (*Transformation) HasTransformation

func (t *Transformation) HasTransformation() bool

func (*Transformation) RegionInstructions

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

func (*Transformation) RotationInstructions

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

func (*Transformation) SizeInstructions

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

func (*Transformation) ToURI

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

type VIPSDimensions

type VIPSDimensions struct {
	Dimensions
	// contains filtered or unexported fields
}

func (*VIPSDimensions) Height

func (d *VIPSDimensions) Height() int

func (*VIPSDimensions) Width

func (d *VIPSDimensions) Width() int

type VIPSImage

type VIPSImage struct {
	Image
	// contains filtered or unexported fields
}

func NewVIPSImageFromConfigWithSource

func NewVIPSImageFromConfigWithSource(config *iiifconfig.Config, src iiifsource.Source, id string) (*VIPSImage, error)

func (*VIPSImage) Body

func (im *VIPSImage) Body() []byte

func (*VIPSImage) ContentType

func (im *VIPSImage) ContentType() string

func (*VIPSImage) Dimensions

func (im *VIPSImage) Dimensions() (Dimensions, error)

func (*VIPSImage) Format

func (im *VIPSImage) Format() string

func (*VIPSImage) Identifier

func (im *VIPSImage) Identifier() string

func (*VIPSImage) Rename

func (im *VIPSImage) Rename(id string) error

func (*VIPSImage) Transform

func (im *VIPSImage) Transform(t *Transformation) error

func (*VIPSImage) Update

func (im *VIPSImage) Update(body []byte) error

Jump to

Keyboard shortcuts

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