#include <bfxpixop.h>
Inheritance diagram for BfxPixelOp:
Public Member Functions | |
BfxPixelOp () | |
Default constructor for pixel op. | |
virtual | ~BfxPixelOp () |
Default destructor for pixel op. | |
virtual BOOL | Reset () |
Resets all parameters associated with the cache. | |
virtual BOOL | SetBitmap (KernelBitmap *pKB, DWORD theCacheStateMask, DWORD theCacheValueMask, BOOL theDefaultValue) |
Class set up to use bitmap passed in. | |
virtual BOOL | IsInRegion (INT32 x, INT32 y) |
virtual BOOL | ClearCachedArea () |
virtual BOOL | ClearEntireCache () |
virtual BOOL | SetAuxilliaryBitmaps (KernelBitmap *pProposed, KernelBitmap *pCurrent, KernelBitmap *pOriginal, INT32 Threshold, DWORD theColour) |
To be overriden by derived classes Sets up auxilliary bitmaps for derived classes. | |
virtual BOOL | CheckMinimumArea (INT32 MinimumArea, INT32 InitialX, INT32 InitialY, BOOL *FoundRegion) |
virtual DWORD | ReadPixel (void *Image, INT32 p) |
virtual void | TranslateToRGB (DWORD Colour, KernelBitmap *pKB, INT32 *R, INT32 *G, INT32 *B) |
DWORD | ReadOriginalPixel (INT32 x, INT32 y) |
virtual DWORD | ReadBPixel (INT32 x, INT32 y) |
DWORD | ReadPixel (void *Image, INT32 x, INT32 y) |
virtual void | WritePixel (void *Image, INT32 p, DWORD Value) |
virtual DWORD | TranslateToDWORD (KernelBitmap *pKB, INT32 R, INT32 G, INT32 B) |
void | WriteOriginalPixel (INT32 x, INT32 y, DWORD Value) |
void | WritePixel (void *Image, INT32 x, INT32 y, DWORD Value) |
Protected Member Functions | |
virtual BOOL | IsPixelReallyInRegion (INT32 x, INT32 y) |
To be overriden by derived classes. | |
Protected Attributes | |
DWORD * | Base |
INT32 | Height |
INT32 | Width |
INT32 | WidthRounded |
DWORD | Size |
BOOL | DefaultValue |
INT32 | BPP |
DWORD * | pA |
DWORD * | pB |
DWORD * | pT |
DWORD | Colour |
INT32 | Value |
Private Member Functions | |
CC_DECLARE_DYNCREATE (BfxPixelOp) |
Definition at line 135 of file bfxpixop.h.
|
Default constructor for pixel op.
Definition at line 149 of file bfxpixop.cpp. 00150 { 00151 Base=NULL; 00152 Height=0; 00153 Width=WidthRounded=0; 00154 Size=0; 00155 DefaultValue=FALSE; 00156 Reset(); 00157 pA=NULL; 00158 pB=NULL; 00159 pT=NULL; 00160 Value=0; 00161 BPP=32; 00162 }
|
|
Default destructor for pixel op.
Definition at line 179 of file bfxpixop.cpp.
|
|
|
|
Reimplemented in BfxPixelOp32, and BfxPixelOpPseudo. Definition at line 155 of file bfxpixop.h.
|
|
Reimplemented in BfxPixelOp32. Definition at line 150 of file bfxpixop.h. 00150 {return TRUE;};
|
|
Reimplemented in BfxPixelOp32. Definition at line 151 of file bfxpixop.h. 00151 {return TRUE;};
|
|
Reimplemented in BfxPixelOp32, and BfxPixelOpPseudo. Definition at line 148 of file bfxpixop.h. 00148 {return DefaultValue;}
|
|
To be overriden by derived classes.
Reimplemented in BfxPositivePixelOp, BfxThresholdPixelOp, BfxColourThresholdPixelOp, BfxPositivePixelOpPseudo, BfxThresholdPixelOpPseudo, and BfxColourThresholdPixelOpPseudo. Definition at line 280 of file bfxpixop.cpp. 00281 { 00282 ERROR3("How come base class BfxPixelOp::IsPixelReallyInRegion has got called?"); 00283 return DefaultValue; 00284 }
|
|
Reimplemented in BfxPixelOp24. Definition at line 165 of file bfxpixop.h. 00166 { return ReadPixel((void *)pB, x+y*WidthRounded); };
|
|
Definition at line 162 of file bfxpixop.h. 00163 { return ReadPixel((void *)pT, x+y*WidthRounded); };
|
|
Definition at line 168 of file bfxpixop.h. 00168 { return ReadPixel(Image, x+y*WidthRounded); };
|
|
Reimplemented in BfxPixelOp32, and BfxPixelOpPseudo. Definition at line 158 of file bfxpixop.h.
|
|
Resets all parameters associated with the cache.
Reimplemented in BfxPixelOp32, and BfxPixelOpPseudo. Definition at line 200 of file bfxpixop.cpp. 00201 { 00202 return TRUE; 00203 }
|
|
To be overriden by derived classes Sets up auxilliary bitmaps for derived classes.
Definition at line 328 of file bfxpixop.cpp. 00330 { 00331 if (pProposed) 00332 { 00333 ERROR2IF( (pProposed->ActualBitmap==NULL) ,FALSE,"BfxPixelOp can't find OIL bitmap"); 00334 ERROR3IF( (!(pProposed->ActualBitmap->IsKindOf(CC_RUNTIME_CLASS(CWxBitmap)) )),"BfxPixelOp Oil layer inconsistency"); 00335 00336 BITMAPINFOHEADER * pBMI=&(((CWxBitmap *)(pProposed->ActualBitmap))->BMInfo->bmiHeader); 00337 00338 ERROR2IF( ((pBMI->biHeight != Height) || (pBMI->biWidth != Width) || (BPP && pBMI->biBitCount !=BPP)), FALSE, 00339 "Incompatible bitmaps for BfxPixelOp::SetAuxilliaryBitmap"); 00340 pA = (DWORD *)(void *)(((CWxBitmap *)(pProposed->ActualBitmap))->BMBytes); 00341 } 00342 else 00343 { 00344 pA = NULL; 00345 } 00346 00347 if (pOriginal) 00348 { 00349 ERROR2IF( (pOriginal->ActualBitmap==NULL) ,FALSE,"BfxPixelOp can't find OIL bitmap"); 00350 ERROR3IF( (!(pOriginal->ActualBitmap->IsKindOf(CC_RUNTIME_CLASS(CWxBitmap)) )),"BfxPixelOp Oil layer inconsistency"); 00351 00352 BITMAPINFOHEADER * pBMI=&(((CWxBitmap *)(pOriginal->ActualBitmap))->BMInfo->bmiHeader); 00353 00354 ERROR2IF( ((pBMI->biHeight != Height) || (pBMI->biWidth != Width) || (BPP && pBMI->biBitCount !=BPP)), FALSE, 00355 "Incompatible bitmaps for BfxPixelOp::SetAuxilliaryBitmap"); 00356 pT = (DWORD *)(void *)(((CWxBitmap *)(pOriginal->ActualBitmap))->BMBytes); 00357 } 00358 else 00359 { 00360 pT = NULL; 00361 } 00362 00363 if (pCurrent) 00364 { 00365 ERROR2IF( (pCurrent->ActualBitmap==NULL) ,FALSE,"BfxPixelOp can't find OIL bitmap"); 00366 ERROR3IF( (!(pCurrent->ActualBitmap->IsKindOf(CC_RUNTIME_CLASS(CWxBitmap)) )),"BfxPixelOp Oil layer inconsistency"); 00367 00368 BITMAPINFOHEADER * pBMI=&(((CWxBitmap *)(pCurrent->ActualBitmap))->BMInfo->bmiHeader); 00369 00370 ERROR2IF( ((pBMI->biHeight != Height) || (pBMI->biWidth != Width) || (BPP && pBMI->biBitCount !=BPP)), FALSE, 00371 "Incompatible bitmaps for BfxPixelOp::SetAuxilliaryBitmap"); 00372 pB = (DWORD *)(void *)(((CWxBitmap *)(pCurrent->ActualBitmap))->BMBytes); 00373 } 00374 else 00375 { 00376 pB = NULL; 00377 } 00378 00379 00380 Value = Threshold; 00381 Colour = theColour; 00382 return TRUE; 00383 }
|
|
Class set up to use bitmap passed in.
Reimplemented in BfxPixelOp32, and BfxPixelOpPseudo. Definition at line 229 of file bfxpixop.cpp. 00231 { 00232 Base = NULL; 00233 ERROR2IF( ((!pKB) || (pKB->ActualBitmap==NULL)) ,FALSE,"BfxALU can't find OIL bitmap"); 00234 ERROR3IF( (!(pKB->ActualBitmap->IsKindOf(CC_RUNTIME_CLASS(CWxBitmap)) )),"BfxALU Oil layer inconsistency"); 00235 00236 BITMAPINFOHEADER * pBMI=&(((CWxBitmap *)(pKB->ActualBitmap))->BMInfo->bmiHeader); 00237 00238 ERROR2IF( (BPP && pBMI->biBitCount != BPP), FALSE, "BfxPixelOp called with incorrect BPP"); 00239 00240 Base = (DWORD *)(void *)(((CWxBitmap *)(pKB->ActualBitmap))->BMBytes); 00241 Width = pBMI->biWidth; 00242 INT32 Bits = pBMI->biBitCount; 00243 switch (Bits) 00244 { 00245 case 1 : WidthRounded = (Width+31) &~31; break; 00246 case 2 : WidthRounded = (Width+15) &~15; break; 00247 case 4 : WidthRounded = (Width+7) &~7; break; 00248 case 8 : WidthRounded = (Width+3) &~3; break; 00249 case 16: WidthRounded = (Width+1) &~1; break; 00250 case 32: 00251 default: 00252 WidthRounded = Width; break; 00253 } 00254 00255 Height = pBMI->biHeight; 00256 Size = (pBMI->biSizeImage)>>2; 00257 00258 return TRUE; 00259 }
|
|
Definition at line 171 of file bfxpixop.h.
|
|
Reimplemented in BfxPixelOpPseudo. Definition at line 159 of file bfxpixop.h. 00160 { *R = (INT32)(Colour >>16) & 0x0FF; *G = (INT32)(Colour>>8) & 0x0FF; *B = (INT32)(Colour/*>>0*/) & 0x0FF;return;};
|
|
Definition at line 174 of file bfxpixop.h. 00175 { WritePixel((void *)pT, x+y*WidthRounded, Value); return; };
|
|
Definition at line 177 of file bfxpixop.h. 00177 { WritePixel(Image, x+y*WidthRounded, Value); return;};
|
|
Reimplemented in BfxPixelOp32, and BfxPixelOpPseudo. Definition at line 170 of file bfxpixop.h.
|
|
Definition at line 183 of file bfxpixop.h. |
|
Definition at line 190 of file bfxpixop.h. |
|
Definition at line 195 of file bfxpixop.h. |
|
Definition at line 188 of file bfxpixop.h. |
|
Definition at line 184 of file bfxpixop.h. |
|
Definition at line 192 of file bfxpixop.h. |
|
Definition at line 193 of file bfxpixop.h. |
|
Definition at line 194 of file bfxpixop.h. |
|
Definition at line 187 of file bfxpixop.h. |
|
Definition at line 196 of file bfxpixop.h. |
|
Definition at line 185 of file bfxpixop.h. |
|
Definition at line 186 of file bfxpixop.h. |