swfbitmp.cpp

Go to the documentation of this file.
00001 // $Id: swfbitmp.cpp 751 2006-03-31 15:43:49Z alex $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 #include "camtypes.h"
00099 #include "swfbitmp.h"
00100 
00101 #define new CAM_DEBUG_NEW
00102 
00103 /********************************************************************************************
00104 
00105 >   FlashBitmapRecord::FlashBitmapRecord ( void )
00106 
00107     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00108     Created:    16/11/99
00109     Inputs:     -
00110     Returns:    -
00111     Purpose:    Creates a FlashBitmapRecord list node, and initialises all member variables.
00112 
00113 ********************************************************************************************/
00114 
00115 FlashBitmapRecord::FlashBitmapRecord ( void )
00116 {
00117     // Pointers should always be initialised to NULL when created.
00118     mpNext          = NULL;     // No subsequent nodes.
00119     mpLast          = NULL;     // No previous nodes.
00120     mpBitmap        = NULL;     // No bitmap attached.
00121 
00122     mIsContone      = FALSE;
00123     mBitmapID       = 0;
00124 
00125     mTransparency   = 255;      // The bitmap is (initially) transparent.
00126 }
00127 
00128 /********************************************************************************************
00129 
00130 >   FlashBitmapRecord::~FlashBitmapRecord ( void )
00131 
00132     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00133     Created:    16/11/99
00134     Inputs:     -
00135     Returns:    -
00136     Purpose:    Destroys this instance of FlashBitmapRecord.
00137 
00138 ********************************************************************************************/
00139 
00140 FlashBitmapRecord::~FlashBitmapRecord ( void )
00141 {
00142     // Clean up any stray values.
00143     mpNext      = NULL;
00144     mpLast      = NULL;
00145     mpBitmap    = NULL;
00146 }
00147 
00148 /********************************************************************************************
00149 
00150 >   FlashBitmapRecord* FlashBitmapRecord::AddElement ( void )
00151 
00152     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00153     Created:    16/11/99
00154     Inputs:     -
00155     Returns:    pTail - The pointer to the new node.
00156     Purpose:    Adds an element to the tail of the list.
00157 
00158 ********************************************************************************************/
00159 
00160 FlashBitmapRecord* FlashBitmapRecord::AddElement ( void )
00161 {
00162     FlashBitmapRecord *pTail = new FlashBitmapRecord;
00163     
00164     // Set the appropriate pointers.
00165     pTail->SetLast ( this );        // Ensure that a reference exists to this object...
00166     pTail->SetNext ( mpNext );      // Avoids any problems if mpLast isn't NULL.
00167     mpNext = pTail;                 // ... and a reference exists to the new one.
00168 
00169     return pTail;
00170 }
00171 
00172 /********************************************************************************************
00173 
00174 >   void FlashBitmapRecord::DeleteLastElement ( void )
00175 
00176     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00177     Created:    16/11/99
00178     Inputs:     -
00179     Returns:    -
00180     Purpose:    Deletes the previous item in the list.
00181 
00182 ********************************************************************************************/
00183 
00184 void FlashBitmapRecord::DeleteLastElement ( void )
00185 {
00186     FlashBitmapRecord *pToDelete = mpLast;
00187     
00188     // Reset mpLast to be mpLast->GetLast (), so that the list isn't broken.
00189     if ( mpLast != NULL )
00190         mpLast = mpLast->GetLast ();
00191 
00192     delete pToDelete;
00193 }
00194 
00195 /********************************************************************************************
00196 
00197 >   void FlashBitmapRecord::DeleteNextElement ( void )
00198 
00199     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00200     Created:    16/11/99
00201     Inputs:     -
00202     Returns:    -
00203     Purpose:    Deletes the next item in the list.
00204 
00205 ********************************************************************************************/
00206 
00207 void FlashBitmapRecord::DeleteNextElement ( void )
00208 {
00209     FlashBitmapRecord *pToDelete = mpNext;
00210     
00211     // Reset mpNext to be mpNext->GetNext (), so that the list isn't broken.
00212     if ( mpNext != NULL )
00213         mpNext = mpNext->GetNext ();
00214 
00215     delete pToDelete;
00216 }
00217 
00218 /********************************************************************************************
00219 
00220 >   OILBitmap* FlashBitmapRecord::GetBitmap ( void )
00221 
00222     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00223     Created:    16/11/99
00224     Inputs:     -
00225     Returns:    mpBitmap - A pointer to a kernel bitmap.
00226     Purpose:    Gets the value of mpBitmap.
00227 
00228 ********************************************************************************************/
00229 
00230 OILBitmap* FlashBitmapRecord::GetBitmap ( void )
00231 {
00232     return mpBitmap;
00233 }
00234 
00235 /********************************************************************************************
00236 
00237 >   WORD FlashBitmapRecord::GetBitmapID ( void )
00238 
00239     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00240     Created:    16/11/99
00241     Inputs:     -
00242     Returns:    mBitmapID - The internal ID number used by the Flash file.
00243     Purpose:    Gets the value of mBitmapID.
00244 
00245 ********************************************************************************************/
00246 
00247 WORD FlashBitmapRecord::GetBitmapID ( void )
00248 {
00249     return mBitmapID;
00250 }
00251 
00252 /********************************************************************************************
00253 
00254 >   DocColour FlashBitmapRecord::GetContoneStart ( void )
00255 
00256     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00257     Created:    2/12/99
00258     Inputs:     -
00259     Returns:    mStartColour - The start colour for a contone operation.
00260     Purpose:    Gets the value of mStartColour.
00261 
00262 ********************************************************************************************/
00263 
00264 DocColour FlashBitmapRecord::GetContoneStart ( void )
00265 {
00266     return mStartColour;
00267 }
00268 
00269 /********************************************************************************************
00270 
00271 >   DocColour FlashBitmapRecord::GetContoneEnd ( void )
00272 
00273     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00274     Created:    2/12/99
00275     Inputs:     -
00276     Returns:    mEndColour - The end colour for a contone operation.
00277     Purpose:    Gets the value of mEndColour.
00278 
00279 ********************************************************************************************/
00280 
00281 DocColour FlashBitmapRecord::GetContoneEnd ( void )
00282 {
00283     return mEndColour;
00284 }
00285 
00286 /********************************************************************************************
00287 
00288 >   BOOL FlashBitmapRecord::GetIsContone ( void )
00289 
00290     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00291     Created:    2/12/99
00292     Inputs:     -
00293     Returns:    mIsContone - Is the bitmap contoned.
00294     Purpose:    Gets the value of mIsContone.
00295 
00296 ********************************************************************************************/
00297 
00298 BOOL FlashBitmapRecord::GetIsContone ( void )
00299 {
00300     return mIsContone;
00301 }
00302 
00303 /********************************************************************************************
00304 
00305 >   UINT32 FlashBitmapRecord::GetTransparency ( void )
00306 
00307     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00308     Created:    20/11/00
00309     Inputs:     -
00310     Returns:    mTransparency - The transparency channel of the bitmap.
00311     Purpose:    Gets the value of mTransparency.
00312 
00313 ********************************************************************************************/
00314 
00315 UINT32 FlashBitmapRecord::GetTransparency ( void )
00316 {
00317     return mTransparency;
00318 }
00319 
00320 /********************************************************************************************
00321 
00322 >   FlashBitmapRecord* FlashBitmapRecord::GetLast ( void )
00323 
00324     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00325     Created:    16/11/99
00326     Inputs:     -
00327     Returns:    *mpLast - A pointer to the previous node in the linked list.
00328     Purpose:    Gets mpLast.
00329 
00330 ********************************************************************************************/
00331 
00332 FlashBitmapRecord* FlashBitmapRecord::GetLast ( void )
00333 {
00334     return mpLast;
00335 }
00336 
00337 /********************************************************************************************
00338 
00339 >   FlashBitmapRecord* FlashBitmapRecord::GetNext ( void )
00340 
00341     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00342     Created:    16/11/99
00343     Inputs:     -
00344     Returns:    *mpNext - A pointer to the next node in the linked list.
00345     Purpose:    Gets mpNext.
00346 
00347 ********************************************************************************************/
00348 
00349 FlashBitmapRecord* FlashBitmapRecord::GetNext ( void )
00350 {
00351     return mpNext;
00352 }
00353 
00354 /********************************************************************************************
00355 
00356 >   void FlashBitmapRecord::SetBitmap ( OILBitmap *pBitmap )
00357 
00358     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00359     Created:    16/11/99
00360     Inputs:     pBitmap - A pointer to a kernel bitmap.
00361     Returns:    -
00362     Purpose:    Sets the value of mpBitmap.
00363 
00364 ********************************************************************************************/
00365 
00366 void FlashBitmapRecord::SetBitmap ( OILBitmap *pBitmap )
00367 {
00368     mpBitmap = pBitmap;
00369 }
00370 
00371 /********************************************************************************************
00372 
00373 >   void FlashBitmapRecord::SetContoneColours ( const DocColour &Start,
00374                                                 const DocColour &End )
00375     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00376     Created:    1/12/99
00377     Inputs:     Start   - The start colour for a contone fill.
00378                 End     - The end colour for a contone fill.
00379     Returns:    -
00380     Purpose:    Sets the values of mStartColour and mEndColour.
00381 
00382 ********************************************************************************************/
00383 
00384 void FlashBitmapRecord::SetContoneColours ( const DocColour &Start,
00385                                             const DocColour &End )
00386 {
00387     // Set the values for the start and end colours.
00388     mStartColour    = Start;
00389     mEndColour      = End;
00390 }
00391 
00392 /********************************************************************************************
00393 
00394 >   void FlashBitmapRecord::SetIsContone ( BOOL IsContone )
00395 
00396     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00397     Created:    1/12/99
00398     Inputs:     IsContone - Is the bitmap to be rendered as a contone bitmap.
00399     Returns:    -
00400     Purpose:    Sets the value of mIsContone.
00401 
00402 ********************************************************************************************/
00403 
00404 void FlashBitmapRecord::SetIsContone ( BOOL IsContone )
00405 {
00406     mIsContone = IsContone;
00407 }
00408 
00409 /********************************************************************************************
00410 
00411 >   void FlashBitmapRecord::SetTransparency ( UINT32 Transparency )
00412 
00413     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00414     Created:    20/11/00
00415     Inputs:     Transparency - The transparency of the bitmap.
00416     Returns:    -
00417     Purpose:    Sets the value of mTransparency.
00418 
00419 ********************************************************************************************/
00420 
00421 void FlashBitmapRecord::SetTransparency ( UINT32 Transparency )
00422 {
00423     mTransparency = Transparency;
00424 }
00425 
00426 /********************************************************************************************
00427 
00428 >   void FlashBitmapRecord::SetBitmapID ( WORD BitmapID )
00429 
00430     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00431     Created:    16/11/99
00432     Inputs:     BitmapID - The ID value for this bitmap.
00433     Returns:    -
00434     Purpose:    Sets the value of mBitmapID.
00435 
00436 ********************************************************************************************/
00437 
00438 void FlashBitmapRecord::SetBitmapID ( WORD BitmapID )
00439 {
00440     mBitmapID = BitmapID;
00441 }
00442 
00443 /********************************************************************************************
00444 
00445 >   void FlashBitmapRecord::SetLast ( FlashBitmapRecord *pLast )
00446 
00447     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00448     Created:    16/11/99
00449     Inputs:     pLast - A pointer to the previous FlashBitmapRecord in the linked list.
00450     Returns:    -
00451     Purpose:    Sets the value of mpLast.
00452 
00453 ********************************************************************************************/
00454 
00455 void FlashBitmapRecord::SetLast ( FlashBitmapRecord *pLast )
00456 {
00457     mpLast = pLast;
00458 }
00459 
00460 /********************************************************************************************
00461 
00462 >   void FlashBitmapRecord::SetNext ( FlashBitmapRecord *pNext )
00463 
00464     Author:     Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
00465     Created:    16/11/99
00466     Inputs:     pNext - A pointer to the next FlashBitmapRecord in the linked list.
00467     Returns:    -
00468     Purpose:    Sets the value of mpNext.
00469 
00470 ********************************************************************************************/
00471 
00472 void FlashBitmapRecord::SetNext ( FlashBitmapRecord *pNext )
00473 {
00474     mpNext = pNext;
00475 }

Generated on Sat Nov 10 03:47:06 2007 for Camelot by  doxygen 1.4.4