#include <capturemanager.h>
Inheritance diagram for Capture:
Public Member Functions | |
CC_DECLARE_DYNAMIC (Capture) | |
Capture () | |
Default Constructor for Capture Class. | |
Capture (CCObject *pOwner, CAPTUREINFO cinfo, Matrix cMatrix, DocRect cRect, double PixelsPerInch, ColourContext *pcColourContext) | |
New Capture Constructor for Capture Class. | |
Capture (Capture *pSourceCapture, BOOL bCopyBitmap=FALSE) | |
Copy Constructor for Capture Class. | |
~Capture () | |
Default Destructor for CaptureManager Class. | |
BOOL | IsTransparent () const |
BOOL | IsMaster () const |
BOOL | IsDirect () const |
BOOL | HasFullCoverage () const |
BOOL | IsUnclipped () const |
CCObject * | GetOwner () const |
BOOL | OwnsBitmap () const |
BOOL | SetDIB (LPBITMAPINFO lpnewInfo, LPBYTE lpnewBits) |
BOOL | SetClipRect (DocRect NewClipRect) |
void | SetTransparent (BOOL bNewState) |
Change the transparency of a captured bitmap. | |
BOOL | FreeDIB () |
Default Destructor for CaptureManager Class Default Destructor for CaptureManager Class. | |
void | SetDirectSupplier (NodeRenderableInk *pSupplier) |
NodeRenderableInk * | GetDirectSupplier () const |
BOOL | ConsumeDirectBitmap (NodeRenderableInk *pSupplier) |
Consume the supplied bitmap if the supplier is right. | |
void | SetClipRegionAttrValue (ClipRegionAttribute *pClipRegion) |
const REGION * | GetCachedClipRegion (ClipRegionAttribute *pClipAttr) |
void | SetCachedClipRegion (ClipRegionAttribute *pClipAttr, const REGION *pClipRegion) |
void | RemoveCachedClipRegion (ClipRegionAttribute *pClipAttr) |
void | RemoveAllCachedClipRegions () |
Public Attributes | |
DocRect | CaptureRect |
LPBITMAPINFO | lpBitmapInfo |
LPBYTE | lpBits |
Matrix | CaptureMatrix |
ColourContext * | pColContext |
CAPTUREINFO | info |
double | dPixelsPerInch |
Private Attributes | |
CCObject * | m_pOwner |
NodeRenderableInk * | m_pDirectBitmapSupplier |
ClipRegionMap | m_ClipRegionMap |
ClipRegionAttribute * | m_pClipRegionAttrValue |
A Capture may own a bitmap but doesn't always do so.
Note! This class replaces OffscreenState and CaptureManager. This is how it should have been implemented in the first place...!
Definition at line 256 of file capturemanager.h.
|
Default Constructor for Capture Class.
Definition at line 134 of file capturemanager.cpp. 00135 { 00136 m_pOwner = NULL; 00137 m_pDirectBitmapSupplier = NULL; 00138 m_pClipRegionAttrValue = NULL; 00139 00140 CaptureRect = DocRect(0,0,0,0); 00141 lpBitmapInfo = NULL; 00142 lpBits = NULL; 00143 CaptureMatrix = Matrix(); 00144 pColContext = NULL; 00145 info = CAPTUREINFO(ctDISABLED, cfNONE); 00146 dPixelsPerInch = 96; 00147 00148 // m_ClipRegionMap.InitHashTable(17, FALSE); 00149 }
|
|
New Capture Constructor for Capture Class.
Definition at line 174 of file capturemanager.cpp. 00181 { 00182 m_pOwner = pOwner; 00183 m_pDirectBitmapSupplier = NULL; 00184 m_pClipRegionAttrValue = NULL; 00185 00186 CaptureRect = cRect; 00187 lpBitmapInfo = NULL; 00188 lpBits = NULL; 00189 PORTNOTE("other","Removed GRenderRegion::MakeGavinMatrix usage") 00190 #ifndef EXCLUDE_FROM_XARALX 00191 CaptureGMatrix = GRenderRegion::MakeGavinMatrix(cMatrix, cRect, PixelsPerInch); 00192 #endif 00193 CaptureMatrix = cMatrix; 00194 pColContext = pcColourContext; 00195 info = cinfo; 00196 dPixelsPerInch = PixelsPerInch; 00197 }
|
|
Copy Constructor for Capture Class.
Definition at line 218 of file capturemanager.cpp. 00220 { 00221 m_pOwner = pSourceCapture->m_pOwner; 00222 m_pDirectBitmapSupplier = pSourceCapture->m_pDirectBitmapSupplier; 00223 m_pClipRegionAttrValue = pSourceCapture->m_pClipRegionAttrValue; 00224 00225 CaptureRect = pSourceCapture->CaptureRect; 00226 lpBitmapInfo = pSourceCapture->lpBitmapInfo; 00227 lpBits = pSourceCapture->lpBits; 00228 CaptureMatrix = pSourceCapture->CaptureMatrix; 00229 pColContext = pSourceCapture->pColContext; 00230 info = pSourceCapture->info; // Note that copying a master will create a master! 00231 dPixelsPerInch = pSourceCapture->dPixelsPerInch; 00232 00233 if (bCopyBitmap && pSourceCapture->lpBitmapInfo && pSourceCapture->lpBits) 00234 { 00235 DIBUtil::CopyBitmap(pSourceCapture->lpBitmapInfo, pSourceCapture->lpBits, 00236 &lpBitmapInfo, &lpBits); 00237 } 00238 00239 // CopyBitmap doesn't copy compression flag correctly... 00240 lpBitmapInfo->bmiHeader.biCompression = pSourceCapture->lpBitmapInfo->bmiHeader.biCompression; 00241 }
|
|
Default Destructor for CaptureManager Class.
Definition at line 338 of file capturemanager.cpp. 00339 { 00340 RemoveAllCachedClipRegions(); 00341 00342 if (m_pClipRegionAttrValue) 00343 { 00344 delete m_pClipRegionAttrValue; 00345 m_pClipRegionAttrValue = NULL; 00346 } 00347 }
|
|
|
|
Consume the supplied bitmap if the supplier is right.
Definition at line 428 of file capturemanager.cpp. 00429 { 00430 if (m_pDirectBitmapSupplier!=pSupplier || info.caFlags.Direct==FALSE) 00431 return FALSE; 00432 00433 // TODO: Could grab some info about the direct bitmap here? 00434 00435 return TRUE; 00436 }
|
|
Default Destructor for CaptureManager Class Default Destructor for CaptureManager Class.
Definition at line 311 of file capturemanager.cpp. 00312 { 00313 ::FreeDIB(lpBitmapInfo, lpBits, NULL, FALSE); 00314 lpBitmapInfo = NULL; // Owns bitmap will now return FALSE 00315 lpBits = NULL; 00316 00317 return FALSE; 00318 }
|
|
Definition at line 456 of file capturemanager.cpp. 00457 { 00458 ClipRegionMap::const_iterator iter = m_ClipRegionMap.find( pClipAttr ); 00459 if( m_ClipRegionMap.end() == iter ) 00460 return NULL; 00461 00462 return (REGION *)iter->second; 00463 }
|
|
Definition at line 288 of file capturemanager.h. 00288 {return m_pDirectBitmapSupplier;}
|
|
Definition at line 280 of file capturemanager.h. 00280 {return m_pOwner;}
|
|
Definition at line 278 of file capturemanager.h. 00278 {return info.caFlags.FullCoverage; }
|
|
Definition at line 277 of file capturemanager.h.
|
|
Definition at line 276 of file capturemanager.h.
|
|
Definition at line 275 of file capturemanager.h. 00275 {return (lpBitmapInfo && lpBitmapInfo->bmiHeader.biCompression==0x80000001);}
|
|
Definition at line 279 of file capturemanager.h.
|
|
Definition at line 281 of file capturemanager.h. 00281 {return lpBitmapInfo!=NULL && lpBits!=NULL;}
|
|
Definition at line 536 of file capturemanager.cpp. 00537 { 00538 ClipRegionMap::const_iterator iter = m_ClipRegionMap.begin(); 00539 for( ; iter != m_ClipRegionMap.end(); ++iter ) 00540 { 00541 if( iter->second != NULL ) 00542 delete []( (BYTE *)iter->second ); 00543 } 00544 m_ClipRegionMap.clear(); 00545 }
|
|
Definition at line 506 of file capturemanager.cpp. 00507 { 00508 ClipRegionMap::iterator iter = m_ClipRegionMap.find( pClipAttr ); 00509 if( m_ClipRegionMap.end() != iter ) 00510 { 00511 if (iter->second != NULL) 00512 delete []( (BYTE *)iter->second ); 00513 00514 m_ClipRegionMap.erase( iter ); 00515 } 00516 }
|
|
Definition at line 483 of file capturemanager.cpp. 00484 { 00485 m_ClipRegionMap[pClipAttr] = (void *)pClipRegion; 00486 }
|
|
Definition at line 284 of file capturemanager.h. 00284 {CaptureRect = NewClipRect; return TRUE;}
|
|
Definition at line 290 of file capturemanager.h. 00290 {m_pClipRegionAttrValue = pClipRegion;}
|
|
Definition at line 283 of file capturemanager.h. 00283 {lpBitmapInfo = lpnewInfo; lpBits = lpnewBits; return TRUE;}
|
|
Definition at line 287 of file capturemanager.h. 00287 {m_pDirectBitmapSupplier = pSupplier;}
|
|
Change the transparency of a captured bitmap.
Definition at line 368 of file capturemanager.cpp. 00369 { 00370 if (lpBitmapInfo && lpBits && lpBitmapInfo->bmiHeader.biBitCount==32) 00371 { 00372 lpBitmapInfo->bmiHeader.biCompression = bNewState ? 0x80000001 : BI_RGB; 00373 UINT32 BmpSize = GetDIBBitsSize(&lpBitmapInfo->bmiHeader); 00374 UINT32 Index = 0; 00375 LPBYTE pSetBits = lpBits; 00376 00377 if (bNewState) 00378 { 00379 // ReInit bitmap to be fully transparent 00380 while(Index < BmpSize) 00381 { 00382 // initial values for using internal alpha channelled format 00383 // fully transparent black bacground 00384 00385 pSetBits[Index++] = 0x00; 00386 pSetBits[Index++] = 0x00; 00387 pSetBits[Index++] = 0x00; 00388 pSetBits[Index++] = 0xFF; 00389 } 00390 } 00391 else 00392 { 00393 // ReInit bitmap to be fully opaque 00394 while(Index < BmpSize) 00395 { 00396 // fully opaque white background 00397 pSetBits[Index++] = 0xFF; 00398 pSetBits[Index++] = 0xFF; 00399 pSetBits[Index++] = 0xFF; 00400 pSetBits[Index++] = 0x00; 00401 } 00402 } 00403 } 00404 else 00405 { 00406 ERROR3("SetTransparency called on empty/non-32BPP bitmap"); 00407 } 00408 }
|
|
Definition at line 304 of file capturemanager.h. |
|
Definition at line 301 of file capturemanager.h. |
|
Definition at line 307 of file capturemanager.h. |
|
Definition at line 306 of file capturemanager.h. |
|
Definition at line 302 of file capturemanager.h. |
|
Definition at line 303 of file capturemanager.h. |
|
Definition at line 313 of file capturemanager.h. |
|
Definition at line 314 of file capturemanager.h. |
|
Definition at line 312 of file capturemanager.h. |
|
Definition at line 311 of file capturemanager.h. |
|
Definition at line 305 of file capturemanager.h. |