util

package
v3.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeImage added in v3.0.8

func DecodeImage(filePath string) (img image.Image, err error)

DecodeImage decode a image and retrun golang image interface

func GetImageHeight added in v3.0.8

func GetImageHeight(img image.Image) int

GetImageHeight 获取图片高度

func GetImageWidth added in v3.0.8

func GetImageWidth(img image.Image) int

GetImageWidth 获取图片宽度

func GetImageWidthAndHeight

func GetImageWidthAndHeight(filename string) (width, height int)

GetImageWidthAndHeight 获取图片宽高

func New3DSlice added in v3.0.8

func New3DSlice(x int, y int, z int) (theSlice [][][]uint8)

New3DSlice 创建矩阵

func NewRGBAMatrix added in v3.0.8

func NewRGBAMatrix(height int, width int) (rgbaMatrix [][][]uint8)

NewRGBAMatrix create a new rgba matrix

func Resize added in v3.0.8

func Resize(src *image.NRGBA, width int, height int) *image.NRGBA

Resize 缩放图片

func ResizeForMatrix added in v3.0.8

func ResizeForMatrix(filepath string, width int, height int) (imgMatrix [][][]uint8, err error)

ResizeForMatrix 缩放图片

Types

type ImageInfo added in v3.0.8

type ImageInfo struct {
	DataUInt8 []uint8
	Width     int
	Height    int
}

ImageInfo 包含图片数据和宽高信息的结构体

func GetResizedImageInfo added in v3.0.8

func GetResizedImageInfo(filename string) (imageInfo ImageInfo)

GetResizedImageInfo 获取适配SDK大小的图片,并转为BGR格式的数据

Jump to

Keyboard shortcuts

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