encoder

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TypeJpeg = "jpeg"
View Source
const TypePng = "png"

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder interface {
	Encode(img image.Image) ([]byte, error)
	GetMime() string
}

func New

func New(t string, m map[string]interface{}) (Encoder, error)

func NewFromConfig

func NewFromConfig(c interface{}) (s Encoder, err error)

type JpegEncoder

type JpegEncoder struct {
	Quality int
}

func NewJpegEncoder

func NewJpegEncoder(quality int) *JpegEncoder

func NewJpegEncoderFromMap

func NewJpegEncoderFromMap(m map[string]interface{}) (*JpegEncoder, error)

func (JpegEncoder) Encode

func (e JpegEncoder) Encode(img image.Image) ([]byte, error)

func (JpegEncoder) GetMime

func (e JpegEncoder) GetMime() string

type PngEncoder

type PngEncoder struct{}

func NewPngEncoder

func NewPngEncoder() *PngEncoder

func NewPngEncoderFromMap

func NewPngEncoderFromMap(m map[string]interface{}) (*PngEncoder, error)

func (PngEncoder) Encode

func (e PngEncoder) Encode(img image.Image) ([]byte, error)

func (PngEncoder) GetMime

func (e PngEncoder) GetMime() string

Jump to

Keyboard shortcuts

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