Class Hierarchy   Compound List   Compound Members   Related Pages  

NativeBitmap Class Reference

#include <display.h>

List of all members.

Public Members

 NativeBitmap ( NativePlayerWnd* native, const SColorTable* ctab, int width, int height, int depth, int pixelFormat )
 ~NativeBitmap ()
int Height ()
int Width ()
U8* Bits ()
int ScanLine ()
int PixelFormat ()
int Depth ()
void Flush ()
void BltNativeToScreen ( NativePlayerWnd* native, int xDest, int yDest, int cx, int cy, int xSource, int ySource )
void ClearScreen ( NativePlayerWnd* )


Detailed Description

The NativeBitmap is a wrapper around a block of memory treated as a raster device. The "defining function" of this class is the BitBlt - which moves the bits in memory to the screen. Many OSs have a rather specific idea of what a bitmap is. NativeBitmap wraps this OS dependent object and presents an interface to the main Flash code. The closer the OS bitmap is to a block of bits in memory (as opposed to an abstract object) the easier it will be to port, and the better the results will be. Flash will create and destroy the NativeBitmap in order that it has the same dimensions as the player window.

Member Function Documentation

NativeBitmap::NativeBitmap (NativePlayerWnd * native, const SColorTable * ctab, int width, int height, int depth, int pixelFormat)

Fully contstructs a bitmap - after construction, it can be read or written at any time.

Parameters:
native - Pointer back to the native code, so that OS dependant states can be queried.
ctab - For Indexed modes, this cotains the palette.
width - Not guaranteed to be word aligned.
height -
depth - The number of bits per pixel.
pixelFormat - How to interpret pixel data. See PixelFormat.

int NativeBitmap::Height ()

Height, in pixels.

int NativeBitmap::Width ()

Width, , in pixels.

U8 * NativeBitmap::Bits ()

Pointer to the base address of bitmap memory.

int NativeBitmap::ScanLine ()

Bytes of memory per row of pixels.

int NativeBitmap::PixelFormat ()

Valid formats are: pix1, pix4, pix8, pix16, pix16A, pix24, pix32, pix32A.

int NativeBitmap::Depth ()

The number of pixels per byte.

void NativeBitmap::Flush ()

Flush is only meaningful if you have to worry about graphics commands being queued on your OS. Win and Mac, mainly. Mac code looks like: while ( !QDDone((GrafPort*)bits->m_gWorld) ) ;

void NativeBitmap::BltNativeToScreen (NativePlayerWnd * native, int xDest, int yDest, int cx, int cy, int xSource, int ySource)

BltNativeToScreen transfers a block of pixels from memory to the display. All parameters are input.

Parameters:
native - Since the information needed to make a screen blit is dependent on the OS, no assumption is made about what info you might need. Therefore, a BltToScreen() passes (as input) a pointer to the NativePlayerWnd so it can be queried for things like the current window handle, graphics context, etc. These query functions in the NativePlayerWnd are up to the implementor.
xDest - X value of upper left target on screen.
yDest - Y value of upper left target on screen.
cx - X size of pixels to blt.
cy - Y size of pixels to blt.
xSource - X coordinate of source pixels (in this object).
ySource - Y coordinate of source pixels (in this object).

void NativeBitmap::ClearScreen (NativePlayerWnd *)

Clears the screen when nothing is going on.


The documentation for this classwas generated from the following file:

Version 1.0 of the Flash 4 Porting SDK                        Middlesoft, Inc.