tga

package module
v0.0.0-...-c50bca4 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2014 License: MIT Imports: 8 Imported by: 0

README

go-targa

targa image decoder/encoder for golang

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DataTypeStrings = map[uint8]string{
	0:  "No image data included.",
	1:  "Uncompressed, color-mapped images.",
	2:  "Uncompressed, RGB images.",
	3:  "Uncompressed, black and white images.",
	9:  "Runlength encoded color-mapped images.",
	10: "Runlength encoded RGB images.",
	11: "Compressed, black and white images.",
	32: "Compressed color-mapped data, using Huffman, Delta, and runlength encoding.",
	33: "Compressed color-mapped data, using Huffman, Delta, and runlength encoding. 4-pass quadtree-type process.",
}

Functions

func Decode

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

Decode reads a Targa image from r and returns it as an image.Image. The type of Image returned depends on the Targa contents.

func DecodeConfig

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

DecodeConfig returns the global color model and dimensions of a Targa image without decoding the entire image.

Types

type FormatError

type FormatError string

func (FormatError) Error

func (e FormatError) Error() string
type Header struct {
	Idlength        uint8
	Colourmaptype   uint8
	Datatypecode    uint8
	Colourmaporigin uint16
	Colourmaplength uint16
	Colourmapdepth  uint8
	X_origin        uint16
	Y_origin        uint16
	Width           uint16
	Height          uint16
	Bitsperpixel    uint8
	Imagedescriptor uint8
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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