Documentation ¶
Index ¶
- Constants
- Variables
- func Alpha16ToColorTable(state *golua.LState, alpha int) *golua.LTable
- func AlphaSet(img image.Image, alpha uint8)
- func AlphaToColorTable(state *golua.LState, alpha int) *golua.LTable
- func CMYKAToColorTable(state *golua.LState, cyan, magenta, yellow, key, alpha int) *golua.LTable
- func CMYKToColorTable(state *golua.LState, cyan, magenta, yellow, key int) *golua.LTable
- func Color16BitTo8Bit(c uint16) uint8
- func Color8BitTo16Bit(c uint8) uint16
- func ColorTableToAlpha(t *golua.LTable) uint8
- func ColorTableToAlpha16(t *golua.LTable) uint16
- func ColorTableToCMYK(t *golua.LTable) (uint8, uint8, uint8, uint8)
- func ColorTableToCMYKA(t *golua.LTable) (uint8, uint8, uint8, uint8, uint8)
- func ColorTableToGray(t *golua.LTable) uint8
- func ColorTableToGray16(t *golua.LTable) uint16
- func ColorTableToGrayA(t *golua.LTable) (uint8, uint8)
- func ColorTableToGrayA16(t *golua.LTable) (uint16, uint16)
- func ColorTableToHSLA(t *golua.LTable) (float64, float64, float64, uint8)
- func ColorTableToHSVA(t *golua.LTable) (float64, float64, float64, uint8)
- func ColorTableToRGBA(t *golua.LTable) (uint8, uint8, uint8, uint8)
- func ColorTableToRGBAColor(t *golua.LTable) *color.RGBA
- func ConvertColor(model ColorModel, red, green, blue, alpha int) (int, int, int, int)
- func CopyImage(src image.Image, model ColorModel) image.Image
- func DataChunkToTable(chunk *PNGDataChunk, state *golua.LState) *golua.LTable
- func Decode(r io.ReadSeeker, encoding ImageEncoding) (image.Image, error)
- func DecodeConfig(r io.Reader, encoding ImageEncoding) (int, int, error)
- func Draw(base image.Image, sub image.Image, x, y, width, height int)
- func DrawRect(base image.Image, sub image.Image, r image.Rectangle)
- func Encode(w io.WriteSeeker, img image.Image, encoding ImageEncoding) error
- func EncodingExtension(encoding ImageEncoding) string
- func FramesToSpritesheet(imgs []image.Image, model ColorModel, ...) image.Image
- func Get(img image.Image, x, y int) (int, int, int, int)
- func GetColor(img image.Image, state *golua.LState, x, y int) *golua.LTable
- func Gray16ToColorTable(state *golua.LState, gray int) *golua.LTable
- func GrayA16ToColorTable(state *golua.LState, gray, alpha int) *golua.LTable
- func GrayAToColorTable(state *golua.LState, gray, alpha int) *golua.LTable
- func GrayToColorTable(state *golua.LState, gray int) *golua.LTable
- func HSLAToColorTable(state *golua.LState, hue, sat, light float64, alpha int) *golua.LTable
- func HSVAToColorTable(state *golua.LState, hue, sat, val float64, alpha int) *golua.LTable
- func ImageCompare(img1, img2 image.Image) bool
- func ImageGetDraw(img image.Image) draw.Image
- func NewImage(width, height int, model ColorModel) image.Image
- func PNGDataChunkEncode(w io.WriteSeeker, img image.Image, chunks []*PNGDataChunk) error
- func PNGDataChunkWrite(key string, data string) []byte
- func ParseAlpha16Table(t *golua.LTable) uint16
- func ParseAlphaTable(t *golua.LTable) uint8
- func ParseCMYKATable(t *golua.LTable) (uint8, uint8, uint8, uint8, uint8)
- func ParseCMYKTable(t *golua.LTable) (uint8, uint8, uint8, uint8)
- func ParseGray16Table(t *golua.LTable) uint16
- func ParseGrayA16Table(t *golua.LTable) (uint16, uint16)
- func ParseGrayATable(t *golua.LTable) (uint8, uint8)
- func ParseGrayTable(t *golua.LTable) uint8
- func ParseHSLATable(t *golua.LTable) (float64, float64, float64, uint8)
- func ParseHSVATable(t *golua.LTable) (float64, float64, float64, uint8)
- func ParseRGBATable(t *golua.LTable) (uint8, uint8, uint8, uint8)
- func PointToTable(state *golua.LState, p image.Point) *golua.LTable
- func RGBAColorToColorTable(state *golua.LState, rgba *color.RGBA) *golua.LTable
- func RGBAToColorTable(state *golua.LState, r, g, b, a int) *golua.LTable
- func Set(img image.Image, x, y, red, green, blue, alpha int)
- func SpritesheetToFrames(img image.Image, copy bool, ...) []image.Image
- func SubImage(img image.Image, x1, y1, x2, y2 int, copy bool) image.Image
- func TableToPoint(t *golua.LTable) image.Point
- func ZeroColorTable(state *golua.LState) *golua.LTable
- type ColorModel
- type ImageEncoding
- type PNGChunkStripper
- type PNGDataChunk
- type PNGDataError
Constants ¶
View Source
const ( COLOR_TYPE_RGBA string = "rgba" COLOR_TYPE_HSVA string = "hsva" COLOR_TYPE_HSLA string = "hsla" COLOR_TYPE_GRAYA string = "graya" COLOR_TYPE_GRAYA16 string = "graya16" COLOR_TYPE_GRAY string = "gray" COLOR_TYPE_GRAY16 string = "gray16" COLOR_TYPE_ALPHA string = "alpha" COLOR_TYPE_ALPHA16 string = "alpha16" COLOR_TYPE_CMYKA string = "cmyka" COLOR_TYPE_CMYK string = "cmyk" COLOR_TYPE_ZERO string = "zero" )
Variables ¶
View Source
var EncodingExts = []string{
".png",
".jpg",
".jpeg",
".gif",
".tiff",
".bmp",
".ico",
".cur",
}
View Source
var EncodingList = []ImageEncoding{ ENCODING_PNG, ENCODING_JPEG, ENCODING_GIF, ENCODING_TIFF, ENCODING_BMP, ENCODING_ICO, ENCODING_CUR, ENCODING_UNKNOWN, }
View Source
var ModelList = []ColorModel{ MODEL_RGBA, MODEL_RGBA64, MODEL_NRGBA, MODEL_NRGBA64, MODEL_ALPHA, MODEL_ALPHA16, MODEL_GRAY, MODEL_GRAY16, MODEL_CMYK, }
Functions ¶
func Alpha16ToColorTable ¶ added in v0.3.0
func AlphaToColorTable ¶ added in v0.3.0
func CMYKAToColorTable ¶ added in v0.3.0
func CMYKToColorTable ¶ added in v0.3.0
func Color16BitTo8Bit ¶ added in v0.3.0
func Color8BitTo16Bit ¶ added in v0.3.0
func ColorTableToAlpha ¶ added in v0.3.0
func ColorTableToAlpha16 ¶ added in v0.3.0
func ColorTableToCMYK ¶ added in v0.3.0
func ColorTableToCMYKA ¶ added in v0.3.0
func ColorTableToGray ¶ added in v0.3.0
func ColorTableToGray16 ¶ added in v0.3.0
func ColorTableToGrayA16 ¶ added in v0.3.0
func ColorTableToHSLA ¶ added in v0.3.0
func ColorTableToHSVA ¶ added in v0.3.0
func ColorTableToRGBA ¶ added in v0.3.0
func ColorTableToRGBAColor ¶ added in v0.3.0
func ConvertColor ¶
func DataChunkToTable ¶ added in v0.3.0
func DataChunkToTable(chunk *PNGDataChunk, state *golua.LState) *golua.LTable
func Decode ¶
func Decode(r io.ReadSeeker, encoding ImageEncoding) (image.Image, error)
func DecodeConfig ¶ added in v0.3.0
func Encode ¶
func Encode(w io.WriteSeeker, img image.Image, encoding ImageEncoding) error
func EncodingExtension ¶
func EncodingExtension(encoding ImageEncoding) string
func FramesToSpritesheet ¶ added in v0.3.0
func Gray16ToColorTable ¶ added in v0.3.0
func GrayA16ToColorTable ¶ added in v0.3.0
func GrayAToColorTable ¶ added in v0.3.0
func GrayToColorTable ¶ added in v0.3.0
func HSLAToColorTable ¶ added in v0.3.0
func HSVAToColorTable ¶ added in v0.3.0
func ImageCompare ¶ added in v0.3.0
func PNGDataChunkEncode ¶ added in v0.3.0
func PNGDataChunkEncode(w io.WriteSeeker, img image.Image, chunks []*PNGDataChunk) error
func PNGDataChunkWrite ¶ added in v0.3.0
func ParseAlpha16Table ¶ added in v0.3.0
func ParseAlphaTable ¶ added in v0.3.0
func ParseCMYKATable ¶ added in v0.3.0
func ParseCMYKTable ¶ added in v0.3.0
func ParseGray16Table ¶ added in v0.3.0
func ParseGrayTable ¶ added in v0.3.0
func ParseHSLATable ¶ added in v0.3.0
func ParseHSVATable ¶ added in v0.3.0
func ParseRGBATable ¶ added in v0.3.0
func RGBAColorToColorTable ¶ added in v0.3.0
func RGBAToColorTable ¶ added in v0.3.0
func SpritesheetToFrames ¶ added in v0.3.0
Types ¶
type ColorModel ¶
type ColorModel int
const ( MODEL_RGBA ColorModel = iota MODEL_RGBA64 MODEL_NRGBA MODEL_NRGBA64 MODEL_ALPHA MODEL_ALPHA16 MODEL_GRAY MODEL_GRAY16 MODEL_CMYK )
func Limit ¶
func Limit(img image.Image, model ColorModel) (image.Image, ColorModel)
type ImageEncoding ¶
type ImageEncoding int
const ( ENCODING_PNG ImageEncoding = iota ENCODING_JPEG ENCODING_GIF ENCODING_TIFF ENCODING_BMP ENCODING_ICO ENCODING_CUR ENCODING_UNKNOWN )
func ExtensionEncoding ¶
func ExtensionEncoding(ext string) ImageEncoding
type PNGChunkStripper ¶
type PNGChunkStripper struct { Reader io.Reader DataChunks []*PNGDataChunk ErrList []error // contains filtered or unexported fields }
type PNGDataChunk ¶ added in v0.3.0
func NewPNGDataChunk ¶ added in v0.3.0
func NewPNGDataChunk(key string, data string) *PNGDataChunk
func PNGDataChunkDecode ¶ added in v0.3.0
func PNGDataChunkRead ¶ added in v0.3.0
func PNGDataChunkRead(p []byte) (*PNGDataChunk, error)
func TableToDataChunk ¶ added in v0.3.0
func TableToDataChunk(t *golua.LTable) *PNGDataChunk
type PNGDataError ¶ added in v0.3.0
type PNGDataError string
func NewPNGDataError ¶ added in v0.3.0
func NewPNGDataError(err string) PNGDataError
func NewPNGDataErrorf ¶ added in v0.3.0
func NewPNGDataErrorf(format string, args ...interface{}) PNGDataError
func (PNGDataError) Error ¶ added in v0.3.0
func (e PNGDataError) Error() string
Click to show internal directories.
Click to hide internal directories.