Documentation
¶
Overview ¶
A package for decoding and handling .xp files produced by Kyzrati's fabulous REXPaint program, the gold-standard in ASCII art drawing programs. It can be found at www.gridsagegames.com/rexpaint.
reximage is part of the Tyumi engine by Benjamin Nicholls, but feel free to use it as a standalone package!
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CellData ¶
type CellData struct { Glyph uint32 // ASCII code for glyph R_f uint8 // Foreground Colour - Red channel G_f uint8 // Foreground Colour - Green channel B_f uint8 // Foreground Colour - Blue channel R_b uint8 // Background Colour - Red channel G_b uint8 // Background Colour - Green channel B_b uint8 // Background Colour - Blue channel }
CellData holds the decoded data for a single cell. Colours are split into uint8 components so the user can combine them into whatever colour format they need. Some popular colour format conversion functions are provided as well.
func (CellData) ARGB ¶
ARGB returns the foreground and background colours of the cell in ARGB format. Alpha in this case is always set to maximum (255).
func (*CellData) Clear ¶ added in v1.1.0
func (cd *CellData) Clear()
Clear removes the cell's glyph and sets the cell's colours to the rexpaint default. A cleared cell will be considered undrawn.
func (CellData) RGBA ¶
RGBA returns the foreground and background colours of the cell in RGBA format. Alpha in this case is always set to maximum (255).
func (*CellData) SetColoursARGB ¶ added in v1.1.0
SetColoursRGBA sets the colours of the cell, interpreting the input uint32 colours in ARGB8888 format. If background alpha is 0, the cell is set to undrawn. Foreground alpha is ignored.
func (*CellData) SetColoursRGBA ¶ added in v1.1.0
SetColoursRGBA sets the colours of the cell, interpreting the input uint32 colours in RGBA8888 format. If background alpha is 0, the cell is set to undrawn. Foreground alpha is ignored.
type ImageData ¶
ImageData is the struct holding the decoded and exported image data.
func Import ¶
Import imports an image from the xp file at the provided path. Returns the Imagedata and an error. If an error is present, ImageData will be no good.
func (ImageData) GetCell ¶
GetCell returns the CellData at coordinate (x, y) of the decoded image, with (0,0) at the top-left of the image.