KernelBitmap Class Reference

To encapsulate bitmaps, which are implemented in the OIL layer. Kernel code is only allowed to use this interface. OIL code is allowed to use the specific OILy functions that can be done via the OILBitmap pointer. More...

#include <bitmap.h>

Inheritance diagram for KernelBitmap:

ListItem CCObject SimpleCCObject List of all members.

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 &)
KernelBitmapoperator= (const KernelBitmap &)
 Assigns one KernelBitmap to another while maintaining usage count on OILBitmap.
OILBitmapGetActualBitmap () 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).
BitmapListGetParentBitmapList ()
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.
OILBitmapGetGreyscaleVersion (BOOL ForceGreyBmp=FALSE)
 Gets the greyscale version of this bitmap.
OILBitmapExtractOILBitmap ()
 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_256GetName ()
 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 KernelBitmapMakeKernelBitmap (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 KernelBitmapTryAndUseExistingBitmap (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

OILBitmapActualBitmap

Static Public Attributes

static Lists_pTrackerList = NULL

Protected Attributes

BitmapListm_pParentList
BOOL m_bDontDeleteActualBitmap: 1
BOOL m_bFractalAttached: 1
BOOL m_bUsedByBrush: 1

Friends

class BitmapList

Detailed Description

To encapsulate bitmaps, which are implemented in the OIL layer. Kernel code is only allowed to use this interface. OIL code is allowed to use the specific OILy functions that can be done via the OILBitmap pointer.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/8/94

Definition at line 483 of file bitmap.h.


Constructor & Destructor Documentation

KernelBitmap::KernelBitmap OILBitmap pBitmap = NULL,
BOOL  IsTemp = FALSE
 

Constructor for kernel bitmaps. Attaches to the OILBitmap and increases its usage count.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
?/8/94
Parameters:
Pointer to an OIL bitmap. If NULL then uses default built-in bitmap. [INPUTS]
Returns:
Errors: -
See also:
KernelBitmap::IsOK;OILBitmap::Attach

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 }

KernelBitmap::KernelBitmap const KernelBitmap other  ) 
 

Copy constructor for kernel bitmaps. MAintains usage count on OILBitmap.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
?/8/94
Parameters:
Another kernel bitmap. [INPUTS]
See also:
KernelBitmap::IsOK;OILBitmap::Attach

Definition at line 390 of file bitmap.cpp.

KernelBitmap::KernelBitmap UINT32  Width,
UINT32  Height,
UINT32  Depth,
UINT32  dpi,
BOOL  bTemp = 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).

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
?/8/94
Parameters:
Bitmap pxiel width, height & depth and dpi setting. [INPUTS]
Returns:
Errors: Possible - SetError will be called, use IsOK for result.
See also:
KernelBitmap::IsOK;OILBitmap::Create

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 }

KernelBitmap::~KernelBitmap  ) 
 

Destructor. Detaches any current OILBitmap.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
?/8/94
See also:
OILBitmap::Detach

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 }


Member Function Documentation

BOOL KernelBitmap::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.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/07/97
Parameters:
pLogPalette A log palette to check the palette against [INPUTS] TransColour The transparent colour in the palette
Returns:
True if the bitmap has the same palette as the LOG palette.

Definition at line 2017 of file bitmap.cpp.

02018 {
02019     if (ActualBitmap != NULL)
02020         return ActualBitmap->ArePalettesTheSame(pLogPalette, TransColour);
02021 
02022     return FALSE;   
02023 }

void KernelBitmap::Attach BitmapList BmpList = NULL  ) 
 

Adds this kernel bitmap to the specified document bitmap list.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/94
Parameters:
The bitmap list to attach this bitmap to. [INPUTS] if NULL then the bitmap is Re-Attached to its old list.
- [OUTPUTS]
Returns:
Errors: -
See also:
-

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 }

BOOL KernelBitmap::Convert24To8 RGBTRIPLE pPalette,
UINT32  NumberOfPaletteEntries
[virtual]
 

Converts the OILbitmap from its present 24bpp form into an 8bpp form which should closely match the one that was exported.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/9/96
Parameters:
pPalette - pointer to the palette in RGBTIPLE format to use when converting [INPUTS] NumberOfPaletteEntries - entries in this palette
- [OUTPUTS]
Returns:
True if worked ok, False otherwise

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 }

BOOL KernelBitmap::CreateGreyscaleVersion BOOL  ForceGreyBmp = FALSE  ) 
 

Creates a greyscale version of this bitmap.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96

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 }

BOOL KernelBitmap::DestroyGreyscaleVersion  ) 
 

Destroys the greyscale version of this bitmap.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96

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 }

BOOL KernelBitmap::DestroyXPEInfo  )  [virtual]
 

Aks the user whether he wants to destroy XPE info.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/01/2004
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if this bitmap has no XPE info or the user agreed it could be destroyed FALSE otherwise

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 }

void KernelBitmap::Detach  ) 
 

Removes this kernel bitmap from it's current document bitmap list.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
Errors: -
See also:
-

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 }

OILBitmap * KernelBitmap::ExtractOILBitmap  ) 
 

Extracts the OILBitmap from this kernel bitmap AND DELETES THIS KERNEL BITMAP.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96

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 }

void KernelBitmap::GenerateGreyscaleTable  ) 
 

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96

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 }

OILBitmap* KernelBitmap::GetActualBitmap  )  const [inline]
 

Definition at line 508 of file bitmap.h.

00508 { return ActualBitmap; }

GIFDisposalMethod KernelBitmap::GetAnimationRestoreType  )  const
 

Returns the GIF restore type for an OilBitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/04/97

Definition at line 1885 of file bitmap.cpp.

01886 {
01887     if (ActualBitmap != NULL)
01888         return ActualBitmap->GetAnimationRestoreType();
01889 
01890     return GDM_LEAVE;   
01891 }

ADDR KernelBitmap::GetBitmapBits  )  const
 

Helper function to get the actual bits (as in Bitmap).

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/11/96
Returns:
The address of the bits of this KernelBitmap NULL if an error occurred

Errors: Checks runtime class

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 }

LPBITMAPINFO KernelBitmap::GetBitmapInfo  ) 
 

To get at the BITMAPINFO that this bitmap may have.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/07/97
Returns:
The BITMAPINFO for this bitmap or null.
BITMAPINFO consists of:- BITMAPINFOHEADER bmiHeader; RGBQUAD bmiColors[1]; This is the real bitmap info header giving the overall size of the export

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 }

LPBITMAPINFOHEADER KernelBitmap::GetBitmapInfoHeader  ) 
 

To get at the BITMAPINFOHEADER that this bitmap should have.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/07/97
Returns:
The bitmap header for this bitmap or null.
BITMAPINFO consists of:- BITMAPINFOHEADER bmiHeader; RGBQUAD bmiColors[1];

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 }

UINT32 KernelBitmap::GetBPP  ) 
 

Finds the colour resolution of this bitmap.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/1/95
Returns:
The number of Bits per pixel of this bitmap

Errors: -

See also:
-

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 }

UINT32 KernelBitmap::GetDelay  ) 
 

Returns m_AnimDelay for an OilBitmap.

Author:
Ranbir_Rana (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/01/96

Definition at line 1818 of file bitmap.cpp.

01819 {
01820     if (ActualBitmap != NULL)
01821         return ActualBitmap->GetBitmapAnimDelay();
01822 
01823     return 0;   
01824 }

OILBitmap * KernelBitmap::GetGreyscaleVersion BOOL  ForceGreyBmp = FALSE  ) 
 

Gets the greyscale version of this bitmap.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/8/96

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 }

UINT32 KernelBitmap::GetHeight  )  const
 

Finds the height of this bitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/7/97
Returns:
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 }

UINT32 KernelBitmap::GetHorizontalDPI  )  const
 

Retrieve information on this bitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/06/97
Returns:
The Horizontal DPI of this bitmap

Definition at line 2036 of file bitmap.cpp.

02037 {
02038     if (ActualBitmap != NULL)
02039         return ActualBitmap->GetHorizontalDPI();
02040 
02041     return 96;  
02042 }

BOOL KernelBitmap::GetInterpolation  ) 
 

Returns m_bInterpolation for an OilBitmap.

Author:
Andy_Hills (Xara Group Ltd) <camelotdev@xara.com>
Date:
06/10/00

Definition at line 1851 of file bitmap.cpp.

01852 {
01853     if (ActualBitmap != NULL)
01854         return ActualBitmap->GetInterpolation();
01855 
01856     return 0;   
01857 }

UINT32 KernelBitmap::GetLeftOffset  )  const
 

Gets the left offset for an OilBitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/06/97
Returns:
the current left offset

Definition at line 1938 of file bitmap.cpp.

01939 {
01940     if (ActualBitmap != NULL)
01941         return ActualBitmap->GetLeftOffset();
01942 
01943     return 0;   
01944 }

String_256 & KernelBitmap::GetName  ) 
 

Retrieve information on this bitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/06/97
Returns:
The name of 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 }   

UINT32 KernelBitmap::GetNumPaletteEntries  )  const
 

Finds the number of colours colour in this bitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/7/97
Returns:
The number of palette entries of this bitmap

Definition at line 1339 of file bitmap.cpp.

01340 {
01341     if (ActualBitmap == NULL)
01342         return 0;
01343 
01344     return ActualBitmap->GetNumPaletteEntries();
01345 }

BOOL KernelBitmap::GetOriginalSource BitmapSource **  pSource = NULL,
BaseBitmapFilter **  ppImportFilter = NULL
 

Gets the original bitmap file buffer associated with this reference.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/8/96
Parameters:
pSource,ptr to a void ptr to update to point at the original BitmapSource [INPUTS] ppFilterName, ptr to a BaseBitmapFilter ptr to update to point at the filter to use to decode the bitmap
If both these inputs are NULL, then the function will simply return whether an original file exists or not.

Parameters:
The input pointers are set if an original file is available, otherwise they [OUTPUTS] are left unchanged.
Returns:
TRUE, if an original file is available, and the pointers were set if non NULL. FALSE, if no orginal files is available.

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 }

LPRGBQUAD KernelBitmap::GetPaletteForBitmap  ) 
 

To get at the RGBQUAD palette that this bitmap may have.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
03/07/97
Returns:
The palette for this bitmap or null.
BITMAPINFO consists of:- BITMAPINFOHEADER bmiHeader; RGBQUAD bmiColors[1]; This is the real bitmap info header giving the overall size of the export

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 }

BitmapList* KernelBitmap::GetParentBitmapList  )  [inline]
 

Definition at line 538 of file bitmap.h.

00538 { return m_pParentList; }

INT32 KernelBitmap::GetRecommendedHeight  ) 
 

Finds the recommended height of the bitmap.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/6/96
Returns:
The current recommended height of the bitmap in Millipoints

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 }

INT32 KernelBitmap::GetRecommendedWidth  ) 
 

Finds the recommended width of the bitmap.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/6/96
Returns:
The current recommended width of the bitmap in Millipoints

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 }

UINT32 KernelBitmap::GetTopOffset  )  const
 

Gets the top offset for an OilBitmap.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/06/97
Returns:
the current top offset

Definition at line 1974 of file bitmap.cpp.

01975 {
01976     if (ActualBitmap != NULL)
01977         return ActualBitmap->GetTopOffset();