util

package
v4.1.16 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeImage

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

DecodeImage decode a image and retrun golang image interface

func GetImageHeight

func GetImageHeight(img image.Image) int

GetImageHeight 获取图片高度

func GetImageWidth

func GetImageWidth(img image.Image) int

GetImageWidth 获取图片宽度

func GetImageWidthAndHeight

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

GetImageWidthAndHeight 获取图片宽高

func New3DSlice

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

New3DSlice 创建矩阵

func NewRGBAMatrix

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

NewRGBAMatrix create a new rgba matrix

func Resize

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

Resize 缩放图片

func ResizeForMatrix

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

ResizeForMatrix 缩放图片

Types

type ImageInfo

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

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

func GetResizedImageInfo

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