formatx

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 4 Imported by: 16

Documentation

Overview

Package formatx Created by xuzhuoxi on 2019-04-26. @author xuzhuoxi

Package formatx Created by xuzhuoxi on 2019-05-31. @author xuzhuoxi

Index

Constants

View Source
const (
	Auto ImageFormat = ""
	PNG              = "png"
	JPEG             = "jpeg"
	JPG              = "jpg"
	JPS              = "jps"
	BMP              = "bmp"
	WEBP             = "webp"
)

Variables

This section is empty.

Functions

func CheckFormatRegistered

func CheckFormatRegistered(format string) bool

func GetExtName added in v1.0.1

func GetExtName(formatName string) string

func RegisterFormat

func RegisterFormat(name string, encodeFunc ImageEncodeFunc, decodeFunc ImageDecodeFunc)

func RegisterFormatExt added in v1.0.1

func RegisterFormatExt(formatName string, extName string)

Types

type ImageDecodeFunc

type ImageDecodeFunc = func(w io.Reader) (image.Image, error)

type ImageEncodeFunc

type ImageEncodeFunc = func(w io.Writer, m image.Image, options interface{}) error

type ImageFormat

type ImageFormat string

func (ImageFormat) Decode

func (f ImageFormat) Decode(r io.Reader) (image.Image, error)

func (ImageFormat) Encode

func (f ImageFormat) Encode(w io.Writer, m image.Image, options interface{}) error

Directories

Path Synopsis
Package jpegx Created by xuzhuoxi on 2019-04-27.
Package jpegx Created by xuzhuoxi on 2019-04-27.
Package pngx Created by xuzhuoxi on 2019-04-27.
Package pngx Created by xuzhuoxi on 2019-04-27.
Package webpx Create on 2023/5/3 @author xuzhuoxi
Package webpx Create on 2023/5/3 @author xuzhuoxi

Jump to

Keyboard shortcuts

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