encoder

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: MIT Imports: 5 Imported by: 1

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, d 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(d 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(d 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