OSRenderBitmap Class Reference

Special version of a RenderRegion that can render into a bitmap. For now it is monochrome only. It can also be asked if it is 'blank' - this can be used for proper click detection. If USE_GDRAW_BITMAP is defined then this class is much reduced, its functionality being subsumed by GRenderClick. More...

#include <rendbits.h>

Inheritance diagram for OSRenderBitmap:

OSRenderRegion RenderRegion ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OSRenderBitmap ()

Static Public Member Functions

static RenderRegionCreate (DocRect, Matrix, FIXED16, RenderType rType=RENDERTYPE_MONOBITMAP)
 Creates a region of type OSRenderBitmap (GDI) or GRenderClick (GDraw). Creates a region of type OSRenderBitmap (GDI) or GRenderClick (GDraw).
static BitmapContents GetContents (RenderRegion *, BOOL)
 To investigate whether anything has been rendered into a bitmap-based render region.
static void DebugMe (RenderRegion *, INT32)
 Dupms the current bitmap onto the current view window, so we can see what is going on.

Detailed Description

Special version of a RenderRegion that can render into a bitmap. For now it is monochrome only. It can also be asked if it is 'blank' - this can be used for proper click detection. If USE_GDRAW_BITMAP is defined then this class is much reduced, its functionality being subsumed by GRenderClick.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/11/93

Definition at line 129 of file rendbits.h.


Constructor & Destructor Documentation

OSRenderBitmap::OSRenderBitmap  ) 
 


Member Function Documentation

RenderRegion * OSRenderBitmap::Create DocRect  Rect,
Matrix  ConvertMatrix,
FIXED16  Scale,
RenderType  rType = RENDERTYPE_MONOBITMAP
[static]
 

Creates a region of type OSRenderBitmap (GDI) or GRenderClick (GDraw). Creates a region of type OSRenderBitmap (GDI) or GRenderClick (GDraw).

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/93
Parameters:
None [INPUTS]
None [OUTPUTS]
Returns:
None
See also:
OSRenderRegion::Create

Definition at line 171 of file rendbits.cpp.

00172 {
00173     switch (rType)
00174     {
00175     case RENDERTYPE_MONOBITMAP:
00176 //      TRACE(_T("Creating MONOBITMAP region (%d, %d) - (%d, %d)  GRenderClick\n"), Rect.lo.x, Rect.lo.y, Rect.hi.x, Rect.hi.y);
00177         return new GRenderClick( Rect, ConvertMatrix, Scale, 1, 0.0 );
00178         break;
00179 
00180     case RENDERTYPE_COLOURBITMAP:
00181 //      TRACE(_T("Creating COLOURBITMAP region (%d, %d) - (%d, %d)  GRenderClickColour\n"), Rect.lo.x, Rect.lo.y, Rect.hi.x, Rect.hi.y);
00182         return new GRenderClickColour( Rect, ConvertMatrix, Scale, 32, 0.0 );
00183         break;
00184 
00185     case RENDERTYPE_HITDETECT:
00186 //      TRACE(_T("Creating HITDETECT region (%d, %d) - (%d, %d)  GRenderClickColourNoPaper\n"), Rect.lo.x, Rect.lo.y, Rect.hi.x, Rect.hi.y);
00187         return new GRenderClickColourNoPaper( Rect, ConvertMatrix, Scale, 32, 0.0 );
00188 // BODGE TEST! DO NOT RELEASE!
00189 //      return new GRenderClick( Rect, ConvertMatrix, Scale, 1, 0.0 );
00190         break;
00191 
00192     default:
00193         ENSURE(FALSE, "Invalid RenderType passed to OSRenderBitmap::Create");
00194         return NULL;
00195     }
00196     return NULL;
00197 }

void OSRenderBitmap::DebugMe RenderRegion pRegion,
INT32  Stretch
[static]
 

Dupms the current bitmap onto the current view window, so we can see what is going on.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/11/93
Parameters:
How much you want the image stretched by [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: - Scope: Public static

Definition at line 249 of file rendbits.cpp.

00250 {
00251 
00252     if (pRegion->IsKindOf( CC_RUNTIME_CLASS(GRenderClick) ) )
00253         ((RealClickClass*)pRegion)->DebugMe(Stretch);
00254     else
00255         ERROR3("Wrong class for DebugMe");
00256 }

BitmapContents OSRenderBitmap::GetContents RenderRegion pRegion,
BOOL  JustMiddle
[static]
 

To investigate whether anything has been rendered into a bitmap-based render region.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/11/93
Parameters:
A render region which must have been created with RenderOnTop(MONOBITMAP). [INPUTS] if justmiddle is TRUE, only checks on the centre pixel will be done (which is faster).
None [OUTPUTS]
Returns:
BITMAPCONTENTS_CENTRE if centre pixel is set, _ANY if any pixel is set, _NONE if none and _ERROR if failed for some reason.

Errors: Will ENSURE if NULL render region, if it is not really a OSRenderBitmap. Scope: Static

Definition at line 222 of file rendbits.cpp.

00223 {
00224     ERROR2IF( pRegion==NULL, BITMAPCONTENTS_ERROR, "NULL pRegion" );
00225 
00226     ERROR2IF( !pRegion->IsKindOf(CC_RUNTIME_CLASS(GRenderClick)), BITMAPCONTENTS_ERROR, "Wrong class"  );
00227 
00228     RealClickClass *pBitmap = (RealClickClass*)pRegion;             // safe to cast now
00229     return pBitmap->GetContents( JustMiddle );                      // then use member fn
00230 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:59:16 2007 for Camelot by  doxygen 1.4.4