BitmapTranspFillAttribute Class Reference

Specifies a bitmap fill attribute for an object. More...

#include <fillval.h>

Inheritance diagram for BitmapTranspFillAttribute:

GradTranspFillAttribute TranspFillAttribute FillGeometryAttribute AttributeValue CCObject SimpleCCObject FractalTranspFillAttribute NoiseTranspFillAttribute List of all members.

Public Member Functions

 BitmapTranspFillAttribute ()
 Default Constuctor for fill attribute values.
 ~BitmapTranspFillAttribute ()
 Destructor for bitmap fill attribute values.
virtual void Restore (RenderRegion *, BOOL)
 Restores the fill type attribute for the given render region. i.e. all paths filled will now be filled with this fill attribute.
virtual void Render (RenderRegion *, BOOL Temp=FALSE)
 Sets the fill geometry attribute for the given render region. i.e. all paths filled will now be filled with this fill geometry.
virtual NodeAttributeMakeNode ()
 Make a AttrFlatColourFill node from this flat fill colour attribute.
virtual void SimpleCopy (AttributeValue *)
 See AttributeValue::SimpleCopy.
virtual FillGeometryAttributeoperator= (FillGeometryAttribute &Attrib)
 Make the Attribute the same as the other.
virtual INT32 operator== (const FillGeometryAttribute &Attrib)
 A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
virtual KernelBitmapRefGetBitmapRef ()
virtual BOOL AttachBitmap (KernelBitmap *pBitmap)
 Attaches a bitmap to this fill.
virtual BOOL DetachBitmap ()
 Detaches a bitmap from this fill.
virtual KernelBitmapGetBitmap ()
 Get the bitmap referenced by this attribute.
virtual BOOL CopyBitmap (KernelBitmap *)
 Used to copy a bitmap from one fill to another.
virtual DocCoordGetStartPoint ()
virtual DocCoordGetEndPoint ()
virtual DocCoordGetEndPoint2 ()
virtual DocCoordGetEndPoint3 ()
virtual void SetStartPoint (DocCoord *Pos)
 Sets the Start Point of this fill.
virtual void SetEndPoint (DocCoord *Pos)
 Sets the End Point of this fill.
virtual void SetEndPoint2 (DocCoord *Pos)
 Sets the End Point of this fill.
virtual void SetEndPoint3 (DocCoord *Pos)
 Sets the End Point of this fill.
virtual INT32 GetTesselation ()
virtual void SetTesselation (INT32 NewTess)
virtual UINT32 GetDPI ()
 Gets the DPI of a Fractal bitmap.
virtual BOOL SetDPI (UINT32 NewDpi)
virtual UINT32GetStartTransp ()
 Gets the Start transp of this fill.
virtual void SetStartTransp (UINT32 *NewTransp)
 Sets the Start transp of this fill.
virtual UINT32GetEndTransp ()
 Gets the Start transp of this fill.
virtual void SetEndTransp (UINT32 *NewTransp)
 Sets the Start transp of this fill.
virtual BOOL IsPerspective ()
virtual void MakePerspective ()
 Make the fill perspectived. This should be called just before it is transformed by the moulder, so it can validate the 4th control point.
virtual void RemovePerspective ()
 Removes perspective from this fill.
virtual BOOL IsAKindOfBitmapFill ()
virtual BOOL IsABitmapFill ()
virtual ColourFillAttributeMakeSimilarNonTranspFillGeometry (double TransparencyScale)
 Creates a non-transparent version of this transparent fill attribute. (The original use of this was so airbrushes could maintain their fill's transparency geometry).
virtual INT32 GetGeometryShape ()

Public Attributes

KernelBitmapRef BitmapRef
DocCoord EndPoint2
DocCoord EndPoint3
INT32 Tesselation
BOOL IsPersp

Static Public Attributes

static BOOL m_doBitmapSmoothing = TRUE

Detailed Description

Specifies a bitmap fill attribute for an object.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/9/94
See also:
FillGeometryAttribute

Definition at line 1312 of file fillval.h.


Constructor & Destructor Documentation

BitmapTranspFillAttribute::BitmapTranspFillAttribute  ) 
 

Default Constuctor for fill attribute values.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/9/94
See also:
AttrFillGeometry::AttrFillGeometry

Definition at line 5626 of file fillval.cpp.

05627 {
05628     Transp = EndTransp = 0;
05629 
05630     StartPoint = DocCoord(0,0);
05631     EndPoint   = DocCoord(0,0);
05632     EndPoint2  = DocCoord(0,0);
05633     EndPoint3  = DocCoord(0,0);
05634 
05635     Tesselation = RT_Repeating;
05636 
05637     IsPersp = FALSE;
05638 }

BitmapTranspFillAttribute::~BitmapTranspFillAttribute  ) 
 

Destructor for bitmap fill attribute values.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/9/94
See also:
AttrFillGeometry::AttrFillGeometry

Definition at line 5651 of file fillval.cpp.

05652 {
05653 }


Member Function Documentation

BOOL BitmapTranspFillAttribute::AttachBitmap KernelBitmap NewBitmap  )  [virtual]
 

Attaches a bitmap to this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/9/94
See also:
BitmapTranspFillAttribute::DetachBitmap()

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 5724 of file fillval.cpp.

05725 {
05726     BitmapRef.Detach();
05727     BitmapRef.Attach(NewBitmap);
05728 
05729     return TRUE;
05730 }

BOOL BitmapTranspFillAttribute::CopyBitmap KernelBitmap BmpToCopy  )  [virtual]
 

Used to copy a bitmap from one fill to another.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/9/94
See also:
BitmapTranspFillAttribute::AttachBitmap()

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 5761 of file fillval.cpp.

05762 {
05763     if (BmpToCopy != NULL)  // Is there a bitmap to copy ?
05764     {
05765         BitmapRef.Detach();
05766 
05767         OILBitmap* Bmp = BmpToCopy->ActualBitmap;
05768         if (Bmp->IsTemp())
05769         {
05770             BitmapRef.SetBitmap(BmpToCopy);
05771             return FALSE;
05772         }
05773 
05774         BitmapRef.Attach(BmpToCopy);
05775     }
05776 
05777     return TRUE;
05778 }

BOOL BitmapTranspFillAttribute::DetachBitmap  )  [virtual]
 

Detaches a bitmap from this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/9/94
See also:
BitmapTranspFillAttribute::AttachBitmap()

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 5743 of file fillval.cpp.

05744 {
05745     BitmapRef.Detach();
05746 
05747     return FALSE;
05748 }

KernelBitmap * BitmapTranspFillAttribute::GetBitmap void   )  [virtual]
 

Get the bitmap referenced by this attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/12/94
See also:
BitmapTranspFillAttribute::AttachBitmap()

Reimplemented from FillGeometryAttribute.

Definition at line 5694 of file fillval.cpp.

05695 {
05696     KernelBitmap* pBitmap = BitmapRef.GetBitmap();
05697     
05698     // Check for a deleted bitmap
05699     if (pBitmap && pBitmap->HasBeenDeleted())
05700     {
05701         ERROR2IF(pBitmap->GetParentBitmapList() == NULL, NULL, "Deleted bitmap has no parent list");
05702         
05703         // Use the default bitmap instead
05704         pBitmap = pBitmap->GetParentBitmapList()->FindDefaultBitmap();
05705 
05706         // There should always be a default bitmap in the list
05707         ERROR2IF(pBitmap == NULL, 0L, "Couldn't find the default bitmap");
05708     }
05709 
05710     return pBitmap;
05711 }

virtual KernelBitmapRef* BitmapTranspFillAttribute::GetBitmapRef  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1330 of file fillval.h.

01330 { return &BitmapRef; }

UINT32 BitmapTranspFillAttribute::GetDPI  )  [virtual]
 

Gets the DPI of a Fractal bitmap.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/10/94
Returns:
The current DPI of the fractal.
See also:
FractalFillAttribute::SetDPI

Reimplemented from FillGeometryAttribute.

Definition at line 6197 of file fillval.cpp.

06198 {
06199     UINT32 Dpi = 0;
06200 
06201     KernelBitmap* KerBM = GetBitmap();
06202     if (KerBM == NULL)
06203         return 0;
06204 
06205     OILBitmap *OilBM = KerBM->ActualBitmap;
06206 
06207     if (OilBM != NULL)
06208     {
06209         BitmapInfo Info;
06210         OilBM->GetInfo(&Info);
06211 
06212         INT32 PixWidth  = Info.PixelWidth;
06213         INT32 PixHeight = Info.PixelHeight;
06214 
06215         DocCoord Start = *GetStartPoint();
06216         DocCoord End   = *GetEndPoint();
06217         DocCoord End2  = *GetEndPoint2();
06218 
06219         INT32 Width  = INT32(Start.Distance(End));
06220         INT32 Height = INT32(Start.Distance(End2));
06221 
06222         UINT32 HDpi = 0;
06223         UINT32 VDpi = 0;
06224 
06225         if (Width > 0)
06226             HDpi = (PixWidth*72000)/Width;
06227 
06228         if (Height > 0)
06229             VDpi = (PixHeight*72000)/Height;
06230 
06231         Dpi = HDpi;
06232         if (VDpi < Dpi)
06233             Dpi = VDpi;
06234     }
06235 
06236     return Dpi;
06237 }

virtual DocCoord* BitmapTranspFillAttribute::GetEndPoint  )  [inline, virtual]
 

Reimplemented from GradTranspFillAttribute.

Definition at line 1338 of file fillval.h.

01338 { return &EndPoint; }

virtual DocCoord* BitmapTranspFillAttribute::GetEndPoint2  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1339 of file fillval.h.

01339 { return &EndPoint2; }

virtual DocCoord* BitmapTranspFillAttribute::GetEndPoint3  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1340 of file fillval.h.

01340 { return &EndPoint3; }

UINT32 * BitmapTranspFillAttribute::GetEndTransp  )  [virtual]
 

Gets the Start transp of this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
Parameters:
- [INPUTS]

Reimplemented from GradTranspFillAttribute.

Definition at line 6008 of file fillval.cpp.

06009 {
06010     return &EndTransp;
06011 }

virtual INT32 BitmapTranspFillAttribute::GetGeometryShape  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 1366 of file fillval.h.

01366 { return(FILLSHAPE_BITMAP); }

virtual DocCoord* BitmapTranspFillAttribute::GetStartPoint  )  [inline, virtual]
 

Reimplemented from GradTranspFillAttribute.

Definition at line 1337 of file fillval.h.

01337 { return &StartPoint; }

UINT32 * BitmapTranspFillAttribute::GetStartTransp  )  [virtual]
 

Gets the Start transp of this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
Parameters:
- [INPUTS]

Reimplemented from TranspFillAttribute.

Definition at line 5992 of file fillval.cpp.

05993 {
05994     return &Transp;
05995 }

virtual INT32 BitmapTranspFillAttribute::GetTesselation  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1346 of file fillval.h.

01346 { return Tesselation; }

virtual BOOL BitmapTranspFillAttribute::IsABitmapFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 1362 of file fillval.h.

01362 { return TRUE; }

virtual BOOL BitmapTranspFillAttribute::IsAKindOfBitmapFill  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 1361 of file fillval.h.

01361 { return TRUE; }

virtual BOOL BitmapTranspFillAttribute::IsPerspective  )  [inline, virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 1357 of file fillval.h.

01357 { return IsPersp; }

NodeAttribute * BitmapTranspFillAttribute::MakeNode  )  [virtual]
 

Make a AttrFlatColourFill node from this flat fill colour attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/8/94
Returns:
Pointer to the new node, or NULL if out of memory.

Errors: Out of memory

See also:
AttributeValue::MakeNode; AttrFlatColourFill

Reimplemented from AttributeValue.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 5668 of file fillval.cpp.

05669 {
05670     // Create new attribute node
05671     AttrBitmapFill *pAttr = new AttrBitmapTranspFill;
05672     if (pAttr==NULL)
05673         // error message has already been set by new
05674         return NULL;
05675 
05676     // Copy attribute value into the new node.
05677     pAttr->GetAttributeValue()->SimpleCopy(this);
05678 
05679     // Return the new node
05680     return pAttr;
05681 }

void BitmapTranspFillAttribute::MakePerspective  )  [virtual]
 

Make the fill perspectived. This should be called just before it is transformed by the moulder, so it can validate the 4th control point.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/4/94
Parameters:
- [INPUTS]

Reimplemented from FillGeometryAttribute.

Definition at line 5913 of file fillval.cpp.

05914 {
05915     IsPersp = TRUE;
05916 
05917     INT32 dx1 = EndPoint.x - StartPoint.x;
05918     INT32 dx2 = EndPoint2.x - StartPoint.x;
05919 
05920     INT32 dy1 = EndPoint.y - StartPoint.y;
05921     INT32 dy2 = EndPoint2.y - StartPoint.y;
05922 
05923     DocCoord Pos3(StartPoint.x + dx1 + dx2, StartPoint.y + dy1 + dy2);
05924     SetEndPoint3(&Pos3);
05925 }

ColourFillAttribute * BitmapTranspFillAttribute::MakeSimilarNonTranspFillGeometry double  TransparencyScale  )  [virtual]
 

Creates a non-transparent version of this transparent fill attribute. (The original use of this was so airbrushes could maintain their fill's transparency geometry).

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/02/97
Parameters:
TransparencyScale - Value between 0.0 and 1.0 which denotes by how much [INPUTS] the function will scale the transparency
Returns:
Pointer to the new attribute, or NULL if out of memory, problems, etc.
See also:
TranspFillAttribute::MakeSimilarNonTranspFillGeometry; AttrFlatFill FlatTranspFillAttribute::MakeSimilarNonTranspFillGeometry

Reimplemented from GradTranspFillAttribute.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 6268 of file fillval.cpp.

06269 {
06270     UINT32 *pStartTransp = GetStartTransp();
06271     UINT32 *pEndTransp = GetEndTransp();
06272 
06273     if(pStartTransp == NULL || pEndTransp == NULL)
06274         return NULL;
06275     
06276     BitmapFillAttribute *pNewAttr = new BitmapFillAttribute;    
06277     if (pNewAttr != NULL)
06278     {
06279         pNewAttr->SetStartPoint(GetStartPoint());
06280         pNewAttr->SetEndPoint(GetEndPoint());
06281         pNewAttr->SetEndPoint2(GetEndPoint2());
06282         pNewAttr->SetEndPoint3(GetEndPoint3());
06283 
06284         pNewAttr->SetTesselation(GetTesselation());
06285         pNewAttr->SetDPI(GetDPI());
06286         if(IsPerspective())
06287             pNewAttr->MakePerspective();
06288 
06289         pNewAttr->AttachBitmap(GetBitmap());
06290 
06291         INT32 StartTransparency = 255 - (INT32)(((double)(255 - *pStartTransp)) * TransparencyScale);
06292         INT32 EndTransparency = 255 - (INT32)(((double)(255 - *pEndTransp)) * TransparencyScale);
06293 
06294         DocColour       colorStart(StartTransparency, StartTransparency, StartTransparency);
06295         DocColour       colorEnd1(EndTransparency, EndTransparency, EndTransparency);
06296         pNewAttr->SetStartColour(&colorStart);
06297         pNewAttr->SetEndColour(&colorEnd1);
06298     }
06299 
06300     return(pNewAttr);
06301 }

FillGeometryAttribute & BitmapTranspFillAttribute::operator= FillGeometryAttribute FillAttrib  )  [virtual]
 

Make the Attribute the same as the other.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/8/94
Parameters:
FillAttrib - the attribute to copy, which must be an AttrFillGeometry [INPUTS]
Returns:
Usual semantics for equality.

Errors: An ENSURE failure will occur if Attrib does not have a AttrFlatGeometry runtime class.

See also:
AttrFillGeometry::operator==; NodeAttribute::operator==

Reimplemented from GradTranspFillAttribute.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 6028 of file fillval.cpp.

06029 {
06030 //  Bitmap = FillAttrib.Bitmap;
06031 
06032     return TranspFillAttribute::operator=(FillAttrib);
06033 }

INT32 BitmapTranspFillAttribute::operator== const FillGeometryAttribute Attrib  )  [virtual]
 

A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
Attrib - the attribute to compare, which must be an AttrFillGeometry [INPUTS]
Returns:
Usual semantics for equality.

Errors: An ENSURE failure will occur if Attrib does not have a AttrFlatGeometry runtime class.

See also:
NodeAttribute::operator==

Reimplemented from GradTranspFillAttribute.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 6051 of file fillval.cpp.

06052 {
06053     if (GetRuntimeClass() != Attrib.GetRuntimeClass())
06054         return FALSE;
06055 
06056     BitmapTranspFillAttribute* pAttrib = (BitmapTranspFillAttribute*)&Attrib;
06057 
06058     if (GetBitmapRef()->GetBitmap() != pAttrib->GetBitmapRef()->GetBitmap())
06059         return FALSE;
06060 
06061     if (IsPerspective())
06062     { 
06063         if (!pAttrib->IsPerspective())
06064             return FALSE;
06065 
06066         if (*GetEndPoint3() != *pAttrib->GetEndPoint3())
06067             return FALSE;
06068     }
06069 
06070     // check the transparency ramp matches
06071     if (!SameTransparencyRampAs(pAttrib->GetTranspRamp()))
06072         return FALSE;
06073 
06074     // Are the Colours and Control points all the same ?
06075     return (
06076         
06077         Transp      == pAttrib->Transp      &&
06078         EndTransp   == pAttrib->EndTransp   &&
06079 
06080         TranspType  == pAttrib->TranspType  &&
06081     
06082         StartPoint  == pAttrib->StartPoint  &&
06083         EndPoint    == pAttrib->EndPoint    &&
06084         EndPoint2   == pAttrib->EndPoint2
06085 
06086     );
06087 }

void BitmapTranspFillAttribute::RemovePerspective  )  [virtual]
 

Removes perspective from this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/4/94
Parameters:
- [INPUTS]

Reimplemented from FillGeometryAttribute.

Definition at line 5938 of file fillval.cpp.

05939 {
05940     IsPersp = FALSE;
05941 }

void BitmapTranspFillAttribute::Render RenderRegion pRegion,
BOOL  Temp = FALSE
[virtual]
 

Sets the fill geometry attribute for the given render region. i.e. all paths filled will now be filled with this fill geometry.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pRegion - the render region to render this attribute into. [INPUTS]
See also:
BitmapFillAttribute; RenderStack; AttributeValue; NodeAttribute; BitmapFillAttribute::Restore; BitmapFillAttribute::SimpleCopy; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Reimplemented from TranspFillAttribute.

Definition at line 5795 of file fillval.cpp.

05796 {
05797     pRegion->SetTranspFillGeometry(this, Temp);
05798 }

void BitmapTranspFillAttribute::Restore RenderRegion pRegion,
BOOL  Temp
[virtual]
 

Restores the fill type attribute for the given render region. i.e. all paths filled will now be filled with this fill attribute.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pRegion - the render region to restore the attribute into. [INPUTS] Temp - TRUE if this is a temporary attribute, FALSE if it is permanent (e.g. it's in a document tree).
See also:
BitmapFillAttribute; RenderStack; AttributeValue; NodeAttribute; BitmapFillAttribute::Render; BitmapFillAttribute::SimpleCopy; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Reimplemented from TranspFillAttribute.

Definition at line 5817 of file fillval.cpp.

05818 {
05819     pRegion->RestoreTranspFillGeometry(this, Temp);
05820 }

BOOL BitmapTranspFillAttribute::SetDPI UINT32  NewDpi  )  [virtual]
 

Reimplemented from FillGeometryAttribute.

Definition at line 6108 of file fillval.cpp.

06109 {
06110     if (IsPerspective())
06111         return FALSE;
06112 
06113     if (NewDpi == 0)
06114         return FALSE;
06115 
06116     if (GetBitmap() == NULL)
06117         return FALSE;
06118 
06119     OILBitmap *OilBM = GetBitmap()->ActualBitmap;
06120 
06121     if (OilBM == NULL)
06122         return FALSE;
06123 
06124     BitmapInfo Info;
06125     OilBM->GetInfo(&Info);
06126 
06127     INT32 PixWidth  = Info.PixelWidth;
06128     INT32 PixHeight = Info.PixelHeight;
06129 
06130     DocCoord Start = *GetStartPoint();
06131     DocCoord End   = *GetEndPoint();
06132     DocCoord End2  = *GetEndPoint2();
06133 
06134     INT32 Width  = INT32(Start.Distance(End));
06135     INT32 Height = INT32(Start.Distance(End2));
06136 
06137     INT32 HDpi = (Width  == 0) ? 0 : (PixWidth*72000)/Width;
06138     INT32 VDpi = (Height == 0) ? 0 : (PixHeight*72000)/Height;
06139 
06140     INT32 OldDpi = HDpi;
06141     if (VDpi < OldDpi)
06142         OldDpi = VDpi;
06143 
06144     TRACEUSER( "Mike", _T("Bitmap Dpi is currently %d\n"),OldDpi);
06145     TRACEUSER( "Mike", _T("Setting Bitmap Dpi to %d\n"),NewDpi);
06146 
06147     FIXED16 Ratio   = FIXED16(double(OldDpi)/double(NewDpi));
06148     Matrix Scale    = Matrix(Ratio, Ratio);
06149 
06150     GetBitmapVirtualPoints(Start, End, End2,
06151                             &Start, &End, &End2);
06152 
06153     DocCoord Centre = Start;
06154 
06155     Start.translate(-Centre.x, -Centre.y);  
06156     Scale.transform(&Start);
06157     Start.translate(Centre.x, Centre.y);    
06158 
06159     End.translate(-Centre.x, -Centre.y);    
06160     Scale.transform(&End);
06161     End.translate(Centre.x, Centre.y);  
06162 
06163     End2.translate(-Centre.x, -Centre.y);   
06164     Scale.transform(&End2);
06165     End2.translate(Centre.x, Centre.y); 
06166 
06167     GetBitmapRealPoints(Start, End, End2,
06168                         &Start, &End, &End2);
06169 
06170     INT32 NewWidth  = INT32(Start.Distance(End));
06171     INT32 NewHeight = INT32(Start.Distance(End2));
06172 
06173     if (NewWidth == 0 || NewHeight == 0)
06174         return FALSE;
06175 
06176     SetStartPoint(&Start);
06177     SetEndPoint(&End);
06178     SetEndPoint2(&End2);
06179 
06180     SetFractalDPI(GetDPI());
06181 
06182     return TRUE;
06183 }

void BitmapTranspFillAttribute::SetEndPoint DocCoord Pos  )  [virtual]
 

Sets the End Point of this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
Parameters:
- [INPUTS]

Reimplemented from GradTranspFillAttribute.

Definition at line 5852 of file fillval.cpp.

05853 {
05854     if (Pos == NULL)
05855         EndPoint = DocCoord(0,0);
05856     else
05857         EndPoint = *Pos;
05858 }

void BitmapTranspFillAttribute::SetEndPoint2 DocCoord Pos  )  [virtual]
 

Sets the End Point of this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
Parameters:
- [INPUTS]

Reimplemented from FillGeometryAttribute.

Definition at line 5871 of file fillval.cpp.

05872 {
05873     if (Pos == NULL)
05874         EndPoint2 = MakeLineAtAngle(*GetStartPoint(), *GetEndPoint(), 90);
05875     else
05876         EndPoint2 = *Pos;
05877 }

void BitmapTranspFillAttribute::SetEndPoint3 DocCoord Pos  )  [virtual]
 

Sets the End Point of this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
Parameters:
- [INPUTS]

Reimplemented from FillGeometryAttribute.

Definition at line 5890 of file fillval.cpp.

05891 {
05892     if (Pos == NULL)
05893         EndPoint3 = MakeLineAtAngle(*GetEndPoint(), *GetEndPoint2(), 90);
05894     else
05895         EndPoint3 = *Pos;
05896 }

void BitmapTranspFillAttribute::SetEndTransp UINT32 NewTransp  )  [virtual]
 

Sets the Start transp of this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
Parameters:
- [INPUTS]

Reimplemented from GradTranspFillAttribute.

Definition at line 5973 of file fillval.cpp.

05974 {
05975     if (NewTransp == NULL)
05976         EndTransp = 255;
05977     else
05978         EndTransp = *NewTransp;
05979 }

void BitmapTranspFillAttribute::SetStartPoint DocCoord Pos  )  [virtual]
 

Sets the Start Point of this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
Parameters:
- [INPUTS]

Reimplemented from GradTranspFillAttribute.

Definition at line 5833 of file fillval.cpp.

05834 {
05835     if (Pos == NULL)
05836         StartPoint = DocCoord(0,0);
05837     else
05838         StartPoint = *Pos;
05839 }

void BitmapTranspFillAttribute::SetStartTransp UINT32 NewTransp  )  [virtual]
 

Sets the Start transp of this fill.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/9/94
Parameters:
- [INPUTS]

Reimplemented from TranspFillAttribute.

Definition at line 5954 of file fillval.cpp.

05955 {
05956     if (NewTransp == NULL)
05957         Transp = 0;
05958     else
05959         Transp = *NewTransp;
05960 }

void BitmapTranspFillAttribute::SetTesselation INT32  NewTess  )  [virtual]
 

Reimplemented from FillGeometryAttribute.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 6239 of file fillval.cpp.

06240 {
06241     if (NewTess == RT_NoRepeatType)
06242         NewTess = RT_Repeating;
06243 
06244     Tesselation = NewTess;
06245 }

void BitmapTranspFillAttribute::SimpleCopy AttributeValue pValue  )  [virtual]
 

See AttributeValue::SimpleCopy.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/8/94
Parameters:
pAttr - pointer to the AttributeValue to copy. [INPUTS]
See also:
GradFillAttribute; RenderStack; AttributeValue; NodeAttribute; AttributeValue::Render; AttributeValue::Restore; AttributeValue::SimpleCopy

Reimplemented from GradTranspFillAttribute.

Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute.

Definition at line 6102 of file fillval.cpp.

06103 {
06104     // Just use the assignment operator
06105     *this = *(FillGeometryAttribute*)pValue;
06106 }


Member Data Documentation

KernelBitmapRef BitmapTranspFillAttribute::BitmapRef
 

Definition at line 1328 of file fillval.h.

DocCoord BitmapTranspFillAttribute::EndPoint2
 

Definition at line 1369 of file fillval.h.

DocCoord BitmapTranspFillAttribute::EndPoint3
 

Definition at line 1370 of file fillval.h.

BOOL BitmapTranspFillAttribute::IsPersp
 

Definition at line 1374 of file fillval.h.

BOOL BitmapTranspFillAttribute::m_doBitmapSmoothing = TRUE [static]
 

Definition at line 1376 of file fillval.h.

INT32 BitmapTranspFillAttribute::Tesselation
 

Definition at line 1372 of file fillval.h.


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