Documentation ¶
Index ¶
- Constants
- func DataToImage(in []byte, option EncoderImageOption) (image.Image, error)
- func ImageToData(img image.Image) ([]byte, error)
- func NewBmp(mode EncoderMode, option encodercommon.EncoderOption) (encodercommon.EncoderPlugin, error)
- func NewGif(mode EncoderMode, option encodercommon.EncoderOption) (encodercommon.EncoderPlugin, error)
- func NewPng(mode EncoderMode, option encodercommon.EncoderOption) (encodercommon.EncoderPlugin, error)
- func WithEncoderNewFunc(mode EncoderMode, ...) func(options ...encodercommon.Option) (encodercommon.EncoderPlugin, error)
- type Bmp
- type EncoderImageOption
- type EncoderMode
- type Gif
- type Png
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 NewBmp ¶
func NewBmp(mode EncoderMode, option encodercommon.EncoderOption) (encodercommon.EncoderPlugin, error)
func NewGif ¶
func NewGif(mode EncoderMode, option encodercommon.EncoderOption) (encodercommon.EncoderPlugin, error)
func NewPng ¶
func NewPng(mode EncoderMode, option encodercommon.EncoderOption) (encodercommon.EncoderPlugin, error)
func WithEncoderNewFunc ¶
func WithEncoderNewFunc(mode EncoderMode, f func(mode EncoderMode, option encodercommon.EncoderOption) (encodercommon.EncoderPlugin, error)) func(options ...encodercommon.Option) (encodercommon.EncoderPlugin, error)
Types ¶
type Bmp ¶
type Bmp struct { EncoderImageOption // contains filtered or unexported fields }
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 }
type Png ¶
type Png struct { EncoderImageOption // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.