image

package
v0.0.0-...-03ee3a8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

Task Action list

View Source
const (
	ActionParamValue       = actionprocessors.ActionParamValue
	ActionParamWidth       = actionprocessors.ActionParamWidth
	ActionParamHeight      = actionprocessors.ActionParamHeight
	ActionParamMaxWidth    = actionprocessors.ActionParamMaxWidth
	ActionParamMaxHeight   = actionprocessors.ActionParamMaxHeight
	ActionParamAnchor      = actionprocessors.ActionParamAnchor
	ActionParamFilter      = actionprocessors.ActionParamFilter
	ActionParamB64Format   = actionprocessors.ActionParamB64Format
	ActionParamMetaField   = actionprocessors.ActionParamMetaField
	ActionParamSave        = actionprocessors.ActionParamSave
	ActionParamJPEGQuality = actionprocessors.ActionParamJPEGQuality
)

Action params...

Variables

View Source
var (
	ErrUnsupportedAction = errors.New("[image] unsupported action")
	ErrInvalidInputFile  = errors.New("[image] invalid input file")
)

Error list...

Functions

func NewActionB64Extract

func NewActionB64Extract(contentType, targetMeta string) *models.Action

NewActionB64Extract with target meta field

func NewActionBlur

func NewActionBlur(value float64) *models.Action

NewActionBlur with value

func NewActionBrightness

func NewActionBrightness(value float64) *models.Action

NewActionBrightness with value

func NewActionContrast

func NewActionContrast(value float64) *models.Action

NewActionContrast with value

func NewActionExtractColors

func NewActionExtractColors(value int64) *models.Action

NewActionExtractColors with value

func NewActionFill

func NewActionFill(width, height int, anchor, filter string) *models.Action

NewActionFill with width and heigth

func NewActionFit

func NewActionFit(width, height int, filter string) *models.Action

NewActionFit with width and heigth

func NewActionGamma

func NewActionGamma(value float64) *models.Action

NewActionGamma with value

func NewActionResize

func NewActionResize(width, height int, filter string) *models.Action

NewActionResize with width and heigth

func NewActionSave

func NewActionSave(saves ...bool) *models.Action

NewActionSave object into the pipeline This action must be the last in the sequance, otherwhise it could be a problem

func NewActionSharpen

func NewActionSharpen(value float64) *models.Action

NewActionSharpen with value

func NewActionValidateSize

func NewActionValidateSize(width, height, maxWidth, maxHeight int) *models.Action

NewActionValidateSize with width and heigth

Types

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

Converter contains whole functions to convert image

func NewDefaultConverter

func NewDefaultConverter() *Converter

NewDefaultConverter with all default actions

func (*Converter) Name

func (ic *Converter) Name() string

Name of the converter

func (*Converter) Process

func (ic *Converter) Process(in converters.Input, out converters.Output) error

Process input file

func (*Converter) RegisterImageProcessor

func (ic *Converter) RegisterImageProcessor(processors ...ImageProcessor) *Converter

func (*Converter) Test

func (ic *Converter) Test(action *models.Action) bool

Test if action is suitable to perform

type ImageProcessor

type ImageProcessor interface {
	Name() string
	Process(in converters.Input, out converters.Output, action *models.Action, imgReader ImageReader) error
}

ImageProcessor basic processor interface

type ImageReader

type ImageReader = actionprocessors.ImageReader

ImageReader basic image reading desctiption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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