Documentation
¶
Index ¶
Constants ¶
View Source
const ( NearestNeighbor = "nearest-neighbor" Bilinear = "bilinear" Bicubic = "bicubic" )
Variables ¶
View Source
var ( ErrInvalidFileName = errors.New("invalid file name") ErrInvalidFormat = errors.New("invalid format: only jpg/jpeg and png formats are supported") )
View Source
var ( ErrBilinearSrcImageTooSmall = errors.New("source image is too small: width < 2 or height < 2") ErrBicubicSrcImageTooSmall = errors.New("source image is too small: width < 4 or height < 4") )
View Source
var ( ErrInvalidDimension = errors.New("invalid dimension: one of the dimension is not set or set to 0") ErrInvalidInterpolation = errors.New("invalid interpolation method: only nearest-neighbor, bilinear, and bicubic are available") )
Functions ¶
This section is empty.
Types ¶
type Data ¶
Data is a struct that contains the name and format of the image, and the *image.RGBA representation of the image itself.
type Instruction ¶
Instruction is a struct that contains the instruction for the processor.
type Processor ¶
type Processor struct {
Instruction
Interpolator interpolator
}
Processor is a struct that contains the instruction and related helpers
func NewProcessor ¶
func NewProcessor(i Instruction) (*Processor, error)
NewProcessor creates a new Processor instance from an Instruction instance. If the Instruction.Width and Instruction.Height are not set, it returns an error ErrInvalidDimension. It also creates a new Interpolator instance from the Interpolation instruction. If Instruction.Interpolation is not set, it defaults to Bilinear.
Click to show internal directories.
Click to hide internal directories.