Documentation ¶
Overview ¶
Package text contains an image plain text file format encoder and decoder.
A super simple format of the form:
! SKTEXTSIMPLE width height 0x000000ff 0xffffffff ... 0xddddddff 0xffffff88 ... ...
Where the pixel values are encoded as 0xRRGGBBAA.
Grayscale pixels can be encoded as 0xXX. The two images below are equivalent:
! SKTEXTSIMPLE 2 2 0x00 0x11 0xaa 0xbb
! SKTEXTSIMPLE 2 2 0x000000ff 0x111111ff 0xaaaaaaff 0xbbbbbbff
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode reads an SKTEXT image from r and returns it as an image.Image. The type of Image returned will always be NRGBA.
func DecodeConfig ¶
DecodeConfig returns the color model and dimensions of SKTEXT image without decoding the entire image.
func MustToGray ¶
MustToGray calls MustToNRGBA with the given string and converts the returned image to grayscale.
func MustToNRGBA ¶
MustToNRGBA returns an *image.NRGBA from a given string, which is assumed to be an image in the SKTEXTSIMPLE "codec". It panics if the string cannot be processed into an image, suitable only for testing code.
Types ¶
This section is empty.