image

package
v0.0.0-...-a4359f9 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache = cache.Auto

Cache is an image cache

func NewCache

func NewCache(tracer *tracing.Tracer, cacheProvider cache.Provider, storageProvider storage.Provider) *Cache

NewCache instantiates a new cache

type OutputFormat

type OutputFormat int

OutputFormat is the image format to output to

const (
	// JPEG represents the JPEG format
	JPEG OutputFormat = iota
	// WebP represents the WebP format
	WebP
)

type Processor

type Processor interface {
	ProcessImage(ctx context.Context, task *Task) (processedImage []byte, err error)
}

Processor is an image processor

type Task

type Task struct {
	ImageID        string
	Width          int
	Height         int
	ApplyBlur      bool
	BlurAmount     int
	ApplyGrayscale bool
	UserComment    string
	OutputFormat   OutputFormat
}

Task is an image processing task

func NewTask

func NewTask(imageID string, width int, height int, userComment string, format OutputFormat) *Task

NewTask creates a new image processing task

func (*Task) Blur

func (t *Task) Blur(amount int) *Task

Blur applies gaussian blur to the image

func (*Task) Grayscale

func (t *Task) Grayscale() *Task

Grayscale turns the image into grayscale

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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