#include <bitmap.h>
Inheritance diagram for OILBitmap:
Public Member Functions | |
virtual INT32 | operator== (const OILBitmap &)=0 |
virtual BOOL | GetInfo (BitmapInfo *Info, RenderRegion *pRegion=NULL)=0 |
virtual UINT32 | GetWidth ()=0 |
virtual UINT32 | GetHeight ()=0 |
virtual UINT32 | GetBPP (RenderRegion *pRegion=NULL)=0 |
virtual UINT32 | GetNumPaletteEntries ()=0 |
virtual ADDR | GetBitmapBits ()=0 |
virtual UINT32 | GetScanlineSize ()=0 |
UINT32 | GetBitmapSize () |
Finds the size in bytes, of this bitmap. | |
void | SetName (String_256 &NewName) |
String_256 & | GetName () |
void | SetBitmapAnimDelay (UINT32 Delay) |
UINT32 | GetBitmapAnimDelay () |
void | SetInterpolation (BOOL Value) |
BOOL | GetInterpolation () |
void | SetHidden (BOOL Value) |
BOOL | IsHidden () const |
BOOL | IsHiddenInGallery () |
Hide some bitmaps from the user to avoid confusing the user. | |
void | SetAnimationRestoreType (GIFDisposalMethod Type) |
GIFDisposalMethod | GetAnimationRestoreType () |
void | SetLeftOffset (UINT32 LeftOffset) |
UINT32 | GetLeftOffset () |
void | SetTopOffset (UINT32 TopOffset) |
UINT32 | GetTopOffset () |
BOOL | InvalidateAllReferences (Document *) |
Called when the interpolation setting is changed. Determines whether this bitmap is being used in the specified document. All references to the bitmap (e.g. shapes with bitmap fill) are invalidated so that they will be redrawn with the new interpolation setting. | |
BOOL | IsUsedInDocument (Document *pDoc, BOOL bIncludeHidden=FALSE) |
Finds if this bitmap is being used in a specified document or not. | |
BOOL | IsUsedByChildren (Node *pNode, BOOL bIncludeHidden=FALSE) |
Determines if this bitmap is used by the children of the specified node (or their children etc). | |
BOOL | IsUsedByNode (Node *pNode) |
Determines if this bitmap is used by the specified node. | |
virtual BOOL | ExportBitmap (RenderRegion *pRegion)=0 |
virtual BOOL | ExportBitmapPalette (RenderRegion *pRegion)=0 |
virtual BOOL | ExportBitmapData (RenderRegion *pRegion)=0 |
virtual INT32 | GetRecommendedWidth ()=0 |
virtual INT32 | GetRecommendedHeight ()=0 |
virtual void | SetRecommendedWidth (INT32)=0 |
virtual void | SetRecommendedHeight (INT32)=0 |
virtual BOOL | SetTransparencyIndex (INT32)=0 |
virtual BOOL | GetTransparencyIndex (INT32 *)=0 |
virtual BOOL | IsTransparent ()=0 |
virtual BOOL | ExportSeparatedData (RenderRegion *pRegion, BYTE *SepTables)=0 |
virtual BOOL | ExportSeparatedPalette (RenderRegion *pRegion)=0 |
virtual BOOL | GetScanline32bpp (UINT32 YPos, BOOL UsePalette, Pixel32bpp *Scanline)=0 |
virtual BOOL | WritePalette (BaseCamelotFilter *pFilter)=0 |
virtual BOOL | Convert24To8 (RGBTRIPLE *pPalette, UINT32 NumberOfPaletteEntries)=0 |
virtual BOOL | ImportBitmap (CCLexFile *pFile, BaseBitmapFilter *pBitmapFilter, BaseCamelotFilter *pFilter, BOOL IsCompressed)=0 |
virtual BOOL | ImportBitmap (Filter *, const BitmapInfo *, INT32)=0 |
virtual BOOL | LoadBitmap (UINT32 BitmapResourceID)=0 |
virtual BOOL | GetPaletteUsage (INT32 *)=0 |
virtual BOOL | PrepareMask (INT32 PaletteEntry)=0 |
virtual BOOL | GetScanlineMaskBits (INT32 ScanlineY, LPBYTE ScanlineBuf)=0 |
virtual BOOL | DestroyMask ()=0 |
virtual BOOL | BuildContonePalette (DocColour &Start, DocColour &End, EFFECTTYPE Effect, View *ScopeView) |
Builds a contone (graduated) palette between the start and end colours given, using the given effect (mix, rainbow, alt-rainbow), for output through the given view. See GradTable32::BuildGraduatedPalette for details of how the palette is built. | |
virtual BOOL | ExportContonePalette (RenderRegion *)=0 |
virtual DocColour | GetContonePaletteEntry (UINT32 PaletteIndex) |
Read an entry from the Contone Palette. | |
virtual BOOL | DestroyContonePalette () |
Destroys the contone palette. | |
virtual void | PlotPixel (INT32 x, INT32 y, Pixel32bpp NewValue)=0 |
virtual void | PlotPixel (INT32 x, INT32 y, PixelGreyscale NewValue)=0 |
virtual Pixel32bpp | ReadPixel32bpp (INT32 x, INT32 y, BOOL UsePalette=TRUE)=0 |
virtual INT32 | ReturnPaletteIndexUsed (INT32 x, INT32 y)=0 |
virtual PixelGreyscale | ReadPixelGreyscale (INT32 x, INT32 y)=0 |
virtual void | DeleteData (BOOL bResetToDefault=TRUE)=0 |
virtual BOOL | HasBeenDeleted ()=0 |
virtual void | SetOriginalSource (BitmapSource *pSource=NULL, BaseBitmapFilter *pImportFilter=NULL) |
Sets the original bitmap file associated with this reference. | |
virtual BOOL | GetOriginalSource (BitmapSource **ppSource=NULL, BaseBitmapFilter **ppImportFilter=NULL) |
Gets the original bitmap file buffer associated with this reference. | |
virtual BOOL | SetGreyscaleVersion (OILBitmap *) |
Creates a greyscale version of this bitmap. | |
virtual BOOL | DestroyGreyscaleVersion () |
Destroys the greyscale version of this bitmap. | |
virtual OILBitmap * | GetGreyscaleVersion () |
virtual void | GenerateGreyscaleTable ()=0 |
BYTE * | GetGreyscaleTable () |
BOOL | IsGreyscale () |
BOOL | IsDefaultBitmap () |
BOOL | IsTemp () |
BOOL | IsInGlobalList () |
BOOL | IsLossy () |
void | SetAsFractal () |
void | SetAsGreyscale () |
void | SetAsLossy (BOOL bLossy=TRUE) |
BOOL | IsAFractal () |
virtual BOOL | IsBrowserPalette ()=0 |
virtual BOOL | ArePalettesTheSame (const LPLOGPALETTE pLogPalette, const INT32 TransColour=-1)=0 |
virtual UINT32 | GetHorizontalDPI ()=0 |
virtual UINT32 | GetVerticalDPI ()=0 |
virtual LPBITMAPINFO | GetBitmapInfo ()=0 |
virtual LPRGBQUAD | GetPaletteForBitmap ()=0 |
virtual LPBITMAPINFOHEADER | GetBitmapInfoHeader ()=0 |
virtual void | ReplaceBitmap (LPBYTE pBytes, LPBITMAPINFO pInfo)=0 |
virtual OILBitmap * | MakeCopy ()=0 |
void | SetUsedByBrush (BOOL Used) |
BOOL | IsUsedByBrush () |
virtual void | SetXPEInfo (OILBitmap *pMasterBitmap, IXMLDOMDocumentPtr pNewEditList) |
Sets the XPE edit list document for this bitmap. | |
virtual void | GetXPEInfo (OILBitmap *&refMasterBitmap, IXMLDOMDocumentPtr &refEditList, BOOL bEnsureList=FALSE) |
Gets the stored XPE information for this bitmap. | |
virtual BOOL | IsXPEMaster () |
Gets the XPE master status of this bitmap by searching the bitmap list. | |
virtual BOOL | DestroyXPEInfo () |
Aks the user whether he wants to destroy XPE info. | |
virtual BOOL | RemoveXPEBitmap () |
Aks the user whether he wants to destroy XPE info. | |
virtual BOOL | RebuildXPEBitmap () |
Remove the OIL bitmap from memory if it can be constructed from master and edits. | |
virtual BOOL | NeedsXPERebuild () |
Ask the user whether he wants to destroy XPE info. | |
virtual void | CopyFullyTransparentFrom (OILBitmap *pBitmap)=0 |
Static Public Member Functions | |
static OILBitmap * | Create () |
Creates a lovely fresh OILBitmap. Some data needs putting into it before it will work. Scope: Static. | |
static OILBitmap * | Attach (OILBitmap *=Default, BOOL Temp=FALSE) |
Increases the usage count on the OILBitmap. Designed to be called from KernelBitmap code. | |
static BOOL | Init () |
Reads the default fill pattern, either from a file or internally from a resource. Scope: Static. | |
static void | Deinit () |
Cleans up the OIL bitmap class, designed to be called once on exit. Scope: Static. | |
Static Public Attributes | |
static OILBitmap * | Default |
static INT32 | s_lMaxGreyscaleSize |
Protected Member Functions | |
OILBitmap () | |
Constructor. Sets USage count to zero. | |
virtual | ~OILBitmap () |
Destructor. | |
BOOL | RemoveFromGlobalList () |
Static Protected Member Functions | |
static OILBitmap * | Create (UINT32 Width, UINT32 Height, UINT32 Depth, UINT32 dpi) |
Creates a lovely fresh OILBitmap. Some data needs putting into it before it will work. | |
Protected Attributes | |
String_256 | m_BitmapName |
UINT32 | m_BitmapAnimDelay |
BOOL | m_bInterpolation |
GIFDisposalMethod | m_AnimationRestoreType |
UINT32 | m_LeftOffset |
UINT32 | m_TopOffset |
OriginalBitmapRef | m_OriginalBitmap |
OILBitmap * | m_pColourVersion |
OILBitmap * | m_pGreyscaleVersion |
RGBQUAD * | m_pContonePalette |
BYTE * | m_pGreyscaleTable |
OILBitmap * | m_pMasterBitmap |
IXMLDOMDocumentPtr | m_pEditList |
BOOL | m_bTemp: 1 |
BOOL | m_bIsAFractal: 1 |
BOOL | m_bIsGreyscale: 1 |
BOOL | m_bUsedByBrush: 1 |
BOOL | m_bNeedsXPERebuild: 1 |
BOOL | m_bHidden: 1 |
BOOL | m_bIsLossy: 1 |
Friends | |
class | KernelBitmap |
class | GlobalBitmapList |
class | OpDeleteBitmap |
class | CachedFractal |
class | NodeCacheCompound |
class | FeatherAttrValue |
class | MaskedFilter |
class | FlashRenderRegion |
class | CBitmapCache |
Definition at line 213 of file bitmap.h.
|
Constructor. Sets USage count to zero.
Definition at line 2267 of file bitmap.cpp. 02268 { 02269 m_bTemp = TRUE; // Not in global list yet 02270 02271 m_pColourVersion = NULL; 02272 m_pGreyscaleVersion = NULL; 02273 m_pContonePalette = NULL; 02274 m_pGreyscaleTable = NULL; 02275 02276 m_bIsAFractal = FALSE; 02277 m_bIsGreyscale = FALSE; 02278 m_bIsLossy = FALSE; 02279 02280 SetBitmapAnimDelay(10); 02281 SetAnimationRestoreType(GDM_LEAVE); 02282 SetInterpolation(TRUE); 02283 02284 m_LeftOffset = 0; 02285 m_TopOffset = 0; 02286 02287 PORTNOTE("other","Removed edit list") 02288 #ifndef EXCLUDE_FROM_XARALX 02289 m_pEditList = NULL; 02290 #endif 02291 m_pMasterBitmap = NULL; 02292 02293 m_bUsedByBrush = FALSE; 02294 #if !defined(EXCLUDE_FROM_RALPH) 02295 m_BitmapName.Load(_R(IDS_BITMAPNAME)); 02296 #else 02297 m_BitmapName = TEXT("Bitmap"); 02298 #endif 02299 m_bNeedsXPERebuild = FALSE; 02300 m_bHidden = FALSE; 02301 02302 #ifdef _DEBUG 02303 m_bIsAttached = FALSE; 02304 #endif 02305 }
|
|
Destructor.
Definition at line 2317 of file bitmap.cpp. 02318 { 02319 PORTNOTE("other","Removed edit list") 02320 #ifndef EXCLUDE_FROM_XARALX 02321 if (m_pEditList) 02322 { 02323 m_pEditList = NULL; // This is a smart pointer so just allow it to die naturally 02324 } 02325 #endif 02326 02327 if (m_pColourVersion) 02328 { 02329 ERROR3IF(m_pColourVersion->m_pGreyscaleVersion != this, "Bad greyscale version"); 02330 02331 // This must be a greyscale version of a colour bmp 02332 m_pColourVersion->m_pGreyscaleVersion = NULL; 02333 } 02334 02335 // Ensure this bitmap is not in the global bitmap list 02336 RemoveFromGlobalList(); 02337 02338 if (m_pContonePalette) 02339 DestroyContonePalette(); 02340 02341 if (m_pGreyscaleVersion) 02342 DestroyGreyscaleVersion(); 02343 02344 // To do :- We could do a debug check here, to ensure that there are no references 02345 // to this bitmap anywhere 02346 }
|
|
Implemented in CWxBitmap. |
|
Increases the usage count on the OILBitmap. Designed to be called from KernelBitmap code.
Definition at line 2365 of file bitmap.cpp. 02366 { 02367 if (pTheOILBitmap == NULL) 02368 return NULL; 02369 02370 #ifdef _DEBUG 02371 02372 ERROR3IF_OILBMP_PTR_INVALID(pTheOILBitmap, 02373 "Bitmap Error. Trying to attach a deleted bitmap."); 02374 02375 // Check for illegal things ... 02376 // Trap an attempt to attach a temp bitmap to more than one KernelBitmap 02377 if (pTheOILBitmap->m_bTemp && !pTheOILBitmap->m_bIsAFractal) 02378 { 02379 //ERROR3IF(pTheOILBitmap->m_bIsAttached, "Trying to attach a temp bitmap that is already attached"); 02380 // Stefans change so that if IsNew is NULL in TryAndUseExistingKernelBitmap it will set the temp 02381 // flag means that this check goes off on animated bitmaps. Downgraded to trace all. 02382 if (pTheOILBitmap->m_bIsAttached) 02383 TRACEALL( _T("Trying to attach a temp bitmap that is already attached\n") ); 02384 } 02385 02386 pTheOILBitmap->m_bIsAttached = TRUE; 02387 02388 #endif 02389 02390 if (!Temp && !pTheOILBitmap->IsInGlobalList()) 02391 { 02392 ERROR3IF(pTheOILBitmap->IsAFractal(), "Someone's trying to attach a fractal to the global list !"); 02393 02394 if (!pTheOILBitmap->IsAFractal()) 02395 { 02396 // It's not in the Global list yet, so add it now ... 02397 02398 // First ensure the bitmap name is unique 02399 GetApplication()->GetGlobalBitmapList()->MakeNameUnique(&(pTheOILBitmap->m_BitmapName)); 02400 02401 // and the add it to the global bitmap list 02402 GetApplication()->GetGlobalBitmapList()->AddItem(pTheOILBitmap); 02403 02404 // and flag that it's in the list 02405 pTheOILBitmap->m_bTemp = FALSE; 02406 02407 // And set the flag if it's a greyscale bitmap 02408 // we can't tell if it is or not in WEBSTER-Martin-14/01/97 02409 // Code now in DIBUtil 10/11/97 Neville 02410 //#ifdef WEBSTER 02411 // pTheOILBitmap->m_bIsGreyscale = FALSE; 02412 //#else 02413 pTheOILBitmap->m_bIsGreyscale = DIBUtil::IsGreyscaleBitmap(pTheOILBitmap); 02414 //#endif //WEBSTER 02415 } 02416 } 02417 02418 return pTheOILBitmap; 02419 }
|
|
Builds a contone (graduated) palette between the start and end colours given, using the given effect (mix, rainbow, alt-rainbow), for output through the given view. See GradTable32::BuildGraduatedPalette for details of how the palette is built.
ScopeView - The view to which this palette will be rendered. Used to determine current colour correction/separation settings for composite preview and separated views. Can be null, but it won't do any of your fancy colour seperationness for you. Definition at line 2475 of file bitmap.cpp. 02477 { 02478 UINT32 bpp = GetBPP(); 02479 02480 if (bpp > 8) 02481 // Can't do contone palette for this image 02482 return FALSE; 02483 02484 RGBQUAD* pPalette = (RGBQUAD*)CCMalloc(256 * sizeof(RGBQUAD)); 02485 if (pPalette == NULL) 02486 return FALSE; 02487 02488 // Allocate the palette array (we always allocate enough for biggest (8bpp) palette) 02489 // m_pContonePalette = (RGBQUAD *) CCMalloc(256 * sizeof(RGBQUAD)); 02490 // if (m_pContonePalette == NULL) 02491 // // Out of memory. 02492 // return FALSE; 02493 02494 // Fill in the palette (we always use RGB space for now) 02495 INT32 NumCols = 256; 02496 switch (bpp) 02497 { 02498 case 1: 02499 NumCols = 2; 02500 break; 02501 02502 case 2: 02503 NumCols = 4; 02504 break; 02505 02506 // case 4: 02507 // // 4bpp images are expanded to 8bpp otherwise they don't work on 02508 // // some PostScript printers. 02509 // case 8: 02510 // default: 02511 // NumCols = 256; 02512 // break; 02513 } 02514 02515 GradTable32::BuildGraduatedPalette(StartCol, EndCol, ScopeView, Effect, NumCols, pPalette); 02516 02517 BYTE* pGreyTable = GetGreyscaleTable(); 02518 if (pGreyTable) 02519 { 02520 m_pContonePalette = (RGBQUAD *) CCMalloc(256 * sizeof(RGBQUAD)); 02521 if (m_pContonePalette == NULL) 02522 return(FALSE); 02523 02524 // Copy the entries from the contone palette into the new one, 02525 // using the Grey table as a guide 02526 for (INT32 i=0; i<256; i++) 02527 { 02528 m_pContonePalette[i] = pPalette[pGreyTable[i]]; 02529 } 02530 02531 CCFree(pPalette); 02532 } 02533 else 02534 { 02535 m_pContonePalette = pPalette; 02536 } 02537 02538 return(TRUE); 02539 }
|
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Creates a lovely fresh OILBitmap. Some data needs putting into it before it will work. Scope: Static.
Definition at line 291 of file oilbitmap.cpp. 00292 { 00293 // Create a new CWxBitmap object. 00294 return new CWxBitmap; 00295 }
|
|
Creates a lovely fresh OILBitmap. Some data needs putting into it before it will work.
Definition at line 313 of file oilbitmap.cpp. 00314 { 00315 LPBITMAPINFO bmInfo; 00316 LPBYTE bmBytes; 00317 00318 bmInfo = AllocDIB( Width, Height, Depth, &bmBytes ); 00319 if (bmInfo) 00320 { 00321 //bmInfo->bmiHeader.biXPelsPerMeter = Mul32Div32( dpi, 100*100, 254 ); 00322 double xppm = ((double)dpi * 10000.0)/254.0; 00323 bmInfo->bmiHeader.biXPelsPerMeter = (INT32)(xppm + 0.5); 00324 bmInfo->bmiHeader.biYPelsPerMeter = bmInfo->bmiHeader.biXPelsPerMeter; 00325 CWxBitmap *WinBM = new CWxBitmap( bmInfo, bmBytes ); 00326 if (WinBM) 00327 return WinBM; 00328 else 00329 FreeDIB( bmInfo, bmBytes ); 00330 } 00331 return NULL; 00332 }
|
|
Cleans up the OIL bitmap class, designed to be called once on exit. Scope: Static.
Definition at line 270 of file oilbitmap.cpp. 00271 { 00272 delete OILBitmap::Default; 00273 OILBitmap::Default = NULL; 00274 00275 // perhaps should go through list at some point making sure everything is tidy? 00276 }
|
|
Implemented in CWxBitmap. |
|
Destroys the contone palette.
Definition at line 2576 of file bitmap.cpp. 02577 { 02578 // (ChrisG 4/1/01) - Only delete the contone palette if we actually have one. 02579 if (m_pContonePalette != NULL) 02580 { 02581 // Free and NULL our palette array pointer. 02582 CCFree(m_pContonePalette); 02583 m_pContonePalette = NULL; 02584 } 02585 return TRUE; 02586 }
|
|
Destroys the greyscale version of this bitmap.
Definition at line 2627 of file bitmap.cpp. 02628 { 02629 if (m_pGreyscaleVersion == NULL) 02630 return TRUE; 02631 02632 ERROR3IF(m_pGreyscaleVersion->m_pColourVersion == NULL, "Greyscale bitmap has no colour pointer"); 02633 // GreyscaleBitmapList* pGreyList = 02634 // GetApplication()->GetGlobalBitmapList()->GetGreyscaleBitmapList(); 02635 02636 // if (pGreyList) 02637 // pGreyList->RemoveItem(m_pGreyscaleVersion); 02638 02639 delete m_pGreyscaleVersion; 02640 m_pGreyscaleVersion = NULL; 02641 return TRUE; 02642 }
|
|
Implemented in CWxBitmap. |
|
Aks the user whether he wants to destroy XPE info.
Definition at line 3060 of file bitmap.cpp. 03061 { 03062 PORTNOTETRACE("other","OILBitmap::DestroyXPEInfo - do nothing"); 03063 #ifndef EXCLUDE_FROM_XARALX 03064 if (m_pMasterBitmap==NULL || m_pEditList==NULL) 03065 return TRUE; 03066 03067 m_pMasterBitmap = NULL; // This is just a pointer to another kernel bitmap 03068 m_pEditList = NULL; // This is a smart ptr so NULL-ing it should release the XML doc 03069 #endif 03070 return TRUE; 03071 }
|
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Definition at line 278 of file bitmap.h. 00278 { return m_AnimationRestoreType; }
|
|
Definition at line 268 of file bitmap.h. 00268 { return m_BitmapAnimDelay; }
|
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Finds the size in bytes, of this bitmap.
Definition at line 2944 of file bitmap.cpp. 02945 { 02946 BitmapInfo Info; 02947 Info.MemoryUsed = 0; 02948 02949 // Get the bitmap Info 02950 GetInfo(&Info); 02951 02952 return Info.MemoryUsed; 02953 }
|
|
Implemented in CWxBitmap. |
|
Read an entry from the Contone Palette.
Definition at line 2553 of file bitmap.cpp. 02554 { 02555 ERROR3IF(m_pContonePalette == NULL, "No contone palette to get data from!"); 02556 if (m_pContonePalette == NULL) 02557 return DocColour(COLOUR_WHITE); // Error - return arbitrary colour 02558 02559 // Ok, get the entry and convert it to a DocColour 02560 return DocColour((INT32) m_pContonePalette[PaletteIndex].rgbRed, 02561 (INT32) m_pContonePalette[PaletteIndex].rgbGreen, 02562 (INT32) m_pContonePalette[PaletteIndex].rgbBlue); 02563 }
|
|
Definition at line 357 of file bitmap.h. 00357 { return m_pGreyscaleTable; }
|
|
Definition at line 354 of file bitmap.h. 00354 { return m_pGreyscaleVersion; }
|
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Definition at line 271 of file bitmap.h. 00271 { return m_bInterpolation ; }
|
|
Definition at line 280 of file bitmap.h. 00280 { return m_LeftOffset; }
|
|
Definition at line 265 of file bitmap.h. 00265 { return m_BitmapName; }
|
|
Implemented in CWxBitmap. |
|
Gets the original bitmap file buffer associated with this reference.
Definition at line 2693 of file bitmap.cpp. 02694 { 02695 // Let the reference do the hard work ... 02696 return m_OriginalBitmap.GetOriginalSource(pSource, ppImportFilter); 02697 }
|
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Definition at line 282 of file bitmap.h. 00282 { return m_TopOffset; }
|
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Gets the stored XPE information for this bitmap.
Definition at line 3000 of file bitmap.cpp. 03003 { 03004 refMasterBitmap = m_pMasterBitmap; 03005 refEditList = m_pEditList; 03006 03007 if (bEnsureList && refEditList==NULL) 03008 { 03009 refEditList = CXMLUtils::NewDocument(); 03010 } 03011 03012 // I'd prefer not to use references but there are problems with IXMLDOMDocument2Ptr* 03013 // if (ppMasterBitmap) *ppMasterBitmap = m_pMasterBitmap; 03014 // if (ppEditList) *ppEditList = m_pEditList; 03015 }
|
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Reads the default fill pattern, either from a file or internally from a resource. Scope: Static.
Reimplemented from SimpleCCObject. Definition at line 162 of file oilbitmap.cpp. 00163 { 00164 static String_256 FillBitmapName; // must be static as a Preference 00165 00166 CamResource BitmapResource; 00167 BOOL ShouldDeleteFileObject=TRUE; 00168 00169 CCLexFile *File = NULL; 00170 00171 if (!Camelot.DeclareSection( wxT("Attributes"), 10)) 00172 return TRUE; 00173 00174 Camelot.DeclarePref( NULL, wxT("FillBitmap"), &FillBitmapName ); 00175 00176 if (!FillBitmapName.IsEmpty()) 00177 { 00178 // name given so try and open disk file 00179 CCDiskFile *DiskFile = new CCDiskFile(16384); // buffering makes a BIG difference 00180 00181 // Check if the constructor failed 00182 if (DiskFile) 00183 { 00184 if ( DiskFile->IsInited() ) 00185 { 00186 PathName WhichFile( FillBitmapName ); 00187 00188 // Check that the pathname supplied is valid as far as we are concerned 00189 if ( WhichFile.IsValid(FillBitmapName) ) 00190 { 00191 if (!DiskFile->open( WhichFile, ios::in | ios::binary )) 00192 { 00193 delete DiskFile; 00194 DiskFile = NULL; 00195 } 00196 } 00197 } 00198 else 00199 { 00200 delete DiskFile; 00201 DiskFile = NULL; 00202 } 00203 00204 if (DiskFile==NULL) 00205 InformError(); 00206 else 00207 File = DiskFile; // read from bitmap file 00208 } 00209 } 00210 00211 BOOL ReadHeader = TRUE; 00212 00213 if( File == NULL ) 00214 { 00215 File = BitmapResource.Open(_R(IDB_DEFAULTFILL)); 00216 ShouldDeleteFileObject=FALSE; 00217 } 00218 00219 // whatever file we opened, lets read the bitmap from it 00220 00221 if (File) 00222 { 00223 LPBITMAPINFO Info; 00224 LPBYTE Bytes; 00225 00226 File->SetReportErrors(FALSE); 00227 00228 if ( DIBUtil::ReadFromFile( File, &Info, &Bytes, ReadHeader ) ) 00229 { 00230 // if this fails, it won't be fatal, we just won't have any default bitmap fills 00231 OILBitmap::Default = new CWxBitmap( Info, Bytes ); 00232 00233 if (!OILBitmap::Default) 00234 FreeDIB( Info, Bytes ); // free up if failed 00235 else 00236 { 00237 Info->bmiHeader.biXPelsPerMeter = 3780; 00238 Info->bmiHeader.biYPelsPerMeter = 3780; 00239 00240 String_256 Str = _R(IDS_WBITMAP_DEFAULT); // "Default" 00241 OILBitmap::Default->SetName(Str); 00242 OILBitmap::Attach( OILBitmap::Default ); // set usage count to 1 00243 } 00244 } 00245 else 00246 InformError(); 00247 00248 // close file regardless 00249 if (File->isOpen()) 00250 File->close(); 00251 00252 // and maybe, just maybe, delete it (that's the object, not the file) as well!!! 00253 if (ShouldDeleteFileObject) delete File; 00254 } 00255 00256 return TRUE; 00257 }
|
|
Called when the interpolation setting is changed. Determines whether this bitmap is being used in the specified document. All references to the bitmap (e.g. shapes with bitmap fill) are invalidated so that they will be redrawn with the new interpolation setting.
Definition at line 2857 of file bitmap.cpp. 02858 { 02859 // Scan the document's tree for bitmap references 02860 Node* pNode = Node::DocFindFirstDepthFirst(pDoc); 02861 while (pNode != NULL) 02862 { 02863 // Ignore hidden nodes 02864 if (!pNode->IsNodeHidden()) 02865 { 02866 INT32 Count = 0; 02867 02868 // Does this node have any bitmaps in it ? 02869 KernelBitmap* pBitmap = pNode->EnumerateBitmaps(Count++); 02870 02871 while (pBitmap != NULL) 02872 { 02873 ERROR2IF(pBitmap->GetParentBitmapList() == NULL, 0L, "Bitmap has no parent list"); 02874 ERROR2IF(pBitmap->GetParentBitmapList()->GetParentDocument() != pDoc, 0L, "Document mismatch"); 02875 02876 // Check for a deleted bitmap 02877 if (pBitmap->HasBeenDeleted()) 02878 { 02879 // Use the default bitmap instead 02880 pBitmap = pBitmap->GetParentBitmapList()->FindDefaultBitmap(); 02881 02882 // There should always be a default bitmap at the start of the list 02883 ERROR2IF(pBitmap == NULL, 0L, "Couldn't find the default bitmap"); 02884 } 02885 02886 // Found a bitmap reference, so ... 02887 // .. is it the same as this bitmap 02888 if (pBitmap->ActualBitmap == this) 02889 { 02890 // We've found a node which refers to 'this' bitmap. 02891 // We need to find the bounding rectangle of the object which has 02892 // the bitmap property, so we can invalidate that area of the screen. 02893 02894 // get a copy of the current node pointer 02895 Node* pCurrentNode = pNode; 02896 02897 // if this is a bitmap fill or bitmap transparency... 02898 if( pCurrentNode->IsAnAttribute() ) 02899 { 02900 // ...then get the parent instead 02901 pCurrentNode = pNode->FindParent(); 02902 } 02903 02904 // Invalidate it so that it will be redrawn. 02905 if( pCurrentNode->IsBounded() ) 02906 { 02907 // Now we have either a bitmap, or an object which has a bitmap 02908 // fill/transparency attribute. 02909 02910 // cast the node to a NodeRenderableBounded 02911 NodeRenderableBounded* pBoundedNode = (NodeRenderableBounded*) pCurrentNode; 02912 02913 // get the spread of the node 02914 Spread* pSpread = NULL; 02915 pSpread = pBoundedNode->FindParentSpread(); 02916 ERROR3IF( (pSpread==NULL), "OILBitmap::InvalidateAllReferences - can't determine node's parent spread" ); 02917 02918 // force it to be redrawn 02919 Document::GetSelected()->ForceRedraw(pSpread, pBoundedNode->GetBoundingRect(), FALSE, pBoundedNode, FALSE); 02920 } 02921 } 02922 02923 pBitmap = pNode->EnumerateBitmaps(Count++); 02924 } 02925 } 02926 02927 // Move onto the next node in the tree 02928 pNode = pNode->DocFindNextDepthFirst(); 02929 } 02930 02931 return FALSE; 02932 }
|
|
Definition at line 373 of file bitmap.h. 00373 { return m_bIsAFractal; }
|
|
Implemented in CWxBitmap. |
|
Definition at line 360 of file bitmap.h. 00360 { return this == OILBitmap::Default || HasBeenDeleted(); }
|
|
Definition at line 359 of file bitmap.h. 00359 { return m_bIsGreyscale; }
|
|
Definition at line 274 of file bitmap.h. 00274 { return m_bHidden ; }
|
|
Hide some bitmaps from the user to avoid confusing the user.
Definition at line 3159 of file bitmap.cpp. 03160 { 03161 return (HasBeenDeleted() || NeedsXPERebuild() || m_bHidden); 03162 }
|
|
Definition at line 362 of file bitmap.h. 00362 { return !m_bTemp; }
|
|
Definition at line 363 of file bitmap.h. 00363 { return m_bIsLossy; }
|
|
Definition at line 361 of file bitmap.h. 00361 { return m_bTemp; }
|
|
Implemented in CWxBitmap. |
|
Definition at line 389 of file bitmap.h. 00389 { return m_bUsedByBrush; }
|
|
Determines if this bitmap is used by the children of the specified node (or their children etc).
Definition at line 2766 of file bitmap.cpp. 02767 { 02768 Node* pChild = pNode->FindFirstChild(); 02769 02770 while (pChild != NULL) 02771 { 02772 if (pChild->IsNodeHidden()) 02773 { 02774 if (bIncludeHidden) 02775 { 02776 Node* pTestNode = ((NodeHidden*)pChild)->HiddenNd; 02777 02778 if (IsUsedByNode(pTestNode)) 02779 return(TRUE); 02780 02781 if (pTestNode->FindFirstChild() && IsUsedByChildren(pTestNode, bIncludeHidden)) 02782 return(TRUE); 02783 } 02784 } 02785 else 02786 { 02787 if (pChild->FindFirstChild() && IsUsedByChildren(pChild, bIncludeHidden)) 02788 return(TRUE); 02789 02790 if (IsUsedByNode(pChild)) 02791 return(TRUE); 02792 } 02793 02794 pChild = pChild->FindNext(); 02795 } 02796 02797 return(FALSE); 02798 }
|
|
Determines if this bitmap is used by the specified node.
Definition at line 2716 of file bitmap.cpp. 02717 { 02718 INT32 Count = 0; 02719 02720 // Does this node have any bitmaps in it ? 02721 KernelBitmap* pBitmap = pNode->EnumerateBitmaps(Count++); 02722 02723 while (pBitmap != NULL) 02724 { 02725 // Check for a deleted bitmap 02726 if (pBitmap->HasBeenDeleted()) 02727 { 02728 // Use the default bitmap instead 02729 pBitmap = pBitmap->GetParentBitmapList()->FindDefaultBitmap(); 02730 02731 // There should always be a default bitmap at the start of the list 02732 ERROR2IF(pBitmap == NULL, 0L, "Couldn't find the default bitmap"); 02733 } 02734 02735 // Found a bitmap reference, so ... 02736 // .. is it the same as this bitmap 02737 if (pBitmap->ActualBitmap == this) 02738 { 02739 return TRUE; // Yep, this bitmap is being used 02740 } 02741 02742 pBitmap = pNode->EnumerateBitmaps(Count++); 02743 } 02744 02745 return(FALSE); 02746 }
|
|
Finds if this bitmap is being used in a specified document or not.
Definition at line 2812 of file bitmap.cpp. 02813 { 02814 // Scan the document's tree for bitmap references 02815 Node* pNode = Node::DocFindFirstDepthFirst(pDoc); 02816 while (pNode != NULL) 02817 { 02818 // Handle hidden nodes 02819 if (pNode->IsNodeHidden()) 02820 { 02821 if (bIncludeHidden) 02822 { 02823 Node* pTestNode = ((NodeHidden*)pNode)->HiddenNd; 02824 if (IsUsedByNode(pTestNode)) 02825 return(TRUE); 02826 02827 if (pTestNode->FindFirstChild() && IsUsedByChildren(pTestNode, bIncludeHidden)) 02828 return(TRUE); 02829 } 02830 } 02831 else 02832 { 02833 if (IsUsedByNode(pNode)) 02834 return(TRUE); 02835 } 02836 02837 // Move onto the next node in the tree 02838 pNode = pNode->DocFindNextDepthFirst(); 02839 } 02840 02841 return FALSE; 02842 }
|
|
Gets the XPE master status of this bitmap by searching the bitmap list.
Definition at line 3031 of file bitmap.cpp. 03032 { 03033 OILBitmap* poBmp = (OILBitmap*) GetApplication()->GetGlobalBitmapList()->GetHead(); 03034 while (poBmp) 03035 { 03036 if (poBmp->m_pMasterBitmap == this) 03037 return TRUE; 03038 03039 poBmp = (OILBitmap*) GetApplication()->GetGlobalBitmapList()->GetNext(poBmp); 03040 } 03041 03042 return FALSE; 03043 }
|
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Ask the user whether he wants to destroy XPE info.
Definition at line 3179 of file bitmap.cpp. 03180 { 03181 return m_bNeedsXPERebuild; 03182 }
|
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Remove the OIL bitmap from memory if it can be constructed from master and edits.
Definition at line 3122 of file bitmap.cpp. 03123 { 03124 PORTNOTE("other","OILBitmap::RebuildXPEBitmap - do nothing") 03125 #ifndef EXCLUDE_FROM_XARALX 03126 TRACE( _T("Warning - OILBitmap::RebuildXPEBitmap called\n") ); 03127 if (!m_bNeedsXPERebuild) 03128 return TRUE; 03129 03130 // If the XPE info is not present then we're in BIG trouble! 03131 ERROR2IF(m_pMasterBitmap==NULL || m_pEditList==NULL, FALSE, "ARGH! Can't rebuild Oil bitmap") 03132 if (m_pMasterBitmap==NULL || m_pEditList==NULL) 03133 return FALSE; 03134 03135 // Set the flag before calling DoProcessBitmap to prevent possible infinite recursion 03136 m_bNeedsXPERebuild = FALSE; 03137 03138 // Regenerate the OIL bitmap from the master and the edits 03139 XPEEditOp::DoProcessBitmap(this); 03140 #endif 03141 return TRUE; 03142 }
|
|
Definition at line 2433 of file bitmap.cpp. 02434 { 02435 if (!IsInGlobalList()) 02436 return FALSE; // Not in the list 02437 02438 m_bTemp = TRUE; 02439 02440 if (GetApplication()->GetGlobalBitmapList()->RemoveItem(this) == NULL) 02441 { 02442 ERROR3("Bitmap not found in Global bitmap list"); 02443 return FALSE; 02444 } 02445 02446 return TRUE; 02447 }
|
|
Aks the user whether he wants to destroy XPE info.
Definition at line 3088 of file bitmap.cpp. 03089 { 03090 PORTNOTETRACE("other","OILBitmap::RemoveXPEBitmap - do nothing"); 03091 #ifndef EXCLUDE_FROM_XARALX 03092 if (m_pMasterBitmap==NULL || m_pEditList==NULL) 03093 return FALSE; 03094 03095 if (IsDefaultBitmap()) 03096 return FALSE; 03097 03098 if (m_bNeedsXPERebuild) 03099 return TRUE; 03100 03101 DeleteData(FALSE); 03102 m_bNeedsXPERebuild = TRUE; 03103 #endif 03104 return TRUE; 03105 }
|
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Definition at line 277 of file bitmap.h. 00277 { m_AnimationRestoreType = Type; }
|
|
Definition at line 365 of file bitmap.h. 00365 { m_bIsAFractal = TRUE; 00366 m_bIsGreyscale = TRUE; }
|
|
Definition at line 368 of file bitmap.h. 00368 { m_bIsGreyscale = TRUE; };
|
|
Definition at line 372 of file bitmap.h. 00372 { m_bIsLossy = bLossy; };
|
|
Definition at line 267 of file bitmap.h. 00267 { m_BitmapAnimDelay = Delay; }
|
|
Creates a greyscale version of this bitmap.
Definition at line 2599 of file bitmap.cpp. 02600 { 02601 ERROR3IF(pOILBmp && !pOILBmp->IsGreyscale(), "SetGreyscale called with non-grey bitmap"); 02602 02603 DestroyGreyscaleVersion(); 02604 02605 m_pGreyscaleVersion = pOILBmp; 02606 m_pGreyscaleVersion->m_pColourVersion = this; 02607 02608 // GreyscaleBitmapList* pGreyList = 02609 // GetApplication()->GetGlobalBitmapList()->GetGreyscaleBitmapList(); 02610 02611 // if (pGreyList) 02612 // pGreyList->AddItem(m_pGreyscaleVersion); 02613 02614 return TRUE; 02615 }
|
|
Definition at line 273 of file bitmap.h. 00273 { m_bHidden = Value; }
|
|
Definition at line 270 of file bitmap.h. 00270 { m_bInterpolation = Value; }
|
|
Definition at line 279 of file bitmap.h. 00279 { m_LeftOffset = LeftOffset; }
|
|
Definition at line 264 of file bitmap.h. 00264 { m_BitmapName = NewName; }
|
|
Sets the original bitmap file associated with this reference.
Definition at line 2662 of file bitmap.cpp. 02663 { 02664 // Let the reference do the hard work ... 02665 m_OriginalBitmap.SetOriginalSource(pSource, pImportFilter); 02666 }
|
|
Implemented in CWxBitmap. |
|
Implemented in CWxBitmap. |
|
Definition at line 281 of file bitmap.h. 00281 { m_TopOffset = TopOffset; }
|
|
Implemented in CWxBitmap. |
|
Definition at line 388 of file bitmap.h. 00388 { m_bUsedByBrush = Used;}
|
|
Sets the XPE edit list document for this bitmap.
Definition at line 2971 of file bitmap.cpp. 02972 { 02973 // ERROR3IF(pMasterBitmap==NULL || pNewEditList==NULL, 02974 // "Bitmap Error. Either master pointer or edit list NULL in SetXPEInfo"); 02975 02976 m_pMasterBitmap = pMasterBitmap; 02977 m_pEditList = pNewEditList; 02978 }
|
|
Implemented in CWxBitmap. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|