#include <bitmap.h>
Inheritance diagram for KernelBitmap:
Public Member Functions | |
KernelBitmap (OILBitmap *pBitmap=NULL, BOOL Temp=FALSE) | |
Constructor for kernel bitmaps. Attaches to the OILBitmap and increases its usage count. | |
KernelBitmap (const KernelBitmap &) | |
Copy constructor for kernel bitmaps. MAintains usage count on OILBitmap. | |
KernelBitmap (UINT32, UINT32, UINT32, UINT32, BOOL Temp=FALSE) | |
Constructor for kernel bitmaps which attaches it to a blank OILbitmap. Actually, the OILBitmap isn't really blank, it is entirely uninitialised i.e its contents will be random (including its palette if it has one). | |
~KernelBitmap () | |
Destructor. Detaches any current OILBitmap. | |
INT32 | operator== (const KernelBitmap &) |
KernelBitmap & | operator= (const KernelBitmap &) |
Assigns one KernelBitmap to another while maintaining usage count on OILBitmap. | |
OILBitmap * | GetActualBitmap () const |
BOOL | IsOK () const |
Tell if KernelBitmap is OK. | |
virtual BOOL | WritePalette (BaseCamelotFilter *pFilter) |
Exports the palette out to the file using the BaseCamelotFilter supplied. This means that it is being written to a web or native file. At present, used by the code when outputting an 8bpp JPEG to squirt the palette into the record so that we can convert it back to 8bpp using the palette on loading. | |
virtual BOOL | Convert24To8 (RGBTRIPLE *pPalette, UINT32 NumberOfPaletteEntries) |
Converts the OILbitmap from its present 24bpp form into an 8bpp form which should closely match the one that was exported. | |
void | PlotPixel (INT32 x, INT32 y, Pixel32bpp NewValue) |
Plots a 32bpp pixel to a deep bitmap (16, 24, or 32bpp). | |
void | PlotPixel (INT32 x, INT32 y, PixelGreyscale NewValue) |
Plots an 8bpp (0..255) pixel to any type of bitmap The pixel is taken to be a greyscale, and is truncated or expanded as appropriate to fit the greyscale value into the destination bitmap pixel format. | |
Pixel32bpp | ReadPixel32bpp (INT32 x, INT32 y, BOOL UsePalette=TRUE) const |
reads a pixel | |
INT32 | ReturnPaletteIndexUsed (INT32 x, INT32 y) const |
PixelGreyscale | ReadPixelGreyscale (INT32 x, INT32 y) const |
Reads a pixel as a greyscale intensity value (0..255). | |
ADDR | GetBitmapBits () const |
Helper function to get the actual bits (as in Bitmap). | |
BitmapList * | GetParentBitmapList () |
BOOL | IsUsedInDocument (Document *pDoc, BOOL bIncludeHidden=FALSE) |
Finds if this bitmap is being used in a specified document or not. | |
void | Attach (BitmapList *=NULL) |
Adds this kernel bitmap to the specified document bitmap list. | |
void | Detach () |
Removes this kernel bitmap from it's current document bitmap list. | |
UINT32 | GetWidth () const |
Finds the width of this bitmap. | |
UINT32 | GetHeight () const |
Finds the height of this bitmap. | |
UINT32 | GetBPP () |
Finds the colour resolution of this bitmap. | |
UINT32 | GetNumPaletteEntries () const |
Finds the number of colours colour in this bitmap. | |
INT32 | GetRecommendedWidth () |
Finds the recommended width of the bitmap. | |
INT32 | GetRecommendedHeight () |
Finds the recommended height of the bitmap. | |
void | SetRecommendedWidth (INT32) |
Sets the recommended width of the bitmap. | |
void | SetRecommendedHeight (INT32) |
Sets the recommended height of the bitmap. | |
BOOL | SetTransparencyIndex (INT32) |
Finds the Transparent index colour of a bitmap if one exists. | |
BOOL | GetTransparencyIndex (INT32 *pIndex) |
Finds the Transparent index colour of a bitmap if one exists. | |
BOOL | IsTransparent () |
Determines if a bitmap is not totally opaque. | |
BOOL | IsDefaultBitmap () |
To find out if the bitmap is the default bitmap or not. This is used by the native/web saving code to see if the bitmap is the default one and if so save a reference to it. | |
BOOL | HasBeenDeleted () |
Tests whether or not the OIL bitmap attached to the kernel bitmap class has been deleted. | |
BOOL | IsGreyscale () |
Finds if this bitmap is greyscale or not. | |
BOOL | IsLossy () |
Finds if this bitmap is lossy or not. | |
void | SetOriginalSource (BitmapSource *pFileBuffer=NULL, BaseBitmapFilter *pImportFilter=NULL) |
Sets the original bitmap file associated with this reference. | |
BOOL | GetOriginalSource (BitmapSource **ppFileBuffer=NULL, BaseBitmapFilter **ppImportFilter=NULL) |
Gets the original bitmap file buffer associated with this reference. | |
BOOL | CreateGreyscaleVersion (BOOL ForceGreyBmp=FALSE) |
Creates a greyscale version of this bitmap. | |
BOOL | DestroyGreyscaleVersion () |
Destroys the greyscale version of this bitmap. | |
OILBitmap * | GetGreyscaleVersion (BOOL ForceGreyBmp=FALSE) |
Gets the greyscale version of this bitmap. | |
OILBitmap * | ExtractOILBitmap () |
Extracts the OILBitmap from this kernel bitmap AND DELETES THIS KERNEL BITMAP. | |
void | GenerateGreyscaleTable () |
BOOL | SetAsFractal () |
Set this bitmap as a fractal bitmap. | |
BOOL | SetAsGreyscale () |
Set this bitmap as a greyscale bitmap This is used to inform the bitmap that it is a greyscale 8bpp bitmap. This is because when we create a grteyscale OILBitmap and attach a KernelBitmap to it, there is no way to indicate to the system that it's a true greyscale bitmap, which is necessary to stop it farting around and making a new copy of the bitmap when someone calls GetGreyscaleVersion(). This is used by the airbrush stroke provider when it generates a greyscale bitmap for use as a transparency mask. | |
BOOL | SetAsLossy (BOOL bLossy=TRUE) |
Set this bitmap' lossy flag. | |
UINT32 | GetDelay () |
Returns m_AnimDelay for an OilBitmap. | |
void | SetDelay (UINT32 Delay) |
Sets the m_AnimDelay memeber for an OilBitmap. | |
BOOL | GetInterpolation () |
Returns m_bInterpolation for an OilBitmap. | |
void | SetInterpolation (BOOL bInterpolation) |
Sets the m_bInterpolation member for an OilBitmap. | |
void | SetAnimationRestoreType (GIFDisposalMethod Type) |
Sets the GIF restore type for an OilBitmap. | |
GIFDisposalMethod | GetAnimationRestoreType () const |
Returns the GIF restore type for an OilBitmap. | |
void | SetLeftOffset (UINT32 LeftOffset) |
Sets the left offset for an OilBitmap. | |
UINT32 | GetLeftOffset () const |
Gets the left offset for an OilBitmap. | |
void | SetTopOffset (UINT32 TopOffset) |
Sets the top offset for an OilBitmap. | |
UINT32 | GetTopOffset () const |
Gets the top offset for an OilBitmap. | |
BOOL | IsBrowserPalette () const |
To see if the palette attached to this bitmap is browser compatible. | |
BOOL | ArePalettesTheSame (const LPLOGPALETTE pLogPalette, const INT32 TransColour=-1) |
To see if the palette attached to this bitmap is browser compatible. It runs through the colours in a browser palette and checks to see if they are all present. The ordering is not checked and so the palette may be different from the one that we actually use. | |
UINT32 | GetHorizontalDPI () const |
Retrieve information on this bitmap. | |
UINT32 | GetVerticalDPI () const |
Retrieve information on this bitmap. | |
void | SetName (String_256 &NewName) |
Set information on this bitmap. | |
String_256 & | GetName () |
Retrieve information on this bitmap. | |
LPBITMAPINFO | GetBitmapInfo () |
To get at the BITMAPINFO that this bitmap may have. | |
LPRGBQUAD | GetPaletteForBitmap () |
To get at the RGBQUAD palette that this bitmap may have. | |
LPBITMAPINFOHEADER | GetBitmapInfoHeader () |
To get at the BITMAPINFOHEADER that this bitmap should have. | |
void | SetUsedByBrush (BOOL Used) |
BOOL | IsUsedByBrush () |
virtual void | SetXPEInfo (KernelBitmap *pMasterBitmap, IXMLDOMDocumentPtr pNewEditList) |
Sets the XPE edit list document for this bitmap. | |
virtual void | GetXPEInfo (KernelBitmap *&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 void | ReplaceOILBitmap (LPBYTE pBits, LPBITMAPINFO pInfo) |
Remove the OIL bitmap from memory if it can be constructed from master and edits. | |
Static Public Member Functions | |
static KernelBitmap * | MakeKernelBitmap (OILBitmap *pBitmap=NULL, Document *pDoc=NULL, BOOL bAlwaysNew=FALSE) |
Makes a KernelBitmap from an OIL bitmap. Will use an existing one if the OILBitmap is already in use in the Doc. | |
static void | SetCreateTracker (List *pList) |
static BOOL | ImportBitmap (CCLexFile *pFile, BaseBitmapFilter *pBitmapFilter, BaseCamelotFilter *pFilter, BOOL IsCompressed, RGBTRIPLE *pPalette, UINT32 NumberOfPaletteEntries, KernelBitmap **ppImportedBitmap, BOOL *IsNew) |
Imports a bitmap, and checks to see if the bitmap already exist, returning a pointer to the existing bitmap if possible, or creates a new one. | |
static BOOL | ImportBitmap (Filter *pFilter, const BitmapInfo *pInfo, INT32 BitmapType, KernelBitmap **, BOOL *) |
Imports a bitmap, and checks to see if the bitmap already exist, returning a pointer to the existing bitmap if possible, or creates a new one. | |
static KernelBitmap * | TryAndUseExistingBitmap (OILBitmap *pOILBitmap, Document *pDoc, BOOL *IsNew) |
Imports a bitmap, and checks to see if the bitmap already exist, returning a pointer to the existing bitmap if possible, or creates a new one. | |
Public Attributes | |
OILBitmap * | ActualBitmap |
Static Public Attributes | |
static List * | s_pTrackerList = NULL |
Protected Attributes | |
BitmapList * | m_pParentList |
BOOL | m_bDontDeleteActualBitmap: 1 |
BOOL | m_bFractalAttached: 1 |
BOOL | m_bUsedByBrush: 1 |
Friends | |
class | BitmapList |
Definition at line 483 of file bitmap.h.
|
Constructor for kernel bitmaps. Attaches to the OILBitmap and increases its usage count.
Definition at line 294 of file bitmap.cpp. 00295 { 00296 m_pParentList = NULL; 00297 m_bDontDeleteActualBitmap = FALSE; 00298 m_bFractalAttached = FALSE; 00299 m_bUsedByBrush = FALSE; 00300 if (pBitmap == NULL) 00301 ActualBitmap = OILBitmap::Attach(); 00302 else 00303 ActualBitmap = OILBitmap::Attach(pBitmap, IsTemp); 00304 00305 if (ActualBitmap && ActualBitmap->IsAFractal()) 00306 m_bFractalAttached = TRUE; 00307 }
|
|
Copy constructor for kernel bitmaps. MAintains usage count on OILBitmap.
Definition at line 390 of file bitmap.cpp. 00391 { 00392 m_pParentList = NULL; 00393 m_bDontDeleteActualBitmap = FALSE; 00394 m_bFractalAttached = FALSE; 00395 m_bUsedByBrush = FALSE; 00396 ActualBitmap = OILBitmap::Attach( other.ActualBitmap, other.ActualBitmap->IsTemp() ); 00397 00398 if (ActualBitmap && ActualBitmap->IsAFractal()) 00399 m_bFractalAttached = TRUE; 00400 }
|
|
Constructor for kernel bitmaps which attaches it to a blank OILbitmap. Actually, the OILBitmap isn't really blank, it is entirely uninitialised i.e its contents will be random (including its palette if it has one).
Definition at line 417 of file bitmap.cpp. 00418 { 00419 m_pParentList = NULL; 00420 m_bDontDeleteActualBitmap = FALSE; 00421 m_bFractalAttached = FALSE; 00422 m_bUsedByBrush = FALSE; 00423 OILBitmap *bm = OILBitmap::Create( Width, Height, Depth, dpi ); 00424 if (bm) 00425 ActualBitmap = OILBitmap::Attach( bm, bTemp ); 00426 else 00427 ActualBitmap = NULL; 00428 }
|
|
Destructor. Detaches any current OILBitmap.
Definition at line 458 of file bitmap.cpp. 00459 { 00460 if (m_pParentList != NULL) 00461 { 00462 // If we're still in the bitmap list, then remove us 00463 m_pParentList->RemoveItem(this); 00464 m_pParentList = NULL; 00465 } 00466 00467 if (ActualBitmap) 00468 { 00469 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 00470 "Bitmap Error. Found a reference to a deleted bitmap."); 00471 00472 // JustinF says: made the above check in retail builds as well, or we'll crash! 00473 if (//(INT32) ActualBitmap->m_pColourVersion != 0xFEEEFEEE && 00474 //(INT32) ActualBitmap->m_pColourVersion != 0xCDCDCDCD && 00475 //(INT32) ActualBitmap->m_pColourVersion != 0xDDDDDDDD && 00476 !m_bDontDeleteActualBitmap && 00477 !m_bFractalAttached && 00478 ActualBitmap->IsTemp()) 00479 { 00480 delete ActualBitmap; 00481 } 00482 00483 // AndyH says: what a load of rubbish. 00484 // ActualBitmap->m_pColourVersion never evaluates to the constants 00485 // given above in the release build. In fact bug 6712 occurs because 00486 // we try to delete a KernelBitmap whose OILBitmap has already been 00487 // deleted; in turn, this function deletes ActualBitmap (an OILBitmap) 00488 // and causes an access violation. 00489 00490 // By removing the above 'bodge', such access violations will occur in 00491 // debug mode too, as they should. 00492 00493 ActualBitmap = NULL; 00494 } 00495 }
|
|
To see if the palette attached to this bitmap is browser compatible. It runs through the colours in a browser palette and checks to see if they are all present. The ordering is not checked and so the palette may be different from the one that we actually use.
Definition at line 2017 of file bitmap.cpp. 02018 { 02019 if (ActualBitmap != NULL) 02020 return ActualBitmap->ArePalettesTheSame(pLogPalette, TransColour); 02021 02022 return FALSE; 02023 }
|
|
Adds this kernel bitmap to the specified document bitmap list.
Definition at line 1207 of file bitmap.cpp. 01208 { 01209 if (BmpList == NULL) 01210 BmpList = m_pParentList; 01211 01212 ERROR3IF(BmpList == NULL, "Warning ... NULL BmpList in KernelBitmap::Attach"); 01213 if (BmpList == NULL) 01214 return; 01215 01216 if (m_pParentList == NULL) 01217 { 01218 TRACEUSER( "Neville", _T("Attaching KBmp @ %x, to List at %x\n"), this, BmpList ); 01219 m_pParentList = BmpList; 01220 BmpList->AddItem(this); 01221 01222 if (KernelBitmap::s_pTrackerList) 01223 { 01224 KernelBmpListItem* pItem = new KernelBmpListItem(this); 01225 if (pItem) 01226 KernelBitmap::s_pTrackerList->AddTail(pItem); 01227 } 01228 } 01229 01230 ActualBitmap->RebuildXPEBitmap(); 01231 }
|
|
Converts the OILbitmap from its present 24bpp form into an 8bpp form which should closely match the one that was exported.
Definition at line 735 of file bitmap.cpp. 00736 { 00737 ERROR2IF(pPalette == NULL,FALSE,"KernelBitmap::Convert24To8 null pFilter"); 00738 ERROR2IF(NumberOfPaletteEntries == 0,FALSE,"KernelBitmap::Convert24To8 NumberOfPaletteEntries = 0"); 00739 00740 if (ActualBitmap == NULL) 00741 return FALSE; 00742 00743 // If the bitmap is already 8bpp then do nothing 00744 if (GetBPP() == 8) 00745 return TRUE; 00746 00747 return ActualBitmap->Convert24To8(pPalette, NumberOfPaletteEntries); 00748 }
|
|
Creates a greyscale version of this bitmap.
Definition at line 1597 of file bitmap.cpp. 01598 { 01599 if (ActualBitmap == NULL) 01600 return FALSE; 01601 01602 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01603 "Bitmap Error. Found a reference to a deleted bitmap."); 01604 01605 if (!IsGreyscale()) 01606 { 01607 // if (GetBPP() == 8 && !ForceGreyBmp) 01608 if (!ForceGreyBmp) 01609 { 01610 // If the bitmap is already a paletted bitmap, then we don't 01611 // need to generate a greyscale version, 'cus we can use some 01612 // clever palette manipulation 01613 GenerateGreyscaleTable(); 01614 } 01615 else 01616 { 01617 // Make a new grey level version of the bitmap 01618 OILBitmap* pOILBmp = DIBUtil::Create8bppGreyscaleBitmap(this); 01619 if (pOILBmp == NULL) 01620 return FALSE; 01621 01622 pOILBmp->m_bIsGreyscale = TRUE; 01623 ActualBitmap->SetGreyscaleVersion(pOILBmp); 01624 } 01625 } 01626 01627 return TRUE; 01628 }
|
|
Destroys the greyscale version of this bitmap.
Definition at line 1640 of file bitmap.cpp. 01641 { 01642 if (ActualBitmap == NULL) 01643 return FALSE; 01644 01645 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01646 "Bitmap Error. Found a reference to a deleted bitmap."); 01647 01648 return ActualBitmap->DestroyGreyscaleVersion(); 01649 }
|
|
Aks the user whether he wants to destroy XPE info.
Definition at line 1530 of file bitmap.cpp. 01531 { 01532 if (ActualBitmap==NULL) 01533 return TRUE; 01534 01535 PORTNOTETRACE("other","KernelBitmap::DestroyXPEInfo - do nothing"); 01536 #ifndef EXCLUDE_FROM_XARALX 01537 IXMLDOMDocumentPtr pEdits = NULL; 01538 OILBitmap* pMaster = NULL; 01539 ActualBitmap->GetXPEInfo(pMaster, pEdits); 01540 01541 if (pEdits==NULL || pMaster==NULL) 01542 return TRUE; 01543 01544 INT32 iButton = InformWarning(_R(IDS_XPE_DESTROY_MSG), _R(IDS_CONTINUE), _R(IDS_CANCEL)); 01545 if (iButton==1) 01546 { 01547 ActualBitmap->DestroyXPEInfo(); 01548 } 01549 return (iButton==1); 01550 #else 01551 return TRUE; 01552 #endif 01553 }
|
|
Removes this kernel bitmap from it's current document bitmap list.
Definition at line 1247 of file bitmap.cpp. 01248 { 01249 // For each document 01250 // If bitmap is used in document 01251 // Go though all the documents 01252 Document* pDoc = (Document*)GetApplication()->Documents.GetHead(); 01253 while (pDoc != NULL) 01254 { 01255 if (ActualBitmap->IsUsedInDocument(pDoc)) 01256 return; 01257 01258 // Move onto the next document 01259 pDoc = (Document*)GetApplication()->Documents.GetNext(pDoc); 01260 } 01261 01262 // If we got here then the bitmap is not used in any document 01263 // so we can safely vape its data if we can later rebuild it 01264 ActualBitmap->RemoveXPEBitmap(); 01265 }
|
|
Extracts the OILBitmap from this kernel bitmap AND DELETES THIS KERNEL BITMAP.
Definition at line 1662 of file bitmap.cpp. 01663 { 01664 if (ActualBitmap == NULL) 01665 return NULL; 01666 01667 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01668 "Bitmap Error. Found a reference to a deleted bitmap."); 01669 01670 OILBitmap* pBmp = ActualBitmap; 01671 01672 if (ActualBitmap->IsInGlobalList()) 01673 ActualBitmap->RemoveFromGlobalList(); 01674 01675 #ifdef _DEBUG 01676 ActualBitmap->m_bIsAttached = FALSE; 01677 #endif 01678 01679 m_bDontDeleteActualBitmap = TRUE; 01680 delete this; 01681 01682 return pBmp; 01683 }
|
|
Definition at line 1726 of file bitmap.cpp. 01727 { 01728 // if (ActualBitmap == NULL || GetBPP() != 8) 01729 if (ActualBitmap == NULL || GetBPP()>8) 01730 return; 01731 01732 ActualBitmap->GenerateGreyscaleTable(); 01733 }
|
|
Definition at line 508 of file bitmap.h. 00508 { return ActualBitmap; }
|
|
Returns the GIF restore type for an OilBitmap.
Definition at line 1885 of file bitmap.cpp. 01886 { 01887 if (ActualBitmap != NULL) 01888 return ActualBitmap->GetAnimationRestoreType(); 01889 01890 return GDM_LEAVE; 01891 }
|
|
Helper function to get the actual bits (as in Bitmap).
Definition at line 1177 of file bitmap.cpp. 01178 { 01179 OILBitmap* pOILy = GetActualBitmap(); 01180 if (pOILy == NULL) 01181 { 01182 TRACE( _T("KernelBitmap::GetBitmapBits() - no OILBitmap") ); 01183 return NULL; 01184 } 01185 01186 ERROR3IF(!pOILy->IS_KIND_OF(OILBitmap), "pOILy isn't"); 01187 01188 return pOILy->GetBitmapBits(); 01189 }
|
|
To get at the BITMAPINFO that this bitmap may have.
Note: Only use from Winoil code Definition at line 2131 of file bitmap.cpp. 02132 { 02133 if (ActualBitmap != NULL) 02134 return ActualBitmap->GetBitmapInfo(); 02135 02136 return NULL; 02137 }
|
|
To get at the BITMAPINFOHEADER that this bitmap should have.
Note: Only use from Winoil code Definition at line 2182 of file bitmap.cpp. 02183 { 02184 if (ActualBitmap != NULL) 02185 return ActualBitmap->GetBitmapInfoHeader(); 02186 02187 return NULL; 02188 }
|
|
Finds the colour resolution of this bitmap.
Definition at line 1280 of file bitmap.cpp. 01281 { 01282 if (ActualBitmap == NULL) 01283 return 0; 01284 01285 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap,"Bitmap Error. Found a reference to a deleted bitmap."); 01286 01287 return ActualBitmap->GetBPP(); 01288 }
|
|
Returns m_AnimDelay for an OilBitmap.
Definition at line 1818 of file bitmap.cpp. 01819 { 01820 if (ActualBitmap != NULL) 01821 return ActualBitmap->GetBitmapAnimDelay(); 01822 01823 return 0; 01824 }
|
|
Gets the greyscale version of this bitmap.
Definition at line 1695 of file bitmap.cpp. 01696 { 01697 if (ActualBitmap == NULL) 01698 return NULL; 01699 01700 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01701 "Bitmap Error. Found a reference to a deleted bitmap."); 01702 01703 if (IsGreyscale()) 01704 return ActualBitmap; 01705 01706 OILBitmap* pGreyBmp = ActualBitmap->GetGreyscaleVersion(); 01707 if (pGreyBmp == NULL) 01708 { 01709 // Make a greyscale bitmap 01710 CreateGreyscaleVersion(ForceGreyBmp); 01711 } 01712 01713 return ActualBitmap->GetGreyscaleVersion(); 01714 }
|
|
Finds the height of this bitmap.
Definition at line 1320 of file bitmap.cpp. 01321 { 01322 if (ActualBitmap == NULL) 01323 return 0; 01324 01325 return ActualBitmap->GetHeight(); 01326 }
|
|
Retrieve information on this bitmap.
Definition at line 2036 of file bitmap.cpp. 02037 { 02038 if (ActualBitmap != NULL) 02039 return ActualBitmap->GetHorizontalDPI(); 02040 02041 return 96; 02042 }
|
|
Returns m_bInterpolation for an OilBitmap.
Definition at line 1851 of file bitmap.cpp. 01852 { 01853 if (ActualBitmap != NULL) 01854 return ActualBitmap->GetInterpolation(); 01855 01856 return 0; 01857 }
|
|
Gets the left offset for an OilBitmap.
Definition at line 1938 of file bitmap.cpp. 01939 { 01940 if (ActualBitmap != NULL) 01941 return ActualBitmap->GetLeftOffset(); 01942 01943 return 0; 01944 }
|
|
Retrieve information on this bitmap.
Definition at line 2096 of file bitmap.cpp. 02097 { 02098 if (ActualBitmap != NULL) 02099 return ActualBitmap->GetName(); 02100 02101 02102 // In the "oh no where's the ActualBitmap" case 02103 // The old code used to be: 02104 // return String_256(""); 02105 // This static dummy object is used for returning in the error case 02106 // The original used to return a ptr to a local variable, which is a tad dangerous. 02107 // This solution is not ideal, because there's a permanent instance of an object 02108 // that will probably never be used. 02109 static String_256 Dummy(""); 02110 return Dummy; 02111 }
|
|
Finds the number of colours colour in this bitmap.
Definition at line 1339 of file bitmap.cpp. 01340 { 01341 if (ActualBitmap == NULL) 01342 return 0; 01343 01344 return ActualBitmap->GetNumPaletteEntries(); 01345 }
|
|
Gets the original bitmap file buffer associated with this reference.
Definition at line 1399 of file bitmap.cpp. 01400 { 01401 if (ActualBitmap == NULL) 01402 return FALSE; 01403 01404 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01405 "Bitmap Error. Found a reference to a deleted bitmap."); 01406 01407 // The OILBitmap has the reference in it 01408 return ActualBitmap->GetOriginalSource(pSource, ppImportFilter); 01409 }
|
|
To get at the RGBQUAD palette that this bitmap may have.
Note: Only use from Winoil code Definition at line 2157 of file bitmap.cpp. 02158 { 02159 if (ActualBitmap != NULL) 02160 return ActualBitmap->GetPaletteForBitmap(); 02161 02162 return NULL; 02163 }
|
|
Definition at line 538 of file bitmap.h. 00538 { return m_pParentList; }
|
|
Finds the recommended height of the bitmap.
Definition at line 1118 of file bitmap.cpp. 01119 { 01120 INT32 Height = 0; 01121 01122 if (ActualBitmap) 01123 { 01124 Height = ActualBitmap->GetRecommendedHeight(); 01125 } 01126 01127 return Height; 01128 }
|
|
Finds the recommended width of the bitmap.
Definition at line 1095 of file bitmap.cpp. 01096 { 01097 INT32 Width = 0; 01098 01099 if (ActualBitmap) 01100 { 01101 Width = ActualBitmap->GetRecommendedWidth(); 01102 } 01103 01104 return Width; 01105 }
|
|
Gets the top offset for an OilBitmap.
Definition at line 1974 of file bitmap.cpp. 01975 { 01976 if (ActualBitmap != NULL) 01977 return ActualBitmap->GetTopOffset(); 01978 01979 return 0; 01980 }
|
|
Finds the Transparent index colour of a bitmap if one exists.
Definition at line 1047 of file bitmap.cpp. 01048 { 01049 if (ActualBitmap == NULL) 01050 return FALSE; 01051 01052 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01053 "Bitmap Error. Found a reference to a deleted bitmap."); 01054 01055 if (ActualBitmap->GetBPP() > 8) 01056 return FALSE; 01057 01058 return ActualBitmap->GetTransparencyIndex(pIndex); 01059 }
|
|
Retrieve information on this bitmap.
Definition at line 2055 of file bitmap.cpp. 02056 { 02057 if (ActualBitmap != NULL) 02058 return ActualBitmap->GetVerticalDPI(); 02059 02060 return 96; 02061 }
|
|
Finds the width of this bitmap.
Definition at line 1301 of file bitmap.cpp. 01302 { 01303 if (ActualBitmap == NULL) 01304 return 0; 01305 01306 return ActualBitmap->GetWidth(); 01307 }
|
|
Gets the stored XPE information for this bitmap.
Definition at line 1458 of file bitmap.cpp. 01461 { 01462 if (ActualBitmap) 01463 { 01464 OILBitmap* pMasterOil = NULL; 01465 ActualBitmap->GetXPEInfo(pMasterOil, refEditList, bEnsureList); 01466 BitmapList* pBitmapList = m_pParentList; 01467 if (pBitmapList==NULL) 01468 { 01469 Document* pDoc = Document::GetCurrent(); 01470 if (pDoc) 01471 pBitmapList = pDoc->GetBitmapList(); 01472 } 01473 01474 if (pMasterOil && pBitmapList) 01475 { 01476 KernelBitmap* pBmp = (KernelBitmap*)pBitmapList->GetHead(); 01477 01478 // Scan through the Documents bitmap list to see if any of 01479 // the existing KernelBitmaps reference this OILBitmap. 01480 while (pBmp != NULL) 01481 { 01482 if (pBmp->ActualBitmap == pMasterOil) 01483 { 01484 refMasterBitmap = pBmp; 01485 break; 01486 } 01487 01488 pBmp = (KernelBitmap*)pBitmapList->GetNext(pBmp); 01489 } 01490 } 01491 } 01492 }
|
|
Tests whether or not the OIL bitmap attached to the kernel bitmap class has been deleted.
Definition at line 672 of file bitmap.cpp. 00673 { 00674 // This test is far better done BEFORE the ERROR3! 00675 // Graeme (21/6/00) - Added a test to see whether the pointer points at 0xdddddddd, as 00676 // this is the value that the memory is (re)set to by delete. 00677 // Luke (31/10/05) - Removed these tests, since I'd rather this excepts rather than 00678 // perform a dodgy read on some memory that may be returned to OS (or used for something 00679 // else) 00680 if( ActualBitmap == NULL ) 00681 { 00682 return TRUE; 00683 } 00684 else 00685 { 00686 ERROR3IF_OILBMP_PTR_INVALID ( ActualBitmap, 00687 "Bitmap Error. Found a reference to a deleted bitmap." ); 00688 00689 return ActualBitmap->HasBeenDeleted (); 00690 } 00691 }
|
|
Imports a bitmap, and checks to see if the bitmap already exist, returning a pointer to the existing bitmap if possible, or creates a new one.
Definition at line 870 of file bitmap.cpp. 00872 { 00873 ERROR2IF(pFilter == NULL,FALSE,"KernelBitmap::ImportBitmap null pFilter"); 00874 ERROR2IF(ppImportedBitmap == NULL,FALSE,"KernelBitmap::ImportBitmap null ppImportedBitmap"); 00875 00876 *ppImportedBitmap = NULL; 00877 if (IsNew) 00878 *IsNew = TRUE; 00879 00880 // Get a new bitmap object for this node. 00881 OILBitmap *pOILBitmap = OILBitmap::Create(); 00882 if (pOILBitmap == NULL) 00883 { 00884 return FALSE; 00885 } 00886 00887 if (!pOILBitmap->ImportBitmap(pFilter, pInfo, BitmapType)) 00888 { 00889 delete pOILBitmap; 00890 return FALSE; 00891 } 00892 00893 // Now check to see if this bitmap already exists if necessary.... 00894 Document* ImportDoc = ((Filter*)pFilter)->GetDocument(); 00895 if (ImportDoc == NULL) 00896 ImportDoc = Document::GetSelected(); 00897 00898 if (ImportDoc == NULL) 00899 { 00900 // delete pOILBitmap; 00901 // return FALSE; 00902 // } 00903 // no document, so don't try to re-use any existing bitmaps 00904 *ppImportedBitmap = TryAndUseExistingBitmap(pOILBitmap, NULL, NULL); 00905 } 00906 else 00907 { 00908 // The bitmap system relies on the Current Doc being correct, 00909 // so we'll set it to be on the safe side 00910 ImportDoc->SetCurrent(); 00911 00912 // Is there an existing KernelBitmap already in the bitmap list ? 00913 *ppImportedBitmap = TryAndUseExistingBitmap(pOILBitmap, ImportDoc, IsNew); 00914 } 00915 00916 return (*ppImportedBitmap != NULL); 00917 }
|
|
Imports a bitmap, and checks to see if the bitmap already exist, returning a pointer to the existing bitmap if possible, or creates a new one.
Assumes: pFile has already been opened up for reading pFilter has been set up for reading the data e.g. progress bar
Definition at line 784 of file bitmap.cpp. 00788 { 00789 ERROR2IF(pFile == NULL,FALSE,"KernelBitmap::ImportBitmap null pFile"); 00790 ERROR2IF(pBitmapFilter == NULL,FALSE,"KernelBitmap::ImportBitmap null pBitmapFilter"); 00791 ERROR2IF(pFilter == NULL,FALSE,"KernelBitmap::ImportBitmap null pFilter"); 00792 ERROR2IF(ppImportedBitmap == NULL,FALSE,"KernelBitmap::ImportBitmap null ppImportedBitmap"); 00793 00794 *ppImportedBitmap = NULL; 00795 00796 if (IsNew) 00797 *IsNew = TRUE; 00798 00799 // Get a new bitmap object to import into 00800 OILBitmap *pOILBitmap = OILBitmap::Create(); 00801 if (pOILBitmap == NULL) 00802 { 00803 return FALSE; 00804 } 00805 00806 // Import the bitmap data 00807 if (!pOILBitmap->ImportBitmap(pFile, pBitmapFilter, pFilter, IsCompressed)) 00808 { 00809 delete pOILBitmap; 00810 return FALSE; 00811 } 00812 00813 // Check if a palette has been supplied, if so then it is a JPEG which started out 00814 // as 8bpp colour but has been converted to 24bpp so that it can be JPEGed. 00815 // If this is the case then the palette is the one from the original bitmap. So use 00816 // it to go and convert the data back into the 8bpp data. 00817 if (pPalette && NumberOfPaletteEntries > 0 && NumberOfPaletteEntries <= 256) 00818 { 00819 // If the loaded bitmap is not 24bpp then do nothing 00820 if (pOILBitmap->GetBPP() == 24) 00821 pOILBitmap->Convert24To8(pPalette, NumberOfPaletteEntries); 00822 // If a problem has happened then we will forget the conversion and use the 00823 // 24 bpp version 00824 } 00825 00826 // Now check to see if this bitmap already exists .... 00827 Document* ImportDoc = ((Filter*)pFilter)->GetDocument(); 00828 if (ImportDoc == NULL) 00829 ImportDoc = Document::GetSelected(); 00830 00831 if (ImportDoc == NULL) 00832 { 00833 delete pOILBitmap; 00834 return FALSE; 00835 } 00836 00837 // The bitmap system relies on the Current Doc being correct, 00838 // so we'll set it to be on the safe side 00839 ImportDoc->SetCurrent(); 00840 00841 // Is there an existing KernelBitmap already in the bitmap list ? 00842 *ppImportedBitmap = TryAndUseExistingBitmap(pOILBitmap, ImportDoc, IsNew); 00843 00844 return (*ppImportedBitmap != NULL); 00845 }
|
|
To see if the palette attached to this bitmap is browser compatible.
Definition at line 1993 of file bitmap.cpp. 01994 { 01995 if (ActualBitmap != NULL) 01996 return ActualBitmap->IsBrowserPalette(); 01997 01998 return FALSE; 01999 }
|
|
To find out if the bitmap is the default bitmap or not. This is used by the native/web saving code to see if the bitmap is the default one and if so save a reference to it.
Definition at line 640 of file bitmap.cpp. 00641 { 00642 if (ActualBitmap == NULL) 00643 return FALSE; 00644 00645 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 00646 "Bitmap Error. Found a reference to a deleted bitmap."); 00647 00648 // Treat as the default bitmap, if we've been deleted 00649 if (HasBeenDeleted()) 00650 return TRUE; 00651 00652 // Check to see if its the default bitmap 00653 if (ActualBitmap == OILBitmap::Default) 00654 return TRUE; 00655 00656 return FALSE; 00657 }
|
|
Finds if this bitmap is greyscale or not.
Definition at line 1769 of file bitmap.cpp. 01770 { 01771 if (ActualBitmap == NULL) 01772 return FALSE; 01773 01774 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01775 "Bitmap Error. Found a reference to a deleted bitmap."); 01776 01777 if (HasBeenDeleted()) 01778 return OILBitmap::Default->IsGreyscale(); 01779 01780 return ActualBitmap->IsGreyscale(); 01781 }
|
|
Finds if this bitmap is lossy or not.
Definition at line 1794 of file bitmap.cpp. 01795 { 01796 if (ActualBitmap == NULL) 01797 return FALSE; 01798 01799 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01800 "Bitmap Error. Found a reference to a deleted bitmap."); 01801 01802 if (HasBeenDeleted()) 01803 return OILBitmap::Default->IsLossy(); 01804 01805 return ActualBitmap->IsLossy(); 01806 }
|
|
Tell if KernelBitmap is OK.
Definition at line 442 of file bitmap.cpp. 00443 { 00444 return ActualBitmap ? TRUE : FALSE; 00445 }
|
|
Determines if a bitmap is not totally opaque.
Definition at line 1072 of file bitmap.cpp. 01073 { 01074 if (ActualBitmap == NULL) 01075 return FALSE; 01076 01077 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01078 "Bitmap Error. Found a reference to a deleted bitmap."); 01079 01080 return ActualBitmap->IsTransparent(); 01081 }
|
|
Definition at line 608 of file bitmap.h. 00608 { return m_bUsedByBrush;}
|
|
Finds if this bitmap is being used in a specified document or not.
Definition at line 1745 of file bitmap.cpp. 01746 { 01747 if (ActualBitmap == NULL) 01748 return FALSE; 01749 01750 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01751 "Bitmap Error. Found a reference to a deleted bitmap."); 01752 01753 if (HasBeenDeleted()) 01754 return OILBitmap::Default->IsUsedInDocument(pDoc, bIncludeHidden); 01755 01756 return ActualBitmap->IsUsedInDocument(pDoc, bIncludeHidden) || IsXPEMaster(); 01757 }
|
|
Gets the XPE master status of this bitmap by searching the bitmap list.
Definition at line 1508 of file bitmap.cpp. 01509 { 01510 if (ActualBitmap) 01511 return ActualBitmap->IsXPEMaster(); 01512 return FALSE; 01513 }
|
|
Makes a KernelBitmap from an OIL bitmap. Will use an existing one if the OILBitmap is already in use in the Doc.
Definition at line 326 of file bitmap.cpp. 00327 { 00328 KernelBitmap* NewBitmap; 00329 00330 if (pBitmap == NULL) 00331 pBitmap = OILBitmap::Default; 00332 00333 if (pDoc == NULL) 00334 pDoc = Document::GetCurrent(); 00335 00336 // Get the bitmap list from the document 00337 BitmapList* BmpList = NULL; 00338 if (pDoc) BmpList = pDoc->GetBitmapList(); 00339 00340 if (BmpList == NULL) 00341 { 00342 // This shouldn't really happen ... 00343 NewBitmap = new KernelBitmap(pBitmap); 00344 return NewBitmap; 00345 } 00346 00347 KernelBitmap* Bmp = (KernelBitmap*)BmpList->GetHead(); 00348 BOOL Exists = FALSE; 00349 00350 // Scan through the Documents bitmap list to see if any of 00351 // the existing KernelBitmaps reference this OILBitmap. 00352 while (!bAlwaysNew && Bmp != NULL) 00353 { 00354 if (Bmp->ActualBitmap == pBitmap) 00355 { 00356 Exists = TRUE; 00357 break; 00358 } 00359 00360 Bmp = (KernelBitmap*)BmpList->GetNext(Bmp); 00361 } 00362 00363 if (Exists) 00364 { 00365 // Use the existing KernelBitmap. 00366 NewBitmap = Bmp; 00367 } 00368 else 00369 { 00370 // Make a new KernelBitmap. 00371 NewBitmap = new KernelBitmap(pBitmap); 00372 } 00373 00374 return NewBitmap; 00375 }
|
|
Assigns one KernelBitmap to another while maintaining usage count on OILBitmap.
Definition at line 508 of file bitmap.cpp. 00509 { 00510 if (other.ActualBitmap == NULL) 00511 ActualBitmap = OILBitmap::Attach( NULL ); 00512 else 00513 ActualBitmap = OILBitmap::Attach( other.ActualBitmap, other.ActualBitmap->IsTemp() ); 00514 00515 if (ActualBitmap && ActualBitmap->IsAFractal()) 00516 m_bFractalAttached = TRUE; 00517 00518 return *this; 00519 }
|
|
|
|
Plots an 8bpp (0..255) pixel to any type of bitmap The pixel is taken to be a greyscale, and is truncated or expanded as appropriate to fit the greyscale value into the destination bitmap pixel format.
Definition at line 756 of file bitmap.h. 00757 { 00758 ERROR3IF(ActualBitmap == NULL, "PlotPixel with no bitmap!"); 00759 ActualBitmap->PlotPixel(x, y, NewValue); 00760 }
|
|
Plots a 32bpp pixel to a deep bitmap (16, 24, or 32bpp).
Definition at line 722 of file bitmap.h. 00723 { 00724 ERROR3IF(ActualBitmap == NULL, "PlotPixel with no bitmap!"); 00725 ActualBitmap->PlotPixel(x, y, NewValue); 00726 }
|
|
reads a pixel
Definition at line 793 of file bitmap.h. 00794 { 00795 ERROR3IF(ActualBitmap == NULL, "PlotPixel with no bitmap!"); 00796 return(ActualBitmap->ReadPixel32bpp(x, y)); 00797 }
|
|
Reads a pixel as a greyscale intensity value (0..255).
In debug builds, will check all kinds of stuff, but in release builds, it assumes that you are providing legal offsets in the bitmap, and are only using this call where it will work - this is to reduce retail overhead on each pixel operation.
Definition at line 836 of file bitmap.h. 00837 { 00838 ERROR3IF(ActualBitmap == NULL, "PlotPixel with no bitmap!"); 00839 return(ActualBitmap->ReadPixelGreyscale(x, y)); 00840 }
|
|
Remove the OIL bitmap from memory if it can be constructed from master and edits.
Definition at line 1570 of file bitmap.cpp. 01571 { 01572 if (IsDefaultBitmap()) 01573 { 01574 // We can't replace the default bitmap so make a new OilBitmap and attach that 01575 CWxBitmap *pOilBitmap = new CWxBitmap(pInfo, pBits); 01576 if (pOilBitmap && IsLossy()) 01577 pOilBitmap->SetAsLossy(); 01578 ActualBitmap = OILBitmap::Attach(pOilBitmap); 01579 } 01580 else 01581 { 01582 ActualBitmap->ReplaceBitmap(pBits, pInfo); 01583 } 01584 }
|
|
Definition at line 801 of file bitmap.h. 00802 { 00803 ERROR3IF(ActualBitmap == NULL, "Can't do anything without a bitmap"); 00804 return(ActualBitmap->ReturnPaletteIndexUsed(x, y)); 00805 }
|
|
Sets the GIF restore type for an OilBitmap.
Definition at line 1904 of file bitmap.cpp. 01905 { 01906 if (ActualBitmap != NULL) 01907 ActualBitmap->SetAnimationRestoreType(Type); 01908 }
|
|
Set this bitmap as a fractal bitmap.
Definition at line 532 of file bitmap.cpp. 00533 { 00534 if (ActualBitmap == NULL) 00535 return FALSE; 00536 00537 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 00538 "Bitmap Error. Found a reference to a deleted bitmap."); 00539 00540 if (ActualBitmap) 00541 { 00542 m_bFractalAttached = TRUE; 00543 ActualBitmap->SetAsFractal(); 00544 00545 return TRUE; 00546 } 00547 00548 return FALSE; 00549 }
|
|
Set this bitmap as a greyscale bitmap This is used to inform the bitmap that it is a greyscale 8bpp bitmap. This is because when we create a grteyscale OILBitmap and attach a KernelBitmap to it, there is no way to indicate to the system that it's a true greyscale bitmap, which is necessary to stop it farting around and making a new copy of the bitmap when someone calls GetGreyscaleVersion(). This is used by the airbrush stroke provider when it generates a greyscale bitmap for use as a transparency mask.
Definition at line 575 of file bitmap.cpp. 00576 { 00577 if (ActualBitmap == NULL) 00578 return FALSE; 00579 00580 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 00581 "Bitmap Error. Found a reference to a deleted bitmap."); 00582 00583 ERROR3IF(GetBPP() != 8, "SetAsGreyscale - this isn't an 8bpp bitmap - how can it be a greyscale?"); 00584 00585 if (ActualBitmap) 00586 { 00587 ActualBitmap->SetAsGreyscale(); 00588 return TRUE; 00589 } 00590 00591 return FALSE; 00592 }
|
|
Set this bitmap' lossy flag.
Definition at line 608 of file bitmap.cpp. 00609 { 00610 if (ActualBitmap == NULL) 00611 return FALSE; 00612 00613 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 00614 "Bitmap Error. Found a reference to a deleted bitmap."); 00615 00616 if (ActualBitmap) 00617 { 00618 ActualBitmap->SetAsLossy(bLossy); 00619 return TRUE; 00620 } 00621 00622 return FALSE; 00623 }
|
|
Definition at line 499 of file bitmap.h. 00500 { 00501 s_pTrackerList = pList; 00502 }
|
|
Sets the m_AnimDelay memeber for an OilBitmap.
Definition at line 1836 of file bitmap.cpp. 01837 { 01838 if (ActualBitmap != NULL) 01839 ActualBitmap->SetBitmapAnimDelay(Delay); 01840 }
|
|
Sets the m_bInterpolation member for an OilBitmap.
Definition at line 1869 of file bitmap.cpp. 01870 { 01871 if (ActualBitmap != NULL) 01872 ActualBitmap->SetInterpolation(bInterpolation); 01873 }
|
|
Sets the left offset for an OilBitmap.
Definition at line 1921 of file bitmap.cpp. 01922 { 01923 if (ActualBitmap != NULL) 01924 ActualBitmap->SetLeftOffset(LeftOffset); 01925 }
|
|
Set information on this bitmap.
Definition at line 2074 of file bitmap.cpp. 02075 { 02076 if (ActualBitmap != NULL) 02077 { 02078 ActualBitmap->SetName(NewName); 02079 return; 02080 } 02081 02082 return; 02083 }
|
|
Sets the original bitmap file associated with this reference.
Definition at line 1362 of file bitmap.cpp. 01363 { 01364 if (ActualBitmap == NULL) 01365 return; 01366 01367 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01368 "Bitmap Error. Found a reference to a deleted bitmap."); 01369 01370 // The OILBitmap has the reference in it 01371 ActualBitmap->SetOriginalSource(pSource, pImportFilter); 01372 }
|
|
Sets the recommended height of the bitmap.
Definition at line 1158 of file bitmap.cpp. 01159 { 01160 if (ActualBitmap) 01161 ActualBitmap->SetRecommendedWidth(NewHeight); 01162 }
|
|
Sets the recommended width of the bitmap.
Definition at line 1141 of file bitmap.cpp. 01142 { 01143 if (ActualBitmap) 01144 ActualBitmap->SetRecommendedWidth(NewWidth); 01145 }
|
|
Sets the top offset for an OilBitmap.
Definition at line 1957 of file bitmap.cpp. 01958 { 01959 if (ActualBitmap != NULL) 01960 ActualBitmap->SetTopOffset(TopOffset); 01961 }
|
|
Finds the Transparent index colour of a bitmap if one exists.
Definition at line 1022 of file bitmap.cpp. 01023 { 01024 if (ActualBitmap == NULL) 01025 return FALSE; 01026 01027 ERROR3IF_OILBMP_PTR_INVALID(ActualBitmap, 01028 "Bitmap Error. Found a reference to a deleted bitmap."); 01029 01030 if (ActualBitmap->GetBPP() > 8) 01031 return FALSE; 01032 01033 return ActualBitmap->SetTransparencyIndex(Index); 01034 }
|
|
Definition at line 607 of file bitmap.h. 00607 { m_bUsedByBrush = Used;}
|
|
Sets the XPE edit list document for this bitmap.
Definition at line 1426 of file bitmap.cpp. 01427 { 01428 if (ActualBitmap) 01429 { 01430 OILBitmap* pOilMaster = NULL; 01431 if (pMasterBitmap) pOilMaster = pMasterBitmap->GetActualBitmap(); 01432 ActualBitmap->SetXPEInfo(pOilMaster, pNewEditList); 01433 } 01434 }
|
|
Imports a bitmap, and checks to see if the bitmap already exist, returning a pointer to the existing bitmap if possible, or creates a new one.
Definition at line 940 of file bitmap.cpp. 00942 { 00943 // Is IsNew is NULL, then we won't try and use an existing bitmap 00944 if (IsNew != NULL) 00945 { 00946 // Find this documents BitmapList 00947 BitmapList* pBmpList = pDoc->GetBitmapList(); 00948 00949 // Is there an existing KernelBitmap already in the bitmap list ? 00950 KernelBitmap* pExistingKBmp = pBmpList->FindDuplicateBitmap(pOILBitmap); 00951 00952 if (pExistingKBmp) 00953 { 00954 TRACEUSER( "Neville", _T("This bitmap already exists. Re-using existing KernelBitmap.\n") ); 00955 00956 // We'll use the one that's there already 00957 delete pOILBitmap; 00958 00959 *IsNew = FALSE; // We're using an existing Bitmap 00960 return pExistingKBmp; 00961 } 00962 00963 // There is no existing version in this document, 00964 // but there might be one in another document somewhere 00965 // so we'll have a look in the global list. 00966 00967 OILBitmap* pExistingBmp = 00968 GetApplication()->GetGlobalBitmapList()->FindDuplicateBitmap(pOILBitmap); 00969 00970 if (pExistingBmp) 00971 { 00972 TRACEUSER("Neville", _T("This bitmap already exists. Re-using existing OILBitmap.\n") ); 00973 00974 // There's already an existing OIL bitmap we can use, 00975 // so we'll make a new kernel bitmap out of it ... 00976 delete pOILBitmap; 00977 00978 KernelBitmap* KernelBmp = new KernelBitmap(pExistingBmp); 00979 if (KernelBmp == NULL) 00980 { 00981 return NULL; 00982 } 00983 00984 *IsNew = FALSE; // We're using an existing Bitmap 00985 00986 return KernelBmp; 00987 } 00988 } 00989 00990 TRACEUSER( "Neville", _T("This is a new bitmap\n") ); 00991 00992 BOOL Temp = FALSE; 00993 if (IsNew == NULL) 00994 Temp = TRUE; // mark it as temp 00995 00996 // We'll make a completely new bitmap then 00997 KernelBitmap* NewKernelBmp = new KernelBitmap(pOILBitmap, Temp); 00998 if (NewKernelBmp == NULL) 00999 { 01000 delete pOILBitmap; 01001 return NULL; 01002 } 01003 01004 if (IsNew) 01005 *IsNew = TRUE; // This is a new Bitmap 01006 01007 return NewKernelBmp; 01008 }
|
|
Exports the palette out to the file using the BaseCamelotFilter supplied. This means that it is being written to a web or native file. At present, used by the code when outputting an 8bpp JPEG to squirt the palette into the record so that we can convert it back to 8bpp using the palette on loading.
Definition at line 710 of file bitmap.cpp. 00711 { 00712 ERROR2IF(pFilter == NULL,FALSE,"KernelBitmap::WritePalette null pFilter"); 00713 00714 if (ActualBitmap == NULL) 00715 return FALSE; 00716 00717 return ActualBitmap->WritePalette(pFilter); 00718 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|