jpeg

package
v0.0.0-...-3a06bfb Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApplierSchema = schema.StructFunc(func(prototype *Applier) *schema.StructBuilder[Applier] {
	return schema.Struct(prototype,
		schema.F("Quality", &prototype.Quality, schema.Int()),
	).DebugName("Applier")
})
View Source
var ConfigSchema = schema.StructFunc(func(prototype *Config) *schema.StructBuilder[Config] {
	return schema.Struct(prototype,
		schema.F("default_quality", &prototype.DefaultQuality, schema.Int().Default(75)),
	).DebugName("image.encode.jpeg#Config")
})
View Source
var ParamsSchema = schema.StructFunc(func(prototype *Params) *schema.StructBuilder[Params] {
	return schema.Struct(prototype,
		schema.F("q", &prototype.Quality, schema.Int().Default(-1)),
	).DebugName("image.encode.jpeg#Params")
})

Functions

func Register

func Register(r *transform.Registry)

Types

type Applier

type Applier struct {
	Quality int64 `imbed:""`
}

func (*Applier) Apply

func (x *Applier) Apply(app core.App, a asset.Asset) (asset.Update, error)

func (*Applier) EncodeMsg

func (x *Applier) EncodeMsg(w *fastbuf.W)

type Config

type Config struct {
	DefaultQuality int64 `imbed:"default_quality,75"`
}

func (*Config) EncodeMsg

func (x *Config) EncodeMsg(w *fastbuf.W)

func (*Config) Validate

func (c *Config) Validate() error

type Params

type Params struct {
	Quality int64 `imbed:"q,-1"`
}

func (*Params) BuildTransform

func (p *Params) BuildTransform(c *Config) (transform.Applier, error)

func (*Params) EncodeMsg

func (x *Params) EncodeMsg(w *fastbuf.W)

func (*Params) Validate

func (p *Params) Validate() error

Jump to

Keyboard shortcuts

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