blp

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DXT1 = 1
	DXT3 = 3
	DXT5 = 5
)
View Source
const (
	// Similar to GIF. Uses 8-bit values as index to 256-color palette, ideal for low-res bitmaps.
	TextureRaw = 1
	// Uses S3 Texture Compression algorithm (S3TC/DXT/DXTC)
	TextureS3 = 2
	// Data is stored as a plain ARGB stream. Used when every bit of quality is required.
	TextureUncompressed = 3
)

Variables

View Source
var BLP2 [4]byte

Functions

func Decode

func Decode(file io.ReadSeeker) (*image.NRGBA, error)

Decode a BLP stream from a file-like interface into an *image.NRGBA (satisfies image.Image)

func DecodeBytes

func DecodeBytes(blpData []byte) (*image.NRGBA, error)

Decode a BLP data buffer into an *image.NRGBA (satisfies image.Image)

func Encode

func Encode(source image.Image, writer io.Writer, textureCompression uint8) error

Types

type Header struct {
	Version       [4]byte
	Type          uint32
	Compression   uint8
	AlphaDepth    uint8
	AlphaType     uint8
	HasMips       uint8
	Width         uint32
	Height        uint32
	MipmapOffset  [16]uint32
	MipmapLengths [16]uint32
	ColorPalette  [256][4]byte
}

Jump to

Keyboard shortcuts

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