Name: | Bitmap |
Version: | 1 |
ID: | ID_BITMAP |
Status: | Unspecified |
Include: | graphics/bitmap.h |
Date: | July 2001 |
Author: | Rocklyte Systems |
Copyright: | Rocklyte Systems, 1996-2001. All rights reserved. |
The Bitmap provides a way of describing an area of memory that an application can draw to, and/or display if the data is held in video memory. Bitmaps are used in the handling of Screen and Picture objects and form the backbone behind all graphics functionality. Without it there would be no user interface, so expect to use this class regularly during your programming. It would be wise to read the majority of this document so that you can familiarise yourself with how the Bitmap class works.
The Bitmap class includes a number of methods that can be used to draw graphics to a Bitmap's image area. Please note that these methods are designed to be called under exclusive conditions and it is not possible to message a Bitmap with any of the methods that are available.
You can save a Bitmap's image to a data object by using the SaveImage action and raw data can be processed through the use of the Read and Write actions.
The Bitmap class supports the following actions:
Clear Clears a Bitmap's image to a colour of black. CopyData Copies Bitmap image data to other Bitmaps with colour remapping enabled. Draw Clears a Bitmap's image to its assigned background colour. Init Initialises a Bitmap. Query Fills a Bitmap with pre-initialised/default values prior to initialisation. Read Reads raw image data from a Bitmap object. Resize Resizes a Bitmap object's dimensions. SaveImage Saves a Bitmap's image to a data object of your choosing in PCX format. Seek Changes the current byte position for read/write operations. Write Writes raw image data to a Bitmap object.
The Bitmap class implements the following methods:
BlitArea Blits a rectangular area from one Bitmap to another. DrawLine Draws a line to a Bitmap. DrawPixel Draws a single pixel to a Bitmap. DrawRGBPixel Draws a 24 bit pixel to a Bitmap. DrawRectangle Draws rectangles, both filled and unfilled. FlipBitmap Flips a Bitmap around the horizontal or vertical axis. Flood Fills a Bitmap area with a specific colour. ReadPixel Reads a pixel's colour from the target Bitmap. ReadRGBPixel Reads a pixel's RGB colour from the target Bitmap.
The Bitmap object consists of the following public fields:
AmtColours The amount of colours in a Bitmap. BitsPerPixel The amount of bits per pixel ByteWidth The width of a Bitmap in bytes. BytesPerPixel The amount of bytes per pixel. ClipBottom Defines the bottom edge of a Bitmap's clipping region. ClipLeft Defines the left edge of a Bitmap's clipping region. ClipRight Defines the right edge of a Bitmap's clipping region. ClipTop Defines the top edge of a Bitmap's clipping region. ColourRGB The background colour of a Bitmap. Data Pointer to a Bitmap's data area. DataFlags Defines the memory flags to use in allocating a Bitmap's data area. Flags Optional flags. Height The height of a Bitmap in pixels. LineMod The differential between each line in a Bitmap. MaskIndex The colour index to use for masking. MaskRGB The colour to use for masking. Palette Points to a Bitmap's colour palette. PixelMode Used for reading raw image data from video and blitter based Bitmaps. PlaneMod The differential between each Bitmap plane. Position The current read/write data position. Size The total size of a Bitmap in bytes. Type Defines the data type of a Bitmap. Width The width of a Bitmap in pixels.
Action: | Clear | |
Short: | Clears a Bitmap's image to a colour of black. | |
|
Action: | Init | |
Short: | Initialises a Bitmap. | |
|
Action: | Query | |
Short: | Fills a Bitmap with pre-initialised/default values prior to initialisation. | |
|
Method: | BlitArea() | ||||||||||||||||
Short: | Blits a rectangular area from one Bitmap to another. | ||||||||||||||||
Arguments: |
| ||||||||||||||||
|
Method: | DrawLine() | ||||||||||||||
Short: | Draws a line to a Bitmap. | ||||||||||||||
Arguments: |
| ||||||||||||||
|
Method: | DrawPixel() | |||||||||
Short: | Draws a single pixel to a Bitmap. | |||||||||
Arguments: |
| |||||||||
|
Method: | DrawRGBPixel() | ||||||||||
Short: | Draws a 24 bit pixel to a Bitmap. | ||||||||||
Synopsis: | LONG XCoord, LONG YCoord, LONG Red, LONG Green, LONG Blue | ||||||||||
Arguments: |
| ||||||||||
|
Method: | DrawRectangle() | ||||||||||||||
Short: | Draws rectangles, both filled and unfilled. | ||||||||||||||
Arguments: |
| ||||||||||||||
|
Method: | FlipBitmap() | |||||||
Short: | Flips a Bitmap around the horizontal or vertical axis. | |||||||
Arguments: |
| |||||||
|
Method: | Flood() | ||||||||||
Short: | Fills a Bitmap area with a specific colour. | ||||||||||
Arguments: |
| ||||||||||
|
Method: | ReadPixel() | |||||||
Short: | Reads a pixel's colour from the target Bitmap. | |||||||
Arguments: |
| |||||||
|
Method: | ReadRGBPixel() | ||||||||||
Short: | Reads a pixel's RGB colour from the target Bitmap. | ||||||||||
Arguments: |
| ||||||||||
|
Field: | AmtColours | |
Short: | The amount of colours in a Bitmap. | |
Type: | LONG | |
Status: | Read/Init | |
|
Field: | BitsPerPixel | |
Short: | The amount of bits per pixel | |
Type: | LONG | |
Status: | Read/Init | |
|
Field: | ByteWidth | |
Short: | The width of a Bitmap in bytes. | |
Type: | LONG | |
Status: | Read | |
|
Field: | BytesPerPixel | |
Short: | The amount of bytes per pixel. | |
Type: | LONG | |
Status: | Read | |
|
Field: | ClipBottom | |
Short: | Defines the bottom edge of a Bitmap's clipping region. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | ClipLeft | |
Short: | Defines the left edge of a Bitmap's clipping region. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | ClipRight | |
Short: | Defines the right edge of a Bitmap's clipping region. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | ClipTop | |
Short: | Defines the top edge of a Bitmap's clipping region. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | ColourRGB | |
Short: | The background colour of a Bitmap. | |
Type: | RGB | |
Status: | Read/Set | |
|
Field: | Data | |
Short: | Pointer to a Bitmap's data area. | |
Type: | APTR | |
Status: | Read/Set | |
|
Field: | DataFlags | |
Short: | Defines the memory flags to use in allocating a Bitmap's data area. | |
Type: | LONG | |
Prefix: | MEM | |
Status: | Read/Init | |
|
Field: | Flags | |||||||||
Short: | Optional flags. | |||||||||
Type: | LONG | |||||||||
Prefix: | BMF | |||||||||
Status: | Read/Init | |||||||||
|
Field: | Height | |
Short: | The height of a Bitmap in pixels. | |
Type: | LONG | |
Status: | Read/Init | |
|
Field: | LineMod | |
Short: | The differential between each line in a Bitmap. | |
Type: | LONG | |
Status: | Read | |
|
Field: | MaskIndex | |
Short: | The colour index to use for masking. | |
Type: | LONG | |
Status: | Read/Init | |
|
Field: | MaskRGB | |
Short: | The colour to use for masking. | |
Type: | RGB | |
Status: | Read/Set | |
|
Field: | Palette | |
Short: | Points to a Bitmap's colour palette. | |
Type: | struct RGBPalette * | |
Status: | Read/Set | |
|
Field: | PixelMode | |
Short: | Used for reading raw image data from video and blitter based Bitmaps. | |
Type: | LONG | |
Status: | Set | |
|
Field: | PlaneMod | |
Short: | The differential between each Bitmap plane. | |
Type: | LONG | |
Status: | Read | |
|
Field: | Position | |
Short: | The current read/write data position. | |
Type: | LONG | |
Status: | Read | |
|
Field: | Size | |
Short: | The total size of a Bitmap in bytes. | |
Type: | LONG | |
Status: | Read | |
|
Field: | Type | |
Short: | Defines the data type of a Bitmap. | |
Type: | LONG | |
Status: | Read/Init | |
|
Field: | Width | |
Short: | The width of a Bitmap in pixels. | |
Type: | LONG | |
Status: | Read/Init | |
|