processor

package
v0.0.0-...-49e76a4 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadImage

func LoadImage(r io.Reader, modifiers ...ImageModifier) (image.Image, error)

LoadImage reads image from reader and applies requested modifiers to that image

Types

type ImageModifier

type ImageModifier interface {
	Modify(img image.Image) image.Image
}

ImageModifier defines an image modifier

type ImageProcessor

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

Load images, apply actions on them and then encode

func (*ImageProcessor) GetBounds

func (i *ImageProcessor) GetBounds() (int, int)

func (*ImageProcessor) GetJPEG

func (i *ImageProcessor) GetJPEG() ([]byte, error)

func (*ImageProcessor) GetPNG

func (i *ImageProcessor) GetPNG() ([]byte, error)

func (*ImageProcessor) GetWEBP

func (i *ImageProcessor) GetWEBP() ([]byte, error)

func (*ImageProcessor) LoadJPEG

func (i *ImageProcessor) LoadJPEG(r io.Reader) error

func (*ImageProcessor) LoadPNG

func (i *ImageProcessor) LoadPNG(r io.Reader) error

func (*ImageProcessor) LoadWEBP

func (i *ImageProcessor) LoadWEBP(r io.Reader) error

func (*ImageProcessor) Resize

func (i *ImageProcessor) Resize(height int, width int)

type ImageResizer

type ImageResizer struct {
	Width  int
	Height int
}

ImageResizer defines image resizer

func (*ImageResizer) Modify

func (r *ImageResizer) Modify(img image.Image) image.Image

Modify to implement ImageModifier interface

Jump to

Keyboard shortcuts

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