#include <fillval.h>
Inheritance diagram for BitmapTranspFillAttribute:
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 NodeAttribute * | MakeNode () |
Make a AttrFlatColourFill node from this flat fill colour attribute. | |
virtual void | SimpleCopy (AttributeValue *) |
See AttributeValue::SimpleCopy. | |
virtual FillGeometryAttribute & | operator= (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 KernelBitmapRef * | GetBitmapRef () |
virtual BOOL | AttachBitmap (KernelBitmap *pBitmap) |
Attaches a bitmap to this fill. | |
virtual BOOL | DetachBitmap () |
Detaches a bitmap from this fill. | |
virtual KernelBitmap * | GetBitmap () |
Get the bitmap referenced by this attribute. | |
virtual BOOL | CopyBitmap (KernelBitmap *) |
Used to copy a bitmap from one fill to another. | |
virtual DocCoord * | GetStartPoint () |
virtual DocCoord * | GetEndPoint () |
virtual DocCoord * | GetEndPoint2 () |
virtual DocCoord * | GetEndPoint3 () |
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 UINT32 * | GetStartTransp () |
Gets the Start transp of this fill. | |
virtual void | SetStartTransp (UINT32 *NewTransp) |
Sets the Start transp of this fill. | |
virtual UINT32 * | GetEndTransp () |
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 ColourFillAttribute * | MakeSimilarNonTranspFillGeometry (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 |
Definition at line 1312 of file fillval.h.
|
Default Constuctor for fill attribute values.
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 }
|
|
Destructor for bitmap fill attribute values.
Definition at line 5651 of file fillval.cpp.
|
|
Attaches a bitmap to this fill.
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 }
|
|
Used to copy a bitmap from one fill to another.
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 }
|
|
Detaches a bitmap from this fill.
Reimplemented from FillGeometryAttribute. Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute. Definition at line 5743 of file fillval.cpp.
|
|
Get the bitmap referenced by this attribute.
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 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1330 of file fillval.h. 01330 { return &BitmapRef; }
|
|
Gets the DPI of a Fractal bitmap.
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 }
|
|
Reimplemented from GradTranspFillAttribute. Definition at line 1338 of file fillval.h. 01338 { return &EndPoint; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1339 of file fillval.h. 01339 { return &EndPoint2; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1340 of file fillval.h. 01340 { return &EndPoint3; }
|
|
Gets the Start transp of this fill.
Reimplemented from GradTranspFillAttribute. Definition at line 6008 of file fillval.cpp. 06009 { 06010 return &EndTransp; 06011 }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute. Definition at line 1366 of file fillval.h. 01366 { return(FILLSHAPE_BITMAP); }
|
|
Reimplemented from GradTranspFillAttribute. Definition at line 1337 of file fillval.h. 01337 { return &StartPoint; }
|
|
Gets the Start transp of this fill.
Reimplemented from TranspFillAttribute. Definition at line 5992 of file fillval.cpp. 05993 { 05994 return &Transp; 05995 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1346 of file fillval.h. 01346 { return Tesselation; }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute. Definition at line 1362 of file fillval.h. 01362 { return TRUE; }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in NoiseTranspFillAttribute, and FractalTranspFillAttribute. Definition at line 1361 of file fillval.h. 01361 { return TRUE; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 1357 of file fillval.h. 01357 { return IsPersp; }
|
|
Make a AttrFlatColourFill node from this flat fill colour attribute.
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 }
|
|
Make the fill perspectived. This should be called just before it is transformed by the moulder, so it can validate the 4th control point.
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 }
|
|
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).
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 }
|
|
Make the Attribute the same as the other.
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 }
|
|
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
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 }
|
|
Removes perspective from this fill.
Reimplemented from FillGeometryAttribute. Definition at line 5938 of file fillval.cpp.
|
|
Sets the fill geometry attribute for the given render region. i.e. all paths filled will now be filled with this fill geometry.
Reimplemented from TranspFillAttribute. Definition at line 5795 of file fillval.cpp. 05796 { 05797 pRegion->SetTranspFillGeometry(this, Temp); 05798 }
|
|
Restores the fill type attribute for the given render region. i.e. all paths filled will now be filled with this fill attribute.
Reimplemented from TranspFillAttribute. Definition at line 5817 of file fillval.cpp. 05818 { 05819 pRegion->RestoreTranspFillGeometry(this, Temp); 05820 }
|
|
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 }
|
|
Sets the End Point of this fill.
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 }
|
|
Sets the End Point of this fill.
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 }
|
|
Sets the End Point of this fill.
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 }
|
|
Sets the Start transp of this fill.
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 }
|
|
Sets the Start Point of this fill.
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 }
|
|
Sets the Start transp of this fill.
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 }
|
|
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 }
|
|
See 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 }
|
|
|
|
|
|
|
|
|
|
|
|
|