RedBMP:
Filter:
redSys/Classes (extension) | Red > redTools

RedBMP
ExtensionExtension

bitmap images

Description

Read and write .bmp files from disk. Handles 1, 4, 8, 16, 24 and 32bit depths. Includes simple -makeWindow and -plot methods to display the pixels (but you should really write your own).

See http://en.wikipedia.org/wiki/BMP_file_format

Class Methods

.new

Create an empty bitmap image.

.read

Create a RedBMP by reading a .bmp file from disk.

Instance Methods

.write

Write the bitmap image to disk.

.plot

Generates an Image and display it.

.makeWindow

Display the pixels using Pen and fillRect.

.type

A string. "BM".

.width

.height

Image dimensions in pixels.

.depth

Colour depth. 1, 4, 8, 16, 24 or 32.

.compression

When read from disk.

.palette

Colour table as a 1-dimensional array of Color objects. Size 256 for 8bit images, size 16 for 4bit images and size 2 for 1bit images.

.data

The pixel data as a 1-dimensional array of Color objects. Reading from left to right, top to bottom. If you create your own make the size width*height.

.asImage

Converts the data to an Image and return it. NOTE: remember to free the image.

.asInt32Array

Converts the data to an Int32Array and return it.

Examples