#include <fillval.h>
Inheritance diagram for StrokeTranspAttribute:
Public Member Functions | |
StrokeTranspAttribute () | |
StrokeTranspAttribute (UINT32 NewTransp) | |
Sets the line transparency for this attribute. | |
virtual NodeAttribute * | MakeNode () |
Make a AttrStrokeTransp node from this fill colour attribute. | |
virtual void | Restore (RenderRegion *, BOOL) |
Restores the line colour attribute for the given render region. i.e. all lines drawn will now be drawn in this colour. | |
virtual void | Render (RenderRegion *, BOOL Temp=FALSE) |
Sets the line colour attribute for the given render region. i.e. all lines drawn will now be drawn in this colour. | |
virtual void | SimpleCopy (AttributeValue *) |
See AttributeValue::SimpleCopy. | |
BOOL | Blend (BlendAttrParam *) |
Blends between two fill attributes. This is a general blend function for all fill attributes. It will blend between any types of fill, but will always use the 'type' of the first fill, taking control points, colours, and transparency from the end fill if it can. | |
Static Public Member Functions | |
static BOOL | Init () |
Registers line colour attribute, and provides a default attribute to give black lines. |
Definition at line 1888 of file fillval.h.
|
Definition at line 1892 of file fillval.h.
|
|
Sets the line transparency for this attribute.
Definition at line 8724 of file fillval.cpp. 08725 { 08726 SetStartTransp(&NewTransp); 08727 }
|
|
Blends between two fill attributes. This is a general blend function for all fill attributes. It will blend between any types of fill, but will always use the 'type' of the first fill, taking control points, colours, and transparency from the end fill if it can.
Reimplemented from FillGeometryAttribute. Definition at line 9841 of file fillval.cpp. 09842 { 09843 // First make a new object of the same type as this one 09844 CCRuntimeClass* ObjectType = GetRuntimeClass(); 09845 FillGeometryAttribute* pNewAttr = (FillGeometryAttribute*)ObjectType->CreateObject(); 09846 09847 if (pNewAttr == NULL) 09848 { 09849 // Fail if we couldn't create the new fill 09850 pBlendParam->SetBlendedAttrVal(NULL); 09851 return FALSE; 09852 } 09853 09854 // Make the new fill an exact copy of this one 09855 pNewAttr->SimpleCopy(this); 09856 09857 // Now get the fill that we are blending to 09858 FillGeometryAttribute* OtherFill = 09859 (FillGeometryAttribute*)pBlendParam->GetOtherAttrVal(); 09860 09861 // and what point along the blend we are at 09862 double Ratio = pBlendParam->GetBlendRatio(); 09863 09864 // Look at the Start and Attribute maps to see if either end 09865 // is no colour 09866 CCAttrMap* pAttrMapStart = pBlendParam->GetStartAttrMap(); 09867 CCAttrMap* pAttrMapEnd = pBlendParam->GetEndAttrMap(); 09868 09869 CCRuntimeClass *pType; 09870 void *pVal = NULL; 09871 09872 // We're looking for Stroke Colour Attributes 09873 pType = CC_RUNTIME_CLASS(AttrStrokeColour); 09874 09875 // Lookup the Start Line Colour 09876 pAttrMapStart->Lookup( pType, pVal ); 09877 if (pVal == NULL) 09878 return FALSE; 09879 09880 AttrStrokeColour * pStartColour = (AttrStrokeColour *)pVal; 09881 StrokeColourAttribute * pColourAttr = &(pStartColour->Value); 09882 09883 BOOL StartIsNoColour = pColourAttr->Colour.IsTransparent(); 09884 09885 pVal = NULL; 09886 09887 // Lookup the End Line Colour 09888 pAttrMapEnd->Lookup(pType,pVal); 09889 if (pVal == NULL) 09890 return FALSE; 09891 09892 AttrStrokeColour * pEndColour = (AttrStrokeColour *)pVal; 09893 pColourAttr = &(pEndColour->Value); 09894 09895 BOOL EndIsNoColour = pColourAttr->Colour.IsTransparent(); 09896 09897 // Blend the Start and End Transparencies 09898 UINT32 BlendTransp, BlendStartTransp, BlendEndTransp; 09899 09900 // If either end if 'No Colour' then treat it as 100% transparent 09901 BlendStartTransp = (StartIsNoColour && !EndIsNoColour) ? 255 : *GetStartTransp(); 09902 BlendEndTransp = (EndIsNoColour && !StartIsNoColour) ? 255 : *OtherFill->GetStartTransp(); 09903 09904 if (BlendFillTransp(&BlendStartTransp, &BlendEndTransp, &BlendTransp, Ratio, pBlendParam)) 09905 pNewAttr->SetStartTransp(&BlendTransp); 09906 09907 // Set the new fill as the blended attribute 09908 pBlendParam->SetBlendedAttrVal(pNewAttr); 09909 09910 return TRUE; 09911 }
|
|
Registers line colour attribute, and provides a default attribute to give black lines.
Reimplemented from TranspFillAttribute. Definition at line 8830 of file fillval.cpp. 08831 { 08832 // Default to black lines 08833 StrokeTranspAttribute *pAttr = new StrokeTranspAttribute; 08834 if (pAttr == NULL) 08835 return FALSE; 08836 08837 pAttr->Transp = 0; 08838 UINT32 ID = AttributeManager::RegisterDefaultAttribute(CC_RUNTIME_CLASS(NodeRenderableInk), 08839 pAttr); 08840 ERROR2IF(ID == ATTR_BAD_ID, FALSE, "Bad ID when Initialising StrokeTranspAttribute"); 08841 ERROR2IF(ID != ATTR_STROKETRANSP, FALSE, "Incorrect ID for StrokeTranspAttribute"); 08842 08843 return TRUE; 08844 }
|
|
Make a AttrStrokeTransp node from this fill colour attribute.
Reimplemented from AttributeValue. Definition at line 8784 of file fillval.cpp. 08785 { 08786 // Create new attribute node 08787 AttrStrokeTransp *pAttr = new AttrStrokeTransp(); 08788 08789 // Copy attribute value into the new node. 08790 pAttr->Value.SimpleCopy(this); 08791 08792 // Return the new node 08793 return pAttr; 08794 }
|
|
Sets the line colour attribute for the given render region. i.e. all lines drawn will now be drawn in this colour.
Reimplemented from TranspFillAttribute. Definition at line 8744 of file fillval.cpp. 08745 { 08746 pRegion->SetLineTransp(this, Temp); 08747 }
|
|
Restores the line colour attribute for the given render region. i.e. all lines drawn will now be drawn in this colour.
Reimplemented from TranspFillAttribute. Definition at line 8766 of file fillval.cpp. 08767 { 08768 pRegion->RestoreLineTransp(this, Temp); 08769 }
|
|
See AttributeValue::SimpleCopy.
Reimplemented from FillGeometryAttribute. Definition at line 8810 of file fillval.cpp. 08811 { 08812 Transp = ((StrokeTranspAttribute *) pValue)->Transp; 08813 TranspType = ((StrokeTranspAttribute *) pValue)->TranspType; 08814 }
|