encoderimage

package
v0.0.0-...-084929d Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BMP         = "bmp"
	BMPRGB      = "bmprgb"
	BMPRGBA     = "bmprgba"
	BMPPALETTED = "bmppaletted"
	BMPGRAY     = "bmpgray"
)
View Source
const (
	GIF         = "gif"
	GIFPALETTED = "gifpaletted"
)
View Source
const (
	PNG         = "png"
	PNGRGB      = "pngrgb"
	PNGRGBA     = "pngrgba"
	PNGPALETTED = "pngpaletted"
	PNGGRAY     = "pnggray"
)

Variables

This section is empty.

Functions

func DataToImage

func DataToImage(in []byte, option EncoderImageOption) (image.Image, error)

func ImageToData

func ImageToData(img image.Image) ([]byte, error)

Types

type Bmp

type Bmp struct {
	EncoderImageOption
	// contains filtered or unexported fields
}

func (*Bmp) Decode

func (*Bmp) Decode(in []byte) ([]byte, error)

func (*Bmp) Encode

func (b *Bmp) Encode(in []byte) ([]byte, error)

func (*Bmp) Mime

func (*Bmp) Mime() string

func (*Bmp) Type

func (*Bmp) Type() string

type EncoderImageOption

type EncoderImageOption struct {
	encodercommon.EncoderOption
	Mode EncoderMode
}

type EncoderMode

type EncoderMode uint8
const (
	RGB      EncoderMode = iota //24位
	RGBA                        //32位
	Paletted                    //8位
	Gray                        //灰度图
)

图片模式

type Gif

type Gif struct {
	EncoderImageOption
	// contains filtered or unexported fields
}

func (*Gif) Decode

func (*Gif) Decode(in []byte) ([]byte, error)

func (*Gif) Encode

func (f *Gif) Encode(in []byte) ([]byte, error)

func (*Gif) Mime

func (*Gif) Mime() string

func (*Gif) Type

func (*Gif) Type() string

type Png

type Png struct {
	EncoderImageOption
	// contains filtered or unexported fields
}

func (*Png) Decode

func (*Png) Decode(in []byte) ([]byte, error)

解码

func (*Png) Encode

func (p *Png) Encode(in []byte) ([]byte, error)

编码

func (*Png) Mime

func (*Png) Mime() string

func (*Png) Type

func (*Png) Type() string

Jump to

Keyboard shortcuts

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