pcx

package module
v0.0.0-...-29eb47f Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2019 License: MIT Imports: 7 Imported by: 1

README

pcx

Go package for decoding PC Paintbrush pcx images

An in-depth analysis of the format is available here: http://justsolve.archiveteam.org/wiki/PCX

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode8Bit256Color

func Decode8Bit256Color(r io.Reader) (img image.Image, err error)

Decode8Bit256Color decodes 8-bit 256 color pcx data into an image.

Types

type Container

type Container struct {
	Header  Header
	Data    []byte
	Palette []color.Color
}

Container holds the raw PCX header and data.

type Header struct {
	Marker               byte // The first byte of a PCX file is 0x0a.
	Version              byte // The second byte (the version number) is 0, 2, 3, 4, or 5.
	Encoding             byte // The third byte (the encoding) is 1 or (rarely) 0.
	BitsPerPixelPerPlane byte
	WindowXMin           uint16 // ImageWidth = Xmax - Xmin + 1
	WindowYMin           uint16 // ImageHeight = Ymax - Ymin + 1
	WindowXMax           uint16 // a 200px high image would have Ymin=0 Ymax=199
	WindowYMax           uint16
	VerticalDPI          uint16   // unreliable
	HorizontalDPI        uint16   // unreliable
	Palette16            [48]byte // 16 color palette in header

	NumPlanes            byte
	BytesPerPlaneLine    uint16
	PaletteInfo          uint16 // How to interpret the palette 1 = Color/BW 2 = Grayscale
	HorizontalScreenSize uint16
	VerticalScreenSize   uint16
	// contains filtered or unexported fields
}

Header holds information about a pcx file

Jump to

Keyboard shortcuts

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