Documentation
¶
Overview ¶
Package pcx provides support for reading and writing PCX image files. PCX is a raster image format originally developed by ZSoft Corporation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToBMP ¶
ConvertToBMP converts a PCX image to BMP format
func ConvertToGIF ¶
ConvertToGIF converts a PCX image to GIF format
func ConvertToGIFWithPalette ¶
ConvertToGIFWithPalette converts a PCX file to GIF using a custom palette
Types ¶
type Header ¶
type Header struct {
Manufacturer byte // Always 0x0A
Version byte // Version information
Encoding byte // 1 = RLE encoding
BitsPerPixel byte // Bits per pixel per plane
XMin uint16 // Image dimensions
YMin uint16
XMax uint16
YMax uint16
HorzDPI uint16 // Horizontal DPI
VertDPI uint16 // Vertical DPI
Palette [48]byte
Reserved byte
NumPlanes byte // Number of color planes
BytesPerLine uint16 // Bytes per scan line per plane
PaletteInfo uint16 // How to interpret palette (1=color, 2=grayscale)
HorzScreen uint16 // Horizontal screen size
VertScreen uint16 // Vertical screen size
Filler [54]byte
}
Header represents the PCX file header
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader provides methods for reading PCX files
func LoadFromReader ¶
OpenReader opens a PCX file for reading
func (*Reader) BitsPerPixel ¶
BitsPerPixel returns the total bits per pixel
func (*Reader) EmbeddedPalette ¶
EmbeddedPalette returns the 256-color palette embedded at the end of the PCX file as a *gaf.Palette. Returns nil if the file does not carry an embedded palette (PCX header signals the 0x0C marker before the trailing 768 bytes).
TA: Kingdoms uses sidecar PCX files (often 1x1 px) purely as palette containers next to .gaf files, so this is the canonical way to fish the palette out without re-decoding the image data.
func (*Reader) HasEmbeddedPalette ¶
HasEmbeddedPalette returns true if the PCX file has an embedded 256-color palette