transform

package
v1.32.4 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transform

type Transform struct {
	Rendition     image.Rendition `json:"rendition,omitempty"`
	ContentWidth  int             `json:"contentWidth,omitempty"`
	ContentHeight int             `json:"contentHeight,omitempty"`
	Resize        bool            `json:"resize,omitempty"`
	Crop          bool            `json:"crop,omitempty"`
}

func NewTransform

func NewTransform() *Transform

func NewTransformWithRendition

func NewTransformWithRendition(rendition *image.Rendition) (*Transform, error)

func (*Transform) ConstrainContentHeight

func (t *Transform) ConstrainContentHeight(aspectRatio float64)

func (*Transform) ConstrainContentWidth

func (t *Transform) ConstrainContentWidth(aspectRatio float64)

func (*Transform) ConstrainHeight

func (t *Transform) ConstrainHeight(aspectRatio float64)

func (*Transform) ConstrainWidth

func (t *Transform) ConstrainWidth(aspectRatio float64)

func (*Transform) Reset

func (t *Transform) Reset(contentAttributes *image.ContentAttributes) error

func (*Transform) Validate

func (t *Transform) Validate(validator structure.Validator)

type Transformer

type Transformer interface {
	CalculateTransform(contentAttributes *image.ContentAttributes, rendition *image.Rendition) (*Transform, error)
	TransformContent(reader io.Reader, transform *Transform) (io.ReadCloser, error)
}

type TransformerImpl

type TransformerImpl struct{}

func NewTransformer

func NewTransformer() *TransformerImpl

func (*TransformerImpl) CalculateTransform

func (t *TransformerImpl) CalculateTransform(contentAttributes *image.ContentAttributes, rendition *image.Rendition) (*Transform, error)

func (*TransformerImpl) TransformContent

func (t *TransformerImpl) TransformContent(reader io.Reader, transform *Transform) (io.ReadCloser, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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