#include <fillval.h>
Inheritance diagram for BitmapFillAttribute:
Public Member Functions | |
BitmapFillAttribute () | |
Default Constuctor for fill attribute values. | |
~BitmapFillAttribute () | |
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 BOOL | RenderFill (RenderRegion *, Path *) |
Render the fill, if possible - it depends on what kind of render region we have been given. | |
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 void | SetStartColour (DocColour *) |
Sets the start colour of this fill. | |
virtual void | SetEndColour (DocColour *) |
Sets the end colour of this fill. | |
virtual DocColour * | GetStartColour () |
Gets the Start colour of this fill. | |
virtual DocColour * | GetEndColour () |
Gets the End colour of this fill. | |
virtual INT32 | GetTesselation () |
virtual void | SetTesselation (INT32 NewTess) |
virtual BOOL | SetDPI (UINT32 NewDpi) |
Sets the DPI of a bitmap. | |
virtual UINT32 | GetDPI () |
Gets the DPI of a bitmap. | |
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 () |
BOOL | CanBlurRenderBitmap () |
void | SetCanBlurRenderBitmap (BOOL b) |
virtual INT32 | GetGeometryShape () |
Public Attributes | |
KernelBitmapRef | BitmapRef |
DocCoord | EndPoint2 |
DocCoord | EndPoint3 |
INT32 | Tesselation |
BOOL | IsPersp |
BOOL | m_CanBlurRender |
Static Public Attributes | |
static BOOL | m_doBitmapSmoothing = TRUE |
Definition at line 755 of file fillval.h.
|
Default Constuctor for fill attribute values.
Definition at line 2211 of file fillval.cpp. 02212 { 02213 Colour = DocColour(COLOUR_NONE); 02214 EndColour = DocColour(COLOUR_NONE); 02215 02216 StartPoint = DocCoord(0,0); 02217 EndPoint = DocCoord(0,0); 02218 EndPoint2 = DocCoord(0,0); 02219 02220 Tesselation = RT_Repeating; 02221 02222 IsPersp = FALSE; 02223 02224 m_CanBlurRender = TRUE; 02225 }
|
|
Destructor for bitmap fill attribute values.
Definition at line 2238 of file fillval.cpp.
|
|
Attaches a bitmap to this fill.
Reimplemented from FillGeometryAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2317 of file fillval.cpp.
|
|
Definition at line 811 of file fillval.h. 00811 { return m_CanBlurRender; }
|
|
Used to copy a bitmap from one fill to another.
Reimplemented from FillGeometryAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2353 of file fillval.cpp. 02354 { 02355 if (BmpToCopy != NULL) // Is there a bitmap to copy ? 02356 { 02357 BitmapRef.Detach(); 02358 02359 OILBitmap* Bmp = BmpToCopy->ActualBitmap; 02360 if (Bmp->IsTemp()) 02361 { 02362 BitmapRef.SetBitmap(BmpToCopy); 02363 return TRUE; 02364 } 02365 02366 BitmapRef.Attach(BmpToCopy); 02367 } 02368 02369 return TRUE; 02370 }
|
|
Detaches a bitmap from this fill.
Reimplemented from FillGeometryAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2335 of file fillval.cpp.
|
|
Get the bitmap referenced by this attribute.
Reimplemented from FillGeometryAttribute. Definition at line 2287 of file fillval.cpp. 02288 { 02289 KernelBitmap* pBitmap = BitmapRef.GetBitmap(); 02290 02291 // Check for a deleted bitmap 02292 if (pBitmap && pBitmap->HasBeenDeleted()) 02293 { 02294 ERROR2IF(pBitmap->GetParentBitmapList() == NULL, NULL, "Deleted bitmap has no parent list"); 02295 02296 // Use the default bitmap instead 02297 pBitmap = pBitmap->GetParentBitmapList()->FindDefaultBitmap(); 02298 02299 // There should always be a default bitmap in the list 02300 ERROR2IF(pBitmap == NULL, 0L, "Couldn't find the default bitmap"); 02301 } 02302 02303 return pBitmap; 02304 }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 2242 of file fillval.cpp. 02243 { 02244 return &BitmapRef; 02245 }
|
|
Gets the DPI of a bitmap.
Reimplemented from FillGeometryAttribute. Definition at line 2785 of file fillval.cpp. 02786 { 02787 UINT32 Dpi = 0; 02788 02789 if (GetBitmap() == NULL) 02790 return 0; 02791 02792 OILBitmap *OilBM = GetBitmap()->ActualBitmap; 02793 02794 if (OilBM != NULL) 02795 { 02796 BitmapInfo Info; 02797 OilBM->GetInfo(&Info); 02798 02799 INT32 PixWidth = Info.PixelWidth; 02800 INT32 PixHeight = Info.PixelHeight; 02801 02802 DocCoord Start = *GetStartPoint(); 02803 DocCoord End = *GetEndPoint(); 02804 DocCoord End2 = *GetEndPoint2(); 02805 02806 INT32 Width = INT32(Start.Distance(End)); 02807 INT32 Height = INT32(Start.Distance(End2)); 02808 02809 UINT32 HDpi = 0; 02810 UINT32 VDpi = 0; 02811 02812 if (Width > 0) 02813 HDpi = (PixWidth*72000)/Width; 02814 02815 if (Height > 0) 02816 VDpi = (PixHeight*72000)/Height; 02817 02818 Dpi = HDpi; 02819 if (VDpi < Dpi) 02820 Dpi = VDpi; 02821 } 02822 02823 return Dpi; 02824 }
|
|
Gets the End colour of this fill.
Reimplemented from GradFillAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2924 of file fillval.cpp. 02925 { 02926 if (EndColour == COLOUR_NONE) 02927 return NULL; 02928 else 02929 return &EndColour; 02930 }
|
|
Reimplemented from GradFillAttribute. Definition at line 782 of file fillval.h. 00782 { return &EndPoint; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 783 of file fillval.h. 00783 { return &EndPoint2; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 784 of file fillval.h. 00784 { return &EndPoint3; }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 814 of file fillval.h. 00814 { return(FILLSHAPE_BITMAP); }
|
|
Gets the Start colour of this fill.
Reimplemented from ColourFillAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2905 of file fillval.cpp. 02906 { 02907 if (Colour == COLOUR_NONE) 02908 return NULL; 02909 else 02910 return &Colour; 02911 }
|
|
Reimplemented from GradFillAttribute. Definition at line 781 of file fillval.h. 00781 { return &StartPoint; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 796 of file fillval.h. 00796 { return Tesselation; }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 807 of file fillval.h. 00807 { return TRUE; }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 806 of file fillval.h. 00806 { return TRUE; }
|
|
Reimplemented from FillGeometryAttribute. Definition at line 802 of file fillval.h. 00802 { return IsPersp; }
|
|
Make a AttrFlatColourFill node from this flat fill colour attribute.
Reimplemented from AttributeValue. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2260 of file fillval.cpp. 02261 { 02262 // Create new attribute node 02263 AttrBitmapFill *pAttr = new AttrBitmapColourFill; 02264 if (pAttr==NULL) 02265 // error message has already been set by new 02266 return NULL; 02267 02268 // Copy attribute value into the new node. 02269 pAttr->GetAttributeValue()->SimpleCopy(this); 02270 02271 // Return the new node 02272 return pAttr; 02273 }
|
|
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 2506 of file fillval.cpp. 02507 { 02508 IsPersp = TRUE; 02509 02510 INT32 dx1 = EndPoint.x - StartPoint.x; 02511 INT32 dx2 = EndPoint2.x - StartPoint.x; 02512 02513 INT32 dy1 = EndPoint.y - StartPoint.y; 02514 INT32 dy2 = EndPoint2.y - StartPoint.y; 02515 02516 DocCoord Pos3(StartPoint.x + dx1 + dx2, StartPoint.y + dy1 + dy2); 02517 SetEndPoint3(&Pos3); 02518 }
|
|
Make the Attribute the same as the other.
Reimplemented from GradFillAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2548 of file fillval.cpp. 02549 { 02550 return ColourFillAttribute::operator=(FillAttrib); 02551 }
|
|
A virtual comparison operator. See NodeAttribute::operator== for a description of why it's required.
Reimplemented from GradFillAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2569 of file fillval.cpp. 02570 { 02571 if (GetRuntimeClass() != Attrib.GetRuntimeClass()) 02572 return FALSE; 02573 02574 BitmapFillAttribute* pAttrib = (BitmapFillAttribute*)&Attrib; 02575 02576 if (GetBitmapRef()->GetBitmap() != pAttrib->GetBitmapRef()->GetBitmap()) 02577 return FALSE; 02578 02579 if (IsPerspective()) 02580 { 02581 if (!pAttrib->IsPerspective()) 02582 return FALSE; 02583 02584 if (*GetEndPoint3() != *pAttrib->GetEndPoint3()) 02585 return FALSE; 02586 } 02587 02588 if (GetStartColour() != NULL) 02589 { 02590 if (pAttrib->GetStartColour() == NULL) 02591 return FALSE; 02592 02593 if (*GetStartColour() != *pAttrib->GetStartColour()) 02594 return FALSE; 02595 } 02596 else if (pAttrib->GetStartColour() != NULL) 02597 { 02598 return FALSE; 02599 } 02600 02601 if (GetEndColour() != NULL) 02602 { 02603 if (pAttrib->GetEndColour() == NULL) 02604 return FALSE; 02605 02606 if (*GetEndColour() != *pAttrib->GetEndColour()) 02607 return FALSE; 02608 } 02609 else if (pAttrib->GetStartColour() != NULL) 02610 { 02611 return FALSE; 02612 } 02613 02614 // check the colour ramps match 02615 if (!SameColourRampAs(pAttrib->GetColourRamp())) 02616 return FALSE; 02617 02618 // Are the Colours and Control points all the same ? 02619 return ( 02620 02621 StartPoint == pAttrib->StartPoint && 02622 EndPoint == pAttrib->EndPoint && 02623 EndPoint2 == pAttrib->EndPoint2 02624 02625 ); 02626 }
|
|
Removes perspective from this fill.
Reimplemented from FillGeometryAttribute. Definition at line 2531 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 ColourFillAttribute. Definition at line 2388 of file fillval.cpp. 02389 { 02390 pRegion->SetFillGeometry(this, Temp); 02391 }
|
|
Render the fill, if possible - it depends on what kind of render region we have been given.
Reimplemented from GradFillAttribute. Definition at line 2661 of file fillval.cpp. 02662 { 02663 if ( pRegion->IsKindOf(CC_RUNTIME_CLASS(GRenderRegion)) ) 02664 { 02665 // Safe to cast now 02666 GRenderRegion *gRnd = (GRenderRegion*)pRegion; 02667 02668 // Do the rendering 02669 return gRnd->RenderBitmapFill(pPath, this); 02670 } 02671 else if ( pRegion->IsKindOf(CC_RUNTIME_CLASS(OSRenderRegion)) ) 02672 { 02673 // Safe to cast now 02674 OSRenderRegion *oRnd = (OSRenderRegion*)pRegion; 02675 02676 // Do the rendering 02677 return oRnd->RenderBitmapFill(pPath, this); 02678 } 02679 02680 // Can't render this fill with this render region. 02681 return FALSE; 02682 }
|
|
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 ColourFillAttribute. Definition at line 2410 of file fillval.cpp. 02411 { 02412 pRegion->RestoreFillGeometry(this, Temp); 02413 }
|
|
Definition at line 812 of file fillval.h. 00812 { m_CanBlurRender = b; }
|
|
Sets the DPI of a bitmap.
Reimplemented from FillGeometryAttribute. Definition at line 2696 of file fillval.cpp. 02697 { 02698 if (IsPerspective()) 02699 return FALSE; 02700 02701 if (NewDpi == 0) 02702 return FALSE; 02703 02704 if (GetBitmap() == NULL) 02705 return FALSE; 02706 02707 OILBitmap *OilBM = GetBitmap()->ActualBitmap; 02708 02709 if (OilBM == NULL) 02710 return FALSE; 02711 02712 BitmapInfo Info; 02713 OilBM->GetInfo(&Info); 02714 02715 INT32 PixWidth = Info.PixelWidth; 02716 INT32 PixHeight = Info.PixelHeight; 02717 02718 DocCoord Start = *GetStartPoint(); 02719 DocCoord End = *GetEndPoint(); 02720 DocCoord End2 = *GetEndPoint2(); 02721 02722 INT32 Width = INT32(Start.Distance(End)); 02723 INT32 Height = INT32(Start.Distance(End2)); 02724 02725 INT32 HDpi = (Width == 0) ? 0 : (PixWidth*72000)/Width; 02726 INT32 VDpi = (Height == 0) ? 0 : (PixHeight*72000)/Height; 02727 02728 INT32 OldDpi = HDpi; 02729 if (VDpi < OldDpi) 02730 OldDpi = VDpi; 02731 02732 TRACEUSER( "Mike", _T("Bitmap Dpi is currently %d\n"),OldDpi); 02733 TRACEUSER( "Mike", _T("Setting Bitmap Dpi to %d\n"),NewDpi); 02734 02735 FIXED16 Ratio = FIXED16(double(OldDpi)/double(NewDpi)); 02736 Matrix Scale = Matrix(Ratio, Ratio); 02737 02738 GetBitmapVirtualPoints(Start, End, End2, 02739 &Start, &End, &End2); 02740 02741 DocCoord Centre = Start; 02742 02743 Start.translate(-Centre.x, -Centre.y); 02744 Scale.transform(&Start); 02745 Start.translate(Centre.x, Centre.y); 02746 02747 End.translate(-Centre.x, -Centre.y); 02748 Scale.transform(&End); 02749 End.translate(Centre.x, Centre.y); 02750 02751 End2.translate(-Centre.x, -Centre.y); 02752 Scale.transform(&End2); 02753 End2.translate(Centre.x, Centre.y); 02754 02755 GetBitmapRealPoints(Start, End, End2, 02756 &Start, &End, &End2); 02757 02758 INT32 NewWidth = INT32(Start.Distance(End)); 02759 INT32 NewHeight = INT32(Start.Distance(End2)); 02760 02761 if (NewWidth == 0 || NewHeight == 0) 02762 return FALSE; 02763 02764 SetStartPoint(&Start); 02765 SetEndPoint(&End); 02766 SetEndPoint2(&End2); 02767 02768 SetFractalDPI(GetDPI()); 02769 02770 return TRUE; 02771 }
|
|
Sets the end colour of this fill.
Reimplemented from GradFillAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2871 of file fillval.cpp. 02872 { 02873 if (NewCol == NULL) 02874 EndColour = COLOUR_NONE; 02875 else 02876 EndColour = *NewCol; 02877 02878 if (EndColour == COLOUR_NONE) 02879 Colour = COLOUR_NONE; 02880 02881 if (EndColour != COLOUR_NONE && GetStartColour() == NULL) 02882 { 02883 AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(), 02884 _R(IDS_BLACKNAME), &Colour); 02885 02886 if (Colour == EndColour) 02887 { 02888 AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(), 02889 _R(IDS_WHITENAME), &Colour); 02890 } 02891 } 02892 }
|
|
Sets the End Point of this fill.
Reimplemented from GradFillAttribute. Definition at line 2445 of file fillval.cpp. 02446 { 02447 if (Pos == NULL) 02448 EndPoint = DocCoord(0,0); 02449 else 02450 EndPoint = *Pos; 02451 }
|
|
Sets the End Point of this fill.
Reimplemented from FillGeometryAttribute. Definition at line 2464 of file fillval.cpp. 02465 { 02466 if (Pos == NULL) 02467 EndPoint2 = MakeLineAtAngle(*GetStartPoint(), *GetEndPoint(), 90); 02468 else 02469 EndPoint2 = *Pos; 02470 }
|
|
Sets the End Point of this fill.
Reimplemented from FillGeometryAttribute. Definition at line 2483 of file fillval.cpp. 02484 { 02485 if (Pos == NULL) 02486 EndPoint3 = MakeLineAtAngle(*GetEndPoint(), *GetEndPoint2(), 90); 02487 else 02488 EndPoint3 = *Pos; 02489 }
|
|
Sets the start colour of this fill.
Reimplemented from ColourFillAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2837 of file fillval.cpp. 02838 { 02839 if (NewCol == NULL) 02840 Colour = COLOUR_NONE; 02841 else 02842 Colour = *NewCol; 02843 02844 if (Colour == COLOUR_NONE) 02845 EndColour = COLOUR_NONE; 02846 02847 if (Colour != COLOUR_NONE && GetEndColour() == NULL) 02848 { 02849 AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(), 02850 _R(IDS_WHITENAME), &EndColour); 02851 02852 if (Colour == EndColour) 02853 { 02854 AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(), 02855 _R(IDS_BLACKNAME), &EndColour); 02856 } 02857 } 02858 }
|
|
Sets the Start Point of this fill.
Reimplemented from GradFillAttribute. Definition at line 2426 of file fillval.cpp. 02427 { 02428 if (Pos == NULL) 02429 StartPoint = DocCoord(0,0); 02430 else 02431 StartPoint = *Pos; 02432 }
|
|
Reimplemented from FillGeometryAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2932 of file fillval.cpp. 02933 { 02934 if (NewTess == RT_NoRepeatType) 02935 NewTess = RT_Repeating; 02936 02937 Tesselation = NewTess; 02938 }
|
|
See AttributeValue::SimpleCopy.
Reimplemented from GradFillAttribute. Reimplemented in NoiseFillAttribute, and FractalFillAttribute. Definition at line 2641 of file fillval.cpp. 02642 { 02643 // Just use the assignment operator 02644 *this = *(FillGeometryAttribute*)pValue; 02645 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|