DIBConvert Class Reference

#include <dibconv.h>

Inheritance diagram for DIBConvert:

Conv24to32 Conv24to8 Conv32to1 Conv32to24 Conv32to32 Conv32to4 Conv32to8 Conv8to32 List of all members.

Public Member Functions

 DIBConvert ()
 Base class to convert bitmap depths.
virtual ~DIBConvert ()
virtual BOOL Convert (LPBYTE Input, LPBYTE Output, UINT32 Height, BOOL FirstStrip=TRUE)=0

Static Public Member Functions

static BOOL Init ()
static void DeInit ()
static DIBConvertCreate (UINT32 SourceDepth, UINT32 DestDepth, UINT32 Width, LPLOGPALETTE DestPal, UINT32 DitherType=XARADITHER_ORDERED_GREY)
static DIBConvertCreate (LPBITMAPINFO pSourceHeader, UINT32 DestDepth, UINT32 DitherType=XARADITHER_ORDERED_GREY)
 Alternative Creation function.

Static Protected Member Functions

static GDrawContextGetConvertContext (void)

Static Protected Attributes

static GDrawContextConvertContext = NULL

Detailed Description

Definition at line 118 of file dibconv.h.


Constructor & Destructor Documentation

DIBConvert::DIBConvert  ) 
 

Base class to convert bitmap depths.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>?
Date:
29/06/96

Definition at line 282 of file dibconv.cpp.

00283 {
00284 }

DIBConvert::~DIBConvert  )  [virtual]
 

Definition at line 286 of file dibconv.cpp.

00287 {
00288 }


Member Function Documentation

virtual BOOL DIBConvert::Convert LPBYTE  Input,
LPBYTE  Output,
UINT32  Height,
BOOL  FirstStrip = TRUE
[pure virtual]
 

Implemented in Conv32to32, Conv32to24, Conv32to8, Conv32to4, Conv32to1, Conv24to8, Conv8to32, and Conv24to32.

DIBConvert * DIBConvert::Create LPBITMAPINFO  pSourceHeader,
UINT32  DestDepth,
UINT32  DitherType = XARADITHER_ORDERED_GREY
[static]
 

Alternative Creation function.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/11/96

Definition at line 370 of file dibconv.cpp.

00371 {
00372     DitherType = DitherType;
00373     UINT32 SourceDepth = pSourceHeader->bmiHeader.biBitCount;
00374 
00375     if (SourceDepth == 8)
00376     {
00377         if (DestDepth==32)
00378             return new Conv8to32( pSourceHeader );
00379     }
00380     if (SourceDepth == 24)
00381     {
00382         if (DestDepth==32)
00383             return new Conv24to32( pSourceHeader );
00384     }
00385     return NULL;
00386 }

DIBConvert * DIBConvert::Create UINT32  SourceDepth,
UINT32  DestDepth,
UINT32  Width,
LPLOGPALETTE  DestPal,
UINT32  DitherType = XARADITHER_ORDERED_GREY
[static]
 

Definition at line 324 of file dibconv.cpp.

00325 {
00326     ERROR2IF(DestDepth<=8 && Palette==NULL,NULL,"DIBConvert::Create null palette specified");
00327     
00328     switch(SourceDepth)
00329     {
00330     case 32:
00331         {
00332             switch(DestDepth)
00333             {
00334             case 24:
00335                 return new Conv32to24( Width );
00336             case 8:
00337                 return new Conv32to8( Width, Palette, DitherType );
00338             case 4:
00339                 return new Conv32to4( Width, Palette, DitherType );
00340             case 1:
00341                 return new Conv32to1( Width, Palette, DitherType );
00342             case 32:
00343                 return new Conv32to32( Width );
00344             default:
00345                 return NULL;
00346             }
00347         }
00348     case 24:
00349         {
00350             if (DestDepth==8)
00351                 return new Conv24to8( Width, Palette, DitherType );
00352         }
00353     default:
00354         return NULL;
00355     }
00356 
00357     return NULL;
00358 }

void DIBConvert::DeInit  )  [static]
 

Definition at line 305 of file dibconv.cpp.

00306 {
00307     if (ConvertContext != NULL)
00308     {
00309         delete ConvertContext;
00310         ConvertContext = NULL;
00311     }
00312 }

GDrawContext * DIBConvert::GetConvertContext void   )  [static, protected]
 

Definition at line 315 of file dibconv.cpp.

00316 {
00317     if (ConvertContext != NULL)
00318         return(ConvertContext);
00319     else
00320         return(GRenderRegion::GetStaticDrawContext());
00321 }

BOOL DIBConvert::Init  )  [static]
 

Definition at line 292 of file dibconv.cpp.

00293 {
00294     if (ConvertContext == NULL)
00295         ConvertContext = new GDrawAsm();
00296 
00297     if (ConvertContext)
00298         ConvertContext->Init();
00299 
00300     // We don't really care if this doesn't work as it is an optimisation
00301     return(TRUE);
00302 }


Member Data Documentation

GDrawContext * DIBConvert::ConvertContext = NULL [static, protected]
 

Definition at line 139 of file dibconv.h.


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