image

package
v4.3.5 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCustomTransformations

func ApplyCustomTransformations(t *Transformation, im Image) error

Apply non-standard transformations to a go-iiif/image.Image instance.

func CrispImage added in v4.3.0

func CrispImage(im Image, opts *CrispImageOptions) error

func DitherImage

func DitherImage(im Image) error

func GolangImageToBytes

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

Encode a Go language image.Image instance to a byte array.

func GolangImageToIIIFImage

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

Assign a Go language image.Image instance to a go-iiif/image.Image instance.

func IIIFImageToGolangImage

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

Convert a go-iiif/image.Image instance to a Go language image.Image instance.

func PrimitiveImage

func PrimitiveImage(im Image, opts PrimitiveOptions) error

Types

type CrispImageOptions added in v4.3.0

type CrispImageOptions struct {
	Radius float64
	Amount float64
	Median float64
}

func DefaultCrispImageOptions added in v4.3.0

func DefaultCrispImageOptions() *CrispImageOptions

type Dimensions

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

type FormatInstruction

type FormatInstruction struct {
	Format string
}

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)
}

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
	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 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) SizeInstructionsWithDimensions

func (t *Transformation) SizeInstructionsWithDimensions(im Image, width int, height int) (*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