GIFAnimationExportParam Class Reference

Passes infomation about the GIF animation and its bitmap(s) being exported. More...

#include <frameops.h>

Inheritance diagram for GIFAnimationExportParam:

BitmapExportParam OpParam CCObject SimpleCCObject List of all members.

Public Member Functions

 GIFAnimationExportParam ()
 Default constructor.
 GIFAnimationExportParam (UINT32 Count, KernelBitmap **pBitmap)
 Used to pass around lists of bitmaps. Note that deleting the bitmap array is the responsibility of the caller.
 ~GIFAnimationExportParam ()
 Default destructor.
virtual UINT32 GetBitmapCount ()
 For getting the number of bitmaps in the array!
virtual KernelBitmapGetBitmap (UINT32 Index)
 For safely getting a pointer to a bitmap in the bitmap array.
virtual BOOL AddBitmap (KernelBitmap *pBitmap)
 Tries to add the bitmap to the list. Uses the class variables m_pBitmaps and m_BitmapCount. Copied from BitmapSGallery and BitmapExportParam way of doing things so that we are compatible. Not the best way of doing it!
UINT32 GetRegeneratedBitmapPosition () const
void SetRegeneratedBitmapPosition (const UINT32 Pos)
virtual UINT32 GetLayerCount ()
 For getting the number of layers/bitmaps in the array!
virtual LayerGetLayer (UINT32 Index)
 For safely getting a pointer to a bitmap in the bitmap array.
virtual BOOL AddLayer (Layer *pLayer)
 For adding a layer to list ready for exporting the GIF animation. Uses the class variables m_pLayers and m_LayerCount.
virtual BOOL AddLayerAndBitmap (Layer *pLayer, KernelBitmap *pBitmap)
 For adding a layer to list ready for exporting the GIF animation. Uses the class variables m_pLayers and m_LayerCount.
AnimPropertiesParamGetSpreadAnimPropertiesParam ()
 Returns the Animation Properties details for this GIFAnimationExportParam.
void SetSpreadAnimPropertiesParam (const AnimPropertiesParam &Param)
DWORD GetAnimLoop () const
DWORD GetGlobalAnimDelay () const
WEB_PALETTE GetPalette () const
PALETTE_COLOURS GetPaletteCols () const
DWORD GetNumColsInPalette () const
DITHER GetDither () const
BOOL GetUseSystemCols () const
BOOL GetIsBackGroundTransp () const
virtual DocRect GetBoundingRect () const
 Returns the bounding rectangle of the animation.
DocRect GetAnimationBoundingRect () const
void SetAnimationBoundingRect (const DocRect &BoundingRect)

Protected Attributes

AnimPropertiesParam m_AnimPropertiesParam
KernelBitmap ** m_pBitmaps
UINT32 m_BitmapCount
Layer ** m_pLayers
UINT32 m_LayerCount
UINT32 m_RegeneratedBitmapPosition

Private Member Functions

 CC_DECLARE_DYNAMIC (GIFAnimationExportParam)

Detailed Description

Passes infomation about the GIF animation and its bitmap(s) being exported.

> class GIFAnimationExportParam : public BitmapExportParam

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/5/97
See also:
OpParam

Definition at line 360 of file frameops.h.


Constructor & Destructor Documentation

GIFAnimationExportParam::GIFAnimationExportParam  ) 
 

Default constructor.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97

Definition at line 4155 of file frameops.cpp.

04156 {
04157     m_BitmapCount = 0;
04158     m_pBitmaps = NULL;
04159 
04160     m_LayerCount = 0;
04161     m_pLayers = NULL;
04162 
04163     m_RegeneratedBitmapPosition = 0;
04164 }

GIFAnimationExportParam::GIFAnimationExportParam UINT32  Count,
KernelBitmap **  pBitmap
 

Used to pass around lists of bitmaps. Note that deleting the bitmap array is the responsibility of the caller.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97
Parameters:
Count - The number of indexes in the array [INPUTS] pBitmap - pointer to an array of pointers to kernel bitmaps
- [OUTPUTS]
Returns:
-

Definition at line 4207 of file frameops.cpp.

04208 {
04209     ERROR3IF(Count == 0, "Zero bitmap count, that's not right");
04210     ERROR3IF(pBitmap == NULL, "NULL bitmap array");
04211     ERROR3IF(!(*pBitmap)->IS_KIND_OF(KernelBitmap), "This dosen't seem to be an array of kernel bitmaps");
04212 
04213     m_BitmapCount = Count;
04214     m_pBitmaps = pBitmap;
04215 
04216     // set up everything else to defaults
04217     m_RegeneratedBitmapPosition = 0;
04218     m_LayerCount = 0;
04219     m_pLayers = NULL;
04220 }

GIFAnimationExportParam::~GIFAnimationExportParam  ) 
 

Default destructor.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97

Definition at line 4176 of file frameops.cpp.

04177 {
04178     // free up the arrays that we grabbed
04179     if (m_pBitmaps != NULL)
04180     {
04181         CCFree(m_pBitmaps);
04182         m_pBitmaps = NULL;
04183         m_BitmapCount = 0;
04184     }
04185     if (m_pLayers != NULL)
04186     {
04187         CCFree(m_pLayers);
04188         m_pLayers = NULL;
04189         m_LayerCount = 0;
04190     }
04191 }


Member Function Documentation

BOOL GIFAnimationExportParam::AddBitmap KernelBitmap pBitmap  )  [virtual]
 

Tries to add the bitmap to the list. Uses the class variables m_pBitmaps and m_BitmapCount. Copied from BitmapSGallery and BitmapExportParam way of doing things so that we are compatible. Not the best way of doing it!

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97
Parameters:
pBitmap the bitmap to add to our list in the animation [INPUTS]
Returns:
True if worked ok, False otherwise
See also:
BitmapSGallery::GetSelectedBitmaps

Definition at line 4382 of file frameops.cpp.

04383 {
04384     ERROR2IF(pBitmap == NULL,FALSE,"Addbitmap given null bitmap");
04385     BOOL ok = TRUE;
04386 
04387     // If we have a null list then just allocate the first item
04388     if (m_pBitmaps == NULL)
04389     {
04390         // Claim selected space
04391         m_pBitmaps = (KernelBitmap**) CCMalloc(sizeof(KernelBitmap*));
04392         if (m_pBitmaps == NULL)
04393             ok = FALSE;
04394         else
04395             m_pBitmaps[0] = pBitmap;
04396         m_BitmapCount = 1;
04397     }
04398     else
04399     {
04400         // Add to end of selection
04401         KernelBitmap** pTemp = (KernelBitmap**) CCRealloc(m_pBitmaps, (m_BitmapCount + 1) * sizeof(KernelBitmap*));
04402         if (pTemp == NULL)
04403             ok = FALSE;
04404         else
04405         {
04406             m_pBitmaps = pTemp;
04407             m_pBitmaps[m_BitmapCount] = pBitmap;
04408         }
04409         m_BitmapCount++;
04410     }
04411 
04412     return ok;
04413 }

BOOL GIFAnimationExportParam::AddLayer Layer pLayer  )  [virtual]
 

For adding a layer to list ready for exporting the GIF animation. Uses the class variables m_pLayers and m_LayerCount.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97
Parameters:
pLayer the layer to be added to the list/array [INPUTS]
- [OUTPUTS]
Returns:
True if worked ok, False otherwise.

Definition at line 4333 of file frameops.cpp.

04334 {
04335     ERROR2IF(pLayer == NULL,FALSE,"AddLayer given null layer");
04336     BOOL ok = TRUE;
04337 
04338     // If we have a null list then just allocate the first item
04339     if (m_pLayers == NULL)
04340     {
04341         // Claim selected space
04342         m_pLayers = (Layer**) CCMalloc(sizeof(Layer*));
04343         if (m_pLayers == NULL)
04344             ok = FALSE;
04345         else
04346             m_pLayers[0] = pLayer;
04347         m_LayerCount = 1;
04348     }
04349     else
04350     {
04351         // Add to end of selection
04352         Layer** pTemp = (Layer**) CCRealloc(m_pLayers, (m_LayerCount + 1) * sizeof(Layer*));
04353         if (pTemp == NULL)
04354             ok = FALSE;
04355         else
04356         {
04357             m_pLayers = pTemp;
04358             m_pLayers[m_LayerCount] = pLayer;
04359         }
04360         m_LayerCount++;
04361     }
04362 
04363     return ok;
04364 }

BOOL GIFAnimationExportParam::AddLayerAndBitmap Layer pLayer,
KernelBitmap pBitmap
[virtual]
 

For adding a layer to list ready for exporting the GIF animation. Uses the class variables m_pLayers and m_LayerCount.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97
Parameters:
pLayer the layer to be added to the list/array [INPUTS] pBitmap the bitmap associated with this layer to be added to the list/array
Returns:
True if worked ok, False otherwise.

Definition at line 4313 of file frameops.cpp.

04314 {
04315     // Let the called functions do the parameter checking!
04316     return AddLayer(pLayer) && AddBitmap(pBitmap);
04317 }

GIFAnimationExportParam::CC_DECLARE_DYNAMIC GIFAnimationExportParam   )  [private]
 

DocRect GIFAnimationExportParam::GetAnimationBoundingRect  )  const [inline]
 

Definition at line 399 of file frameops.h.

DWORD GIFAnimationExportParam::GetAnimLoop  )  const [inline]
 

Definition at line 388 of file frameops.h.

00388 { return m_AnimPropertiesParam.GetAnimLoop();           }

KernelBitmap * GIFAnimationExportParam::GetBitmap UINT32  Index  )  [virtual]
 

For safely getting a pointer to a bitmap in the bitmap array.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97
Parameters:
Index - the index of the required bitmap [INPUTS]
- [OUTPUTS]
Returns:
Pointer to the nth bitmap, NULL if error

Reimplemented from BitmapExportParam.

Definition at line 4251 of file frameops.cpp.

04252 {
04253     ERROR2IF(Index >= m_BitmapCount, NULL, "Index out of bounds");
04254     ERROR2IF(m_pBitmaps == NULL, NULL, "NULL array");
04255 
04256     ERROR3IF(!(m_pBitmaps[Index])->IS_KIND_OF(KernelBitmap), "This dosen't seem to be a pointer to a kernel bitmap");
04257     return m_pBitmaps[Index];
04258 }

UINT32 GIFAnimationExportParam::GetBitmapCount  )  [virtual]
 

For getting the number of bitmaps in the array!

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97
Returns:
The number of bitmaps in the bitmap array. (The array runs 0..Count-1)

Reimplemented from BitmapExportParam.

Definition at line 4233 of file frameops.cpp.

04234 {
04235     return m_BitmapCount;
04236 }

DocRect GIFAnimationExportParam::GetBoundingRect  )  const [virtual]
 

Returns the bounding rectangle of the animation.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/06/97

Definition at line 4456 of file frameops.cpp.

04457 {
04458     // Recover the bounding rect of the animation from our copy of the spread's
04459     // animation properties.
04460     DocRect BoundingRect = m_AnimPropertiesParam.GetBoundingRect();
04461     // We are only interested in the size and so translate it to zero
04462     BoundingRect.Translate(-BoundingRect.lo.x, -BoundingRect.lo.y);
04463     // return it to the caller
04464     return BoundingRect;
04465 }

DITHER GIFAnimationExportParam::GetDither  )  const [inline]
 

Definition at line 393 of file frameops.h.

00393 { return m_AnimPropertiesParam.GetDither();             }

DWORD GIFAnimationExportParam::GetGlobalAnimDelay  )  const [inline]
 

Definition at line 389 of file frameops.h.

BOOL GIFAnimationExportParam::GetIsBackGroundTransp  )  const [inline]
 

Definition at line 395 of file frameops.h.

Layer * GIFAnimationExportParam::GetLayer UINT32  Index  )  [virtual]
 

For safely getting a pointer to a bitmap in the bitmap array.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97
Parameters:
Index - the index of the required bitmap [INPUTS]
- [OUTPUTS]
Returns:
Pointer to the nth bitmap, NULL if error

Reimplemented from BitmapExportParam.

Definition at line 4290 of file frameops.cpp.

04291 {
04292     ERROR2IF(Index >= m_LayerCount, NULL, "Index out of bounds");
04293     ERROR2IF(m_pLayers == NULL, NULL, "NULL array");
04294 
04295     ERROR3IF(!(m_pLayers[Index])->IS_KIND_OF(Layer), "This dosen't seem to be a pointer to a layer");
04296     return m_pLayers[Index];
04297 }

UINT32 GIFAnimationExportParam::GetLayerCount  )  [virtual]
 

For getting the number of layers/bitmaps in the array!

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97
Returns:
The number of bitmaps/layers in the layers/bitmap array. (The array runs 0..Count-1)

Reimplemented from BitmapExportParam.

Definition at line 4272 of file frameops.cpp.

04273 {
04274     return m_LayerCount;
04275 }

DWORD GIFAnimationExportParam::GetNumColsInPalette  )  const [inline]
 

Definition at line 392 of file frameops.h.

WEB_PALETTE GIFAnimationExportParam::GetPalette  )  const [inline]
 

Definition at line 390 of file frameops.h.

00390 { return m_AnimPropertiesParam.GetPalette();            }

PALETTE_COLOURS GIFAnimationExportParam::GetPaletteCols  )  const [inline]
 

Definition at line 391 of file frameops.h.

UINT32 GIFAnimationExportParam::GetRegeneratedBitmapPosition  )  const [inline]
 

Definition at line 376 of file frameops.h.

00376 { return m_RegeneratedBitmapPosition; }

AnimPropertiesParam & GIFAnimationExportParam::GetSpreadAnimPropertiesParam  ) 
 

Returns the Animation Properties details for this GIFAnimationExportParam.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97

Definition at line 4441 of file frameops.cpp.

04442 {
04443     return m_AnimPropertiesParam;
04444 }

BOOL GIFAnimationExportParam::GetUseSystemCols  )  const [inline]
 

Definition at line 394 of file frameops.h.

void GIFAnimationExportParam::SetAnimationBoundingRect const DocRect BoundingRect  )  [inline]
 

Definition at line 400 of file frameops.h.

00400 { m_AnimPropertiesParam.SetBoundingRect(BoundingRect); }

void GIFAnimationExportParam::SetRegeneratedBitmapPosition const UINT32  Pos  )  [inline]
 

Definition at line 377 of file frameops.h.

void GIFAnimationExportParam::SetSpreadAnimPropertiesParam const AnimPropertiesParam Param  ) 
 

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/05/97
Parameters:
pParam - Sets the Animation Properties details for this GIFAnimationExportParam. [INPUTS]
Returns:
TRUE if ok, FALSE otherwise.

Definition at line 4426 of file frameops.cpp.

04427 {
04428     m_AnimPropertiesParam = Param;
04429 }


Member Data Documentation

AnimPropertiesParam GIFAnimationExportParam::m_AnimPropertiesParam [protected]
 

Definition at line 404 of file frameops.h.

UINT32 GIFAnimationExportParam::m_BitmapCount [protected]
 

Definition at line 414 of file frameops.h.

UINT32 GIFAnimationExportParam::m_LayerCount [protected]
 

Definition at line 416 of file frameops.h.

KernelBitmap** GIFAnimationExportParam::m_pBitmaps [protected]
 

Definition at line 413 of file frameops.h.

Layer** GIFAnimationExportParam::m_pLayers [protected]
 

Definition at line 415 of file frameops.h.

UINT32 GIFAnimationExportParam::m_RegeneratedBitmapPosition [protected]
 

Definition at line 417 of file frameops.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:54:48 2007 for Camelot by  doxygen 1.4.4