texture

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package texture handles Stunt GP texture conversion

Index

Constants

View Source
const (
	FIncorrect = iota // we”ll default to FPC
	// TODO check PS2/prototype versions for this
	FUnknown   // we don't have any examples of these textures at all
	FPaletted  // paletted images used by PS2
	FPC        // Windows version
	FDreamcast // Dreamcast swizzled textures
	FPSTwo     // PS2 textures with swapped R B channels
)

TODO there's gotta be a better way

View Source
const FormatName = "stuntGP"

FormatName is the name of the registered texture format

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader) (image.Image, error)

Decode reads a Stunt GP texture image from r and returns it as an image.Image.

func DecodeConfig

func DecodeConfig(r io.Reader) (image.Config, error)

DecodeConfig returns the color model and dimensions of a Stunt GP texture without decoding the entire image.

func Encode

func Encode(w io.Writer, m image.Image) error

Encode writes the Image m to w in Stunt GP texture format. Any Image may be encoded, but images that are not ARGB1555 might be encoded lossily.

Types

type Encoder

type Encoder struct {
	Compress bool
	Format   int
}

Encoder configures encoding Stunt GP textures

func (*Encoder) Encode

func (enc *Encoder) Encode(w io.Writer, m image.Image) error

Encode writes the Image m to w in Stunt GP texture format.

type FormatError

type FormatError string

A FormatError reports that the input is not a valid StuntGP texture.

func (FormatError) Error

func (e FormatError) Error() string

Jump to

Keyboard shortcuts

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