TypeLib Xojo support Plugin

RawBitmap Class (console safe)

A class to handle bitmaps on memory block level without dependency to Xojo’s Graphics functions.

Xojo’s console pictures suffer from loss of data because of the 7 bit alpha channel and their also extremely slow since their console images need to allocate one buffer per line in the image.

Xojo’s desktop pictures also are not consistent since some platforms use pre-multiplied alphas and others not. The premultiplied alphas also loose precision which makes them not suitable for most image processing.

See more info on the Xojo’s premultiplied alphas at: Premultiplied alpha channels in Xojo

Object
   RawBitmap

class RawBitmap

Constructors

RawBitmapConstructs a new 4 channel RawBitmap with a given width and given height.
RawBitmapConstructs a new RawBitmap with a given width, given height and given number of channels.
RawBitmapConstructs a new RawBitmap with a given width, given height, given number of channels and given rowBytes value.
RawBitmapConstructs a RawBitmap with a given color space. This constructor can either take external MemoryBlock or handle allocating the MemoryBlock buffer.

Properties

Channels (console safe) Returns the number of channels in the bitmap.
Height (console safe) Returns the height of the Bitmap in pixels.
HorizontalResolution (console safe) Returns the horizontal resolution of the image. (This can be set if the image was for example read from Jpg)
ImageFormat (console safe) Returns the format of the color components in the RawBitmap
IsValid (console safe) Returns true if creating instance of the RawBitmap created valid instance, else false.
MemoryBlock (console safe) Returns the memory block that is under the hood in the RawBitmap.
PixelBytes (console safe) Returns number of bytes per pixel in the image.
RowBytes (console safe) Returns the number of bytes in each row of the bitmap.
VerticalResolution (console safe) Returns the vertical resolution of the image. (This can be set if the image was for example read from Jpg)
Width (console safe) Returns the width of the Bitmap in pixels.

Methods

DrawBitmap (console safe) Draws a RawBitmap into the RawBitmap
DrawLine (console safe) Draws a line at given location into the RawBitmap with a given color.
DrawLineAntialiased (console safe) Draws antialiased line at given location into the RawBitmap with a given color.
FillRect (console safe) Draws filled rectangle of given color
Pixel (console safe) Sets or gets the color of a pixel in the RawBitmap

Enumerations

RawBitmapFormatEnum that represents the format of the color components. The constants are named as follows:
  • g - Stands for grayscale channel.
  • A - Stands for alpha channel.
  • R - Stands for red channel.
  • G - Stands for green channel.
  • G - Stands for blue channel.
  • Supported Platforms:

  • MacOS X Carbon
  • MacOS X Cocoa 32 bit
  • MacOS X Cocoa 64 bit
  • Windows 32 bit
  • Windows 64 bit
  • Linux 32 bit
  • Linux 64 bit
  • Linux ARM