CCachedBitmap Class Reference

#include <bitmapcache.h>

Inheritance diagram for CCachedBitmap:

CCObject SimpleCCObject List of all members.

Public Member Functions

 CCachedBitmap ()
 Computes the first prime number equal to or greater than a specified number.
 CCachedBitmap (LPBITMAPINFO pNewInfo, LPBYTE pNewBits, INT32 nNewPriority=0)
 CCachedBitmap (const CCachedBitmap &cbmp)
 CCachedBitmap (UINT32 Width, UINT32 Height, UINT32 Depth, DocRect rect, INT32 nNewPriority=0)
 ~CCachedBitmap ()
bool operator== (const CCachedBitmap &cbmp) const
const CCachedBitmapoperator= (const CCachedBitmap &cbmp)
void Release ()
CCachedBitmap Copy ()
void Transform (TransformBase &Trans)
DocRect GetCachedRect ()
void SetCachedRect (DocRect r)
void SetCachedParallelogram (DocCoord *pCoords, UINT32 numCoords)
BOOL IsValid () const
UINT32 GetBitmapSize () const
BOOL IsTransparent () const
UINT32 GetBPP () const

Public Attributes

LPBITMAPINFO pbmpInfo
LPBYTE pbmpBits
DocCoord coord0
DocCoord coord1
DocCoord coord2
INT32 nPriority
BOOL bFullCoverage

Detailed Description

Definition at line 115 of file bitmapcache.h.


Constructor & Destructor Documentation

CCachedBitmap::CCachedBitmap  ) 
 

Computes the first prime number equal to or greater than a specified number.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com> (from the Internet)
Date:
11/06/2004
Parameters:
number to start from [INPUTS]
- [OUTPUTS]
Returns:
prime number above the starting value

Errors: -

See also:
-

Definition at line 831 of file bitmapcache.cpp.

00832 {
00833     pbmpInfo = NULL;
00834     pbmpBits = NULL;
00835 //  rectCachedRect = DocRect(0,0,0,0);
00836     coord0 = DocCoord(0,0);
00837     coord1 = DocCoord(0,0);
00838     coord2 = DocCoord(0,0);
00839     nPriority = 0;
00840 }

CCachedBitmap::CCachedBitmap LPBITMAPINFO  pNewInfo,
LPBYTE  pNewBits,
INT32  nNewPriority = 0
 

Definition at line 842 of file bitmapcache.cpp.

00843 {
00844     pbmpInfo = pNewInfo;
00845     pbmpBits = pNewBits;
00846 //  rectCachedRect = DocRect(0,0,0,0);
00847     coord0 = DocCoord(0,0);
00848     coord1 = DocCoord(0,0);
00849     coord2 = DocCoord(0,0);
00850     nPriority = nNewPriority;
00851 }

CCachedBitmap::CCachedBitmap const CCachedBitmap cbmp  ) 
 

Definition at line 853 of file bitmapcache.cpp.

00854 {
00855     pbmpInfo = cbmp.pbmpInfo;
00856     pbmpBits = cbmp.pbmpBits;
00857 //  rectCachedRect = cbmp.rectCachedRect;
00858     coord0 = cbmp.coord0;
00859     coord1 = cbmp.coord1;
00860     coord2 = cbmp.coord2;
00861     nPriority = cbmp.nPriority;
00862 }

CCachedBitmap::CCachedBitmap UINT32  Width,
UINT32  Height,
UINT32  Depth,
DocRect  rect,
INT32  nNewPriority = 0
 

Definition at line 865 of file bitmapcache.cpp.

00866 {
00867     ENSURE(rect.IsValid(), "Attempt to create a cached bitmap with an invalid rectangle!");
00868     pbmpInfo = AllocDIB(Width, Height, Depth, &pbmpBits);
00869 //  rectCachedRect = rect;
00870     coord0 = DocCoord(rect.lo.x, rect.lo.y);
00871     coord1 = DocCoord(rect.hi.x, rect.lo.y);
00872     coord2 = DocCoord(rect.lo.x, rect.hi.y);
00873     nPriority = nNewPriority;
00874 }

CCachedBitmap::~CCachedBitmap  ) 
 

Definition at line 877 of file bitmapcache.cpp.

00878 {
00879 //  if (pbmpInfo && pbmpBits)                   DON'T DO THIS!!!
00880 //      DIBUtil::FreeDIB(pbmpInfo, pbmpBits);
00881     pbmpInfo = NULL;
00882     pbmpBits = NULL;
00883 }


Member Function Documentation

CCachedBitmap CCachedBitmap::Copy  ) 
 

Definition at line 923 of file bitmapcache.cpp.

00924 {
00925     CCachedBitmap copybmp(*this);
00926     INT32 lHRes = pbmpInfo->bmiHeader.biXPelsPerMeter;
00927     INT32 lVRes = pbmpInfo->bmiHeader.biYPelsPerMeter;
00928     DIBUtil::CopyBitmap(pbmpInfo, pbmpBits, &copybmp.pbmpInfo, &copybmp.pbmpBits);
00929     if (copybmp.pbmpInfo)
00930     {
00931         copybmp.pbmpInfo->bmiHeader.biXPelsPerMeter = lHRes;
00932         copybmp.pbmpInfo->bmiHeader.biYPelsPerMeter = lVRes;
00933     }
00934     return copybmp;
00935 }

UINT32 CCachedBitmap::GetBitmapSize  )  const
 

Definition at line 1030 of file bitmapcache.cpp.

01031 {
01032     return (pbmpInfo->bmiHeader.biSizeImage);
01033 }

UINT32 CCachedBitmap::GetBPP  )  const
 

Definition at line 1072 of file bitmapcache.cpp.

01073 {
01074     return (pbmpInfo->bmiHeader.biBitCount);
01075 }

DocRect CCachedBitmap::GetCachedRect  ) 
 

Definition at line 1115 of file bitmapcache.cpp.

01116 {
01117     DocRect r(coord0, coord0);
01118     r.IncludePoint(coord1);
01119     r.IncludePoint(coord2);
01120     r.IncludePoint(DocCoord(coord2.x+coord1.x-coord0.x, coord2.y+coord1.y-coord0.y));
01121 
01122     return r;
01123 }

BOOL CCachedBitmap::IsTransparent  )  const
 

Definition at line 1051 of file bitmapcache.cpp.

01052 {
01053     return (pbmpInfo->bmiHeader.biCompression!=BI_RGB);
01054 }

BOOL CCachedBitmap::IsValid  )  const
 

Definition at line 1009 of file bitmapcache.cpp.

01010 {
01011     return (pbmpInfo!=NULL && pbmpBits!=NULL);
01012 }

const CCachedBitmap & CCachedBitmap::operator= const CCachedBitmap cbmp  ) 
 

Definition at line 983 of file bitmapcache.cpp.

00984 {
00985     pbmpInfo = cbmp.pbmpInfo;
00986     pbmpBits = cbmp.pbmpBits;
00987 //  rectCachedRect = cbmp.rectCachedRect;
00988     coord0 = cbmp.coord0;
00989     coord1 = cbmp.coord1;
00990     coord2 = cbmp.coord2;
00991     nPriority = cbmp.nPriority;
00992     return cbmp;
00993 }

bool CCachedBitmap::operator== const CCachedBitmap cbmp  )  const
 

Definition at line 954 of file bitmapcache.cpp.

00955 {
00956     return (pbmpInfo == cbmp.pbmpInfo &&
00957             pbmpBits == cbmp.pbmpBits &&
00958 //          rectCachedRect == cbmp.rectCachedRect &&
00959             coord0 == cbmp.coord0 &&
00960             coord1 == cbmp.coord1 &&
00961             coord2 == cbmp.coord2 &&
00962             nPriority == cbmp.nPriority
00963             );
00964 }

void CCachedBitmap::Release  ) 
 

Definition at line 902 of file bitmapcache.cpp.

00903 {
00904     FreeDIB(pbmpInfo, pbmpBits);
00905 }

void CCachedBitmap::SetCachedParallelogram DocCoord pCoords,
UINT32  numCoords
 

Definition at line 1164 of file bitmapcache.cpp.

01165 {
01166     coord0 = pCoords[0];
01167     coord1 = pCoords[1];
01168     coord2 = pCoords[2];
01169 }

void CCachedBitmap::SetCachedRect DocRect  r  ) 
 

Definition at line 1141 of file bitmapcache.cpp.

01142 {
01143     coord0 = r.lo;
01144     coord1 = DocCoord(r.hi.x, r.lo.y);
01145     coord2 = DocCoord(r.lo.x, r.hi.y);
01146 }

void CCachedBitmap::Transform TransformBase Trans  ) 
 

Definition at line 1093 of file bitmapcache.cpp.

01094 {
01095 //  Trans.Transform((DocCoord*)&rectCachedRect, 2);
01096     Trans.Transform(&coord0, 3);
01097 }


Member Data Documentation

BOOL CCachedBitmap::bFullCoverage
 

Definition at line 147 of file bitmapcache.h.

DocCoord CCachedBitmap::coord0
 

Definition at line 143 of file bitmapcache.h.

DocCoord CCachedBitmap::coord1
 

Definition at line 144 of file bitmapcache.h.

DocCoord CCachedBitmap::coord2
 

Definition at line 145 of file bitmapcache.h.

INT32 CCachedBitmap::nPriority
 

Definition at line 146 of file bitmapcache.h.

LPBYTE CCachedBitmap::pbmpBits
 

Definition at line 141 of file bitmapcache.h.

LPBITMAPINFO CCachedBitmap::pbmpInfo
 

Definition at line 140 of file bitmapcache.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:51:59 2007 for Camelot by  doxygen 1.4.4