tga

package module
Version: v0.0.0-...-bd8e8d5 Latest Latest
Warning

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

Go to latest
Published: May 24, 2015 License: MIT Imports: 8 Imported by: 9

README

tga

tga is a Go package for decoding and encoding TARGA image format.

It supports RLE and raw TARGA images with 8/15/16/24/32 bits per pixel, monochrome, truecolor and colormapped images. It also correctly handles origins, attribute type in extensions area and successfully passes TGA 2.0 conformance suite (http://googlesites.inequation.org/tgautilities).

Encoding an image doesn't involve conversion if it's image.Gray, image.RGBA or image.NRGBA. Other types are converted to image.NRGBA prior to encoding.

Installation

$ go get github.com/ftrvxmtrx/tga

Documentation and examples

tga on godoc.org

License

Code is licensed under the MIT license (see LICENSE.MIT).

Several sample image files in testdata directory are copyright to TrueVision, Inc. and are freely available, free of charge and under no licensing terms at http://googlesites.inequation.org/tgautilities

These sample images (and those which were converted from them) are:

bw.png
cbw8.tga
ccm8.tga
color.png
ctc16.tga
ctc24.tga
ctc32.tga
ubw8.tga
ucm8.tga
utc16.tga
utc24.tga
utc32.tga

Documentation

Overview

Package tga is a TARGA image format decoder/encoder.

Supports RLE and raw TARGA images with 8/15/16/24/32 bits per pixel, monochrome, truecolor and colormapped images. Correctly handles origins and attribute type in extensions area. Passes TGA 2.0 conformance suite (http://googlesites.inequation.org/tgautilities).

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlphaSize    = errors.New("tga: invalid alpha size")
	ErrFormat       = errors.New("tga: invalid format")
	ErrPaletteIndex = errors.New("tga: palette index out of range")
)

Functions

func Decode

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

Decode decodes a TARGA image.

func DecodeConfig

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

DecodeConfig decodes a header of TARGA image and returns its configuration.

func Encode

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

Encode encodes an image into TARGA format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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