#include <swfshape.h>
Inheritance diagram for FlashShapeRecord:
Public Member Functions | |
FlashShapeRecord () | |
Default constructor. Ensure that all the variables are set to values that won't cause problems. | |
~FlashShapeRecord () | |
Default destructor. | |
FlashShapeRecord * | GetNext (void) |
Gets a pointer to the next item in the list. | |
void | SetNext (FlashShapeRecord *pNext) |
Sets mpNext (the pointer to the next item in the list) to the FlashShapeRecord pointed to by pNext. | |
FlashShapeRecord * | AddNext (void) |
Creates a new item, adds it to the list after this node, and returns a pointer to this item. | |
void | SetPath (DocCoord *pPath, PathVerb *pVerbs, INT32 NumberCoords) |
Gets a pointer to mpCoordArray. | |
DocCoord * | GetCoords (void) |
Gets a pointer to mpCoordArray. | |
PathVerb * | GetVerbs (void) |
Gets a pointer to mpPathVerbs. | |
INT32 | GetNumberCoords (void) |
Gets the value of mNumberCoords. | |
void | SetLineWidth (INT32 Width) |
Sets the line width. | |
WORD | GetLineWidth (void) |
Get's the width of the current line. | |
void | SetLineColour (DocColour *pColour, UINT32 *pAlpha) |
Sets the line's colour. | |
FlashColour | GetLineColour (void) |
Gets the current line colour. | |
void | SetShapeID (WORD ShapeID) |
Sets the value of mShapeID. | |
WORD | GetShapeID (void) |
Gets the ID for this Shape record. | |
void | SetBitmapID (WORD BitmapID) |
Sets the value of mBitmapID. | |
WORD | GetBitmapID (void) |
Gets the ID for the bitmap record being used.. | |
void | SetBoundingBox (const DocRect &Bounds) |
Sets the bounding rectangle of the shape. | |
DocRect | GetBoundingBox (void) |
Returns the shape's bounding box. | |
void | SetStartPoint (const DocCoord &Point) |
Sets the value of mStartPoint, which is the start point for a fill. | |
void | SetEndPoint (const DocCoord &Point) |
Sets the value of mEndPoint, which is the end point for a fill. | |
void | SetEndPoint2 (const DocCoord &Point) |
Sets the value of mEndPoint2, which is another point required for a fill. | |
DocCoord | GetStartPoint (void) |
Gets the start point of a complex fill. | |
DocCoord | GetEndPoint (void) |
Gets the end point of a complex fill. | |
DocCoord | GetEndPoint2 (void) |
Gets the second end point of a complex fill. | |
void | SetColour (DocColour *pColour, UINT32 FillTransparency, BYTE Ratio, UINT32 Index) |
Fills in the colour values for the fill. | |
FlashColour | GetColour (UINT32 i) |
Gets the given colour from a fill. | |
BYTE | GetRatio (UINT32 i) |
Gets the given ratio from a fill. | |
BYTE | GetNumberColours (void) |
Gets the number of colours within a complex fill. | |
void | SetFill (BYTE FillType) |
Sets the fill style for this shape. | |
BYTE | GetFill (void) |
Gets the fill style (mFill). | |
void | SetIsCircular (BOOL IsCircular) |
Sets whether or not the path is basically circular. | |
BOOL | GetIsCircular (void) |
Gets the shape's roundness (mIsCircular). | |
void | SetBitmapHeight (INT32 Height) |
Sets the value of mBitmapHeight. | |
INT32 | GetBitmapHeight (void) |
Gets the Height of the bitmap being used as the fill. | |
void | SetBitmapWidth (INT32 Width) |
Sets the value of mBitmapWidth. | |
INT32 | GetBitmapWidth (void) |
Gets the width of the bitmap being used as the fill. | |
void | RemoveLines (void) |
Removes the edge lines from an output by setting their width to 0, and making them transparent. | |
BOOL | WasInvalidSizeFound () |
Shows whether the export has detected an object with an invalid size. | |
BOOL | CheckValidExportSize (const DocRect &Bounds) |
Determines whether an object's bounding box is smaller than the maximum size that Flash can cope with. If the object exceeds this, it can still be exported, but may cause black blocks to be drawn around the valid objects in the file, when it is viewed. | |
Private Attributes | |
FlashShapeRecord * | mpNext |
DocCoord * | mpCoordArray |
PathVerb * | mpPathVerbs |
INT32 | mNumberCoords |
WORD | mLineWidth |
FlashColour | mLineColour |
DocRect | mBoundingBox |
INT32 | mBitmapHeight |
INT32 | mBitmapWidth |
WORD | mShapeID |
WORD | mBitmapID |
DocCoord | mStartPoint |
DocCoord | mEndPoint |
DocCoord | mEndPoint2 |
FlashColour | mColours [8] |
BYTE | mRatios [8] |
BYTE | mNumberColours |
BYTE | mFill |
BOOL | mIsCircular |
BOOL | mInvalidSizeFound |
Definition at line 128 of file swfshape.h.
|
Default constructor. Ensure that all the variables are set to values that won't cause problems.
Definition at line 118 of file swfshape.cpp. 00119 { 00120 // Generate initial settings. 00121 DocCoord DefaultPosition ( 0, 0 ); 00122 FlashColour White; 00123 DocRect DefaultBounds ( 0, 0, 0, 0 ); 00124 00125 // Set up the line values. 00126 White.Red = White.Green = White.Blue = 255; 00127 White.Alpha = 0; 00128 00129 mLineColour = White; 00130 mLineWidth = 0; 00131 00132 mShapeID = 0; 00133 mBitmapID = 0; 00134 00135 mBitmapHeight = 0; 00136 mBitmapWidth = 0; 00137 00138 mNumberColours = 0; 00139 00140 mStartPoint = DefaultPosition; 00141 mEndPoint = DefaultPosition; 00142 mEndPoint2 = DefaultPosition; 00143 00144 mIsCircular = FALSE; 00145 00146 // By setting mFill to be FLASH_FLAT_FILL, I can make the transparency and fill 00147 // handling code in the FlashRenderRegion (swfrndr.cpp) symmetrical, because I 00148 // can always assume that a non-processed fill is a flat fill, and therefore can 00149 // be over-written by any style that is being applied. 00150 mFill = FLASH_FLAT_FILL; 00151 00152 // Set the colour array to be blank. 00153 for ( INT32 i = 0; i < SWF_MAX_COLOURS; i++ ) 00154 { 00155 mColours [i] = White; 00156 mRatios [i] = 0; 00157 } 00158 00159 // And for the bounding box. 00160 mBoundingBox = DefaultBounds; 00161 00162 mNumberCoords = 0; 00163 00164 // Initialise all pointers to NULL. 00165 mpNext = NULL; 00166 mpCoordArray = NULL; 00167 mpPathVerbs = NULL; 00168 00169 mInvalidSizeFound = FALSE; 00170 }
|
|
Default destructor.
Definition at line 184 of file swfshape.cpp. 00185 { 00186 // Delete the coordinate and verb arrays. 00187 delete [] mpCoordArray; 00188 delete [] mpPathVerbs; 00189 00190 mpNext = NULL; 00191 }
|
|
Creates a new item, adds it to the list after this node, and returns a pointer to this item.
Definition at line 241 of file swfshape.cpp. 00242 { 00243 mpNext = new FlashShapeRecord; 00244 00245 return mpNext; 00246 }
|
|
Determines whether an object's bounding box is smaller than the maximum size that Flash can cope with. If the object exceeds this, it can still be exported, but may cause black blocks to be drawn around the valid objects in the file, when it is viewed.
Definition at line 898 of file swfshape.cpp. 00899 { 00900 BOOL valid = FALSE; 00901 INT32 scaledHeight; 00902 INT32 scaledWidth; 00903 00904 // calculate the height and width of the objects in pixels. 00905 scaledHeight = (Bounds.Height ()) / 750; 00906 scaledWidth = (Bounds.Width ()) / 750; 00907 00908 // If both the height and the width are less than the maximum, then the size is valid, 00909 // If one is greater, then the bounds are invalid, and this may cause black blocks to be 00910 // shown. 00911 if ((scaledHeight < SWF_MAX_PIXEL_DIMENSION) && 00912 (scaledWidth < SWF_MAX_PIXEL_DIMENSION)) 00913 { 00914 valid = TRUE; 00915 } 00916 else 00917 { 00918 mInvalidSizeFound = TRUE; 00919 valid = FALSE; 00920 } 00921 00922 return valid; 00923 }
|
|
Gets the Height of the bitmap being used as the fill.
Definition at line 857 of file swfshape.cpp. 00858 { 00859 return mBitmapHeight; 00860 }
|
|
Gets the ID for the bitmap record being used..
Definition at line 500 of file swfshape.cpp. 00501 { 00502 return mBitmapID; 00503 }
|
|
Gets the width of the bitmap being used as the fill.
Definition at line 823 of file swfshape.cpp. 00824 { 00825 return mBitmapWidth; 00826 }
|
|
Returns the shape's bounding box.
Definition at line 449 of file swfshape.cpp. 00450 { 00451 return mBoundingBox; 00452 }
|
|
Gets the given colour from a fill.
Definition at line 681 of file swfshape.cpp. 00682 { 00683 if ( i < mNumberColours ) 00684 return mColours [i]; 00685 else 00686 return mColours [mNumberColours - 1]; 00687 }
|
|
Gets a pointer to mpCoordArray.
Definition at line 299 of file swfshape.cpp. 00300 { 00301 return mpCoordArray; 00302 }
|
|
Gets the end point of a complex fill.
Definition at line 602 of file swfshape.cpp. 00603 { 00604 return mEndPoint; 00605 }
|
|
Gets the second end point of a complex fill.
Definition at line 619 of file swfshape.cpp. 00620 { 00621 return mEndPoint2; 00622 }
|
|
Gets the fill style (mFill).
Definition at line 755 of file swfshape.cpp. 00756 { 00757 return mFill; 00758 }
|
|
Gets the shape's roundness (mIsCircular).
Definition at line 789 of file swfshape.cpp. 00790 { 00791 return mIsCircular; 00792 }
|
|
Gets the current line colour.
Definition at line 414 of file swfshape.cpp. 00415 { 00416 return mLineColour; 00417 }
|
|
Get's the width of the current line.
Definition at line 368 of file swfshape.cpp. 00369 { 00370 return mLineWidth; 00371 }
|
|
Gets a pointer to the next item in the list.
Definition at line 205 of file swfshape.cpp. 00206 { 00207 return mpNext; 00208 }
|
|
Gets the number of colours within a complex fill.
Definition at line 721 of file swfshape.cpp. 00722 { 00723 return mNumberColours; 00724 }
|
|
Gets the value of mNumberCoords.
Definition at line 334 of file swfshape.cpp. 00335 { 00336 return mNumberCoords; 00337 }
|
|
Gets the given ratio from a fill.
Definition at line 701 of file swfshape.cpp. 00702 { 00703 if ( i < mNumberColours ) 00704 return mRatios [i]; 00705 else 00706 return mRatios [mNumberColours - 1]; 00707 }
|
|
Gets the ID for this Shape record.
Definition at line 466 of file swfshape.cpp. 00467 { 00468 return mShapeID; 00469 }
|
|
Gets the start point of a complex fill.
Definition at line 585 of file swfshape.cpp. 00586 { 00587 return mStartPoint; 00588 }
|
|
Gets a pointer to mpPathVerbs.
Definition at line 317 of file swfshape.cpp. 00318 { 00319 return mpPathVerbs; 00320 }
|
|
Removes the edge lines from an output by setting their width to 0, and making them transparent.
Definition at line 875 of file swfshape.cpp. 00876 { 00877 mLineColour.Alpha = 0; 00878 mLineWidth = 0; 00879 }
|
|
Sets the value of mBitmapHeight.
Definition at line 840 of file swfshape.cpp. 00841 { 00842 mBitmapHeight = Height; 00843 }
|
|
Sets the value of mBitmapID.
Definition at line 517 of file swfshape.cpp. 00518 { 00519 mBitmapID = BitmapID; 00520 }
|
|
Sets the value of mBitmapWidth.
Definition at line 806 of file swfshape.cpp. 00807 { 00808 mBitmapWidth = Width; 00809 }
|
|
Sets the bounding rectangle of the shape.
Definition at line 431 of file swfshape.cpp. 00432 { 00433 CheckValidExportSize (Bounds); 00434 mBoundingBox = Bounds; 00435 }
|
|
Fills in the colour values for the fill.
Definition at line 642 of file swfshape.cpp. 00646 { 00647 if ( Index < SWF_MAX_COLOURS ) 00648 { 00649 // Convert the Camelot colour into a Flash colour. 00650 INT32 lRed, lGreen, lBlue; 00651 00652 // Extract the colour value from DocColour. 00653 pColour->GetRGBValue ( &lRed, &lGreen, &lBlue ); 00654 00655 // And cast it into the record as an RGB triplet of BYTEs. 00656 mColours [ Index ].Red = ( BYTE ) lRed; 00657 mColours [ Index ].Green = ( BYTE ) lGreen; 00658 mColours [ Index ].Blue = ( BYTE ) lBlue; 00659 mColours [ Index ].Alpha = 255 - ( BYTE) FillTransparency; 00660 00661 mRatios [ Index ] = Ratio; 00662 00663 // Record how many colours have been used to date. 00664 if ( Index >= mNumberColours ) 00665 mNumberColours = ( BYTE ) ( Index + 1 ); 00666 } 00667 }
|
|
Sets the value of mEndPoint, which is the end point for a fill.
Definition at line 551 of file swfshape.cpp. 00552 { 00553 mEndPoint = Point; 00554 }
|
|
Sets the value of mEndPoint2, which is another point required for a fill.
Definition at line 568 of file swfshape.cpp. 00569 { 00570 mEndPoint2 = Point; 00571 }
|
|
Sets the fill style for this shape.
Definition at line 738 of file swfshape.cpp. 00739 { 00740 mFill = FillType; 00741 }
|
|
Sets whether or not the path is basically circular.
Definition at line 772 of file swfshape.cpp. 00773 { 00774 mIsCircular = IsCircular; 00775 }
|
|
Sets the line's colour.
Definition at line 386 of file swfshape.cpp. 00388 { 00389 INT32 lRed, lGreen, lBlue; 00390 00391 // Extract the colour value from DocColour. 00392 pColour->GetRGBValue ( &lRed, &lGreen, &lBlue ); 00393 00394 // And cast it into the record as an RGB triplet of BYTEs. 00395 mLineColour.Red = ( BYTE ) lRed; 00396 mLineColour.Green = ( BYTE ) lGreen; 00397 mLineColour.Blue = ( BYTE ) lBlue; 00398 00399 mLineColour.Alpha = 255 - ( BYTE ) *pAlpha; 00400 }
|
|
Sets the line width.
Definition at line 351 of file swfshape.cpp. 00352 { 00353 mLineWidth = ( WORD ) ( Width / FLASH_SCALE ); 00354 }
|
|
Sets mpNext (the pointer to the next item in the list) to the FlashShapeRecord pointed to by pNext.
Definition at line 223 of file swfshape.cpp. 00224 { 00225 mpNext = pNext; 00226 }
|
|
Gets a pointer to mpCoordArray.
Definition at line 264 of file swfshape.cpp. 00267 { 00268 // Step 1: Ensure that the pointers passed in are valid. 00269 ASSERT ( ( pPath != NULL ) && ( pVerbs != NULL ) ); 00270 00271 // Step 2: Set up the member variables. 00272 mNumberCoords = NumberCoords; 00273 mpCoordArray = new DocCoord [ ( UINT32 ) mNumberCoords ]; 00274 mpPathVerbs = new PathVerb [ ( UINT32 ) mNumberCoords ]; 00275 00276 // Step 3: Ensure that the arrays have been created. 00277 ASSERT ( ( mpCoordArray != NULL ) && ( mpPathVerbs != NULL ) ); 00278 00279 // Step 4: Copy the values from pPath and pVerbs into mpCoordArray and mpPathVerbs. 00280 for ( INT32 i = 0; i < mNumberCoords; i++ ) 00281 { 00282 mpCoordArray [i] = pPath [i]; 00283 mpPathVerbs [i] = pVerbs [i]; 00284 } 00285 }
|
|
Sets the value of mShapeID.
Definition at line 483 of file swfshape.cpp. 00484 { 00485 mShapeID = ShapeID; 00486 }
|
|
Sets the value of mStartPoint, which is the start point for a fill.
Definition at line 534 of file swfshape.cpp. 00535 { 00536 mStartPoint = Point; 00537 }
|
|
Shows whether the export has detected an object with an invalid size.
Definition at line 938 of file swfshape.cpp. 00939 { 00940 return mInvalidSizeFound; 00941 }
|
|
Definition at line 211 of file swfshape.h. |
|
Definition at line 214 of file swfshape.h. |
|
Definition at line 212 of file swfshape.h. |
|
Definition at line 210 of file swfshape.h. |
|
Definition at line 218 of file swfshape.h. |
|
Definition at line 216 of file swfshape.h. |
|
Definition at line 217 of file swfshape.h. |
|
Definition at line 221 of file swfshape.h. |
|
Definition at line 224 of file swfshape.h. |
|
Definition at line 222 of file swfshape.h. |
|
Definition at line 209 of file swfshape.h. |
|
Definition at line 208 of file swfshape.h. |
|
Definition at line 220 of file swfshape.h. |
|
Definition at line 207 of file swfshape.h. |
|
Definition at line 205 of file swfshape.h. |
|
Definition at line 204 of file swfshape.h. |
|
Definition at line 206 of file swfshape.h. |
|
Definition at line 219 of file swfshape.h. |
|
Definition at line 213 of file swfshape.h. |
|
Definition at line 215 of file swfshape.h. |