RGBBuffer


super: Object

A RGBBuffer object is used for Image direct-color pixel manipulations. A pixel can be read or written by setting its red, green, blue and alpha components.

Events

  • Load() This event is called when the object becames available in the current runtime system.

  • Unload() This event is called when the object has been removed from the current runtime system (but not yet deallocated).

Properties

  • var width: Int The width of the RGBBuffer. (read-only)

  • var height: Int The height of the RGBBuffer. (read-only)

  • var image: Image Create an Image from the RGBBuffer values. (read-only)

Class Methods

  • func valueFromRGB(red: Int, green: Int, blue: Int, alpha: Int = 255): Int Convert parameters to a 32bit packet value.

Initializers

  • func RGBBuffer(width: Int, height: Int) Initializes and returns a new RGBSurface with the specified width and height.

Methods

  • func getColor(x: Int, y: Int): Color Get Color component at the specified x, y coordinates.

  • func getValue(x: Int, y: Int): Int Get packet 32bit value at the specified x, y coordinates.

  • func setColor(x: Int, y: Int, color: Color): Bool Set Color component at the specified x, y coordinates.

  • func setValue(x: Int, y: Int, value: Int): Bool Set packet 32bit value at the specified x, y coordinates.

  • func setRGB(x: Int, y: Int, red: Int, green: Int, blue: Int, alpha: Int = 255): Bool Set RGBA values at the specified x, y coordinates.