Image datatypes

class pygarmin.datatype.RGBA(red=0, green=0, blue=0, unused=0)

Bases: DataType

RGBA is a sRGB format that uses 32 bits of data per pixel.

Each channel (red, green, blue, and alpha) is allocated 8 bits per pixel (bpp). The alpha channel is unused. Instead, a color is used for transparency. Most devices make magenta (255,0,255) transparent.

get_bytearray()

Return the color as bytearray.

get_rgb()

Return an RGB tuple.

class pygarmin.datatype.ImageProp(idx=0, writable=False, image_type=0)

Bases: DataType

class pygarmin.datatype.ImageList

Bases: DataType

class pygarmin.datatype.ImageName

Bases: DataType

class pygarmin.datatype.ImageInformationHeader

Bases: DataType

class pygarmin.datatype.ImageId

Bases: DataType

class pygarmin.datatype.ImageColorTable(id=0, colors=b'')

Bases: DataType

BMP color table.

The color table is a block of bytes listing the colors used by the image. Each pixel in an indexed color image is described by a number of bits (1, 4, or 8) which is an index of a single color described by this table. The purpose of the color palette in indexed color bitmaps is to inform the application about the actual color that each of these index values corresponds to.

The colors in the color table are specified in the 4-byte per entry RGBA format. Each entry in the color table occupies 4 bytes, in the order blue, green, red, 0x00.

get_palette()

Returns the RGB color palette as a list of bytearray.

class pygarmin.datatype.ImageChunk(id=0, chunk=b'')

Bases: DataType