GVnc.ColorMap

Fields

Name

Type

Access

Description

colors

GVnc.ColorMapEntry

r/w

offset

int

r/w

size

int

r/w

Methods

class

new (offset, size)

copy ()

free ()

lookup (idx)

set (idx, red, green, blue)

Details

class GVnc.ColorMap
classmethod new(offset, size)
Parameters:
  • offset (int) – the offset at which the color map starts

  • size (int) – the number of entries

Returns:

the new color map

Return type:

GVnc.ColorMap

Allocate a new colour map object able to store colour map entries with indexes in the range offset to offset + size.

The color map must be freed with GVnc.ColorMap.free when no longer required.

copy()
Returns:

the new color map

Return type:

GVnc.ColorMap

Allocate a new color map initializing it with a copy of the data stored in self.

free()

Release the memory associated with the color map self

lookup(idx)
Parameters:

idx (int) – the index to set

Returns:

True if idx was in range, False otherwise

red:

pointer to hold the red value

green:

pointer to hold the green value

blue:

pointer to hold the blue value

Return type:

(bool, red: int, green: int, blue: int)

Lookup the RGB values associated with the colour map entry at position idx

set(idx, red, green, blue)
Parameters:
  • idx (int) – the index to set

  • red (int) – the new red value

  • green (int) – the new green value

  • blue (int) – the new blue value

Returns:

True if idx was in range, False otherwise

Return type:

bool

Update the RGB value associated with the color map entry at position idx.