loaders

package
v0.0.0-...-50d5a6e Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileData

func GetFileData(filename string) ([]byte, error)

func GetFilesList

func GetFilesList() []string

func Init

func Init() error

func InitPNGLoader

func InitPNGLoader()

Initialize the png loader instance

func LoadImageFromData

func LoadImageFromData(name string, data []byte) (*image.NRGBA, error)

Loads an image into the png cache Make it work for now and then come back to this wehn we have more engine resources to load

func LoadPNG

func LoadPNG(path string) *image.NRGBA

Loads an image from the image cache If no image is found, load from assets folder

func LoadPNGFromResources

func LoadPNGFromResources(path string) *image.NRGBA

Types

type ImageLoader

type ImageLoader struct {
	Type  ImageType
	Image *image.Image
}

func NewImageLoader

func NewImageLoader(fileType ImageType) *ImageLoader

func (*ImageLoader) FlipImageH

func (loader *ImageLoader) FlipImageH()

func (*ImageLoader) FlipImageV

func (loader *ImageLoader) FlipImageV()

func (*ImageLoader) LoadImage

func (loader *ImageLoader) LoadImage(name string) (*image.Image, error)

func (*ImageLoader) LoadImageRaw

func (loader *ImageLoader) LoadImageRaw(name string) (*image.Image, error)

Returns the raw, flipped version of the image

func (*ImageLoader) ToNRGBA

func (loader *ImageLoader) ToNRGBA() (*image.NRGBA, error)

type ImageType

type ImageType byte
const (
	PNG ImageType = iota
	JPEG
)

type PNG_LOADER

type PNG_LOADER struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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