GIFExportOptions Class Reference

Base class for storing information about the bitmap we're exporting. More...

#include <giffiltr.h>

Inheritance diagram for GIFExportOptions:

MaskedFilterExportOptions BitmapExportOptions OpParam CCObject SimpleCCObject List of all members.

Public Member Functions

 GIFExportOptions ()
 Default constructor for a GIFExportOptions object to provide GIF export options.
 GIFExportOptions (const FilterType FilterID, const StringBase *pFilterName)
 Constructor for a GIFExportOptions object to provide GIF export options.
virtual BOOL RetrieveDefaults ()
 Compares the contents of this and pOther objects See BitmapExportOptions for interface details Notes: Gets GIF specific preferences.
virtual BOOL SetAsDefaults () const
 Provides additional implementation to set GIF specific info as defaults See Also: BitmapExportOptions::SetAsDefaults().
virtual BOOL Write (CXaraFileRecord *pRec)
 Writes this object to the given record.
virtual BOOL Read (CXaraFileRecord *pRec)
 Reads this object from the given record.
virtual BOOL GetSupportsImageMap ()
BOOL GetGlobalPalette () const
void SetGlobalPalette (UINT32 GlobalPalette)
UINT32 GetLeftOffset () const
void SetLeftOffset (UINT32 LeftOffset)
UINT32 GetTopOffset () const
void SetTopOffset (UINT32 TopOffset)
GIFDisposalMethod GetAnimationRestore ()
 Support function to obtain export options.
BOOL SetAnimationRestore (const GIFDisposalMethod &DisposalMethod)
 Support function to set up information for the ensuing export See Also: GetAnimationRestore(), enum GIFDisposalMethod.
CENTISECONDS GetAnimationDelay ()
 Support function to obtain export options.
BOOL SetAnimationDelay (CENTISECONDS Delay)
 Support function to set up information for the ensuing export See Also: GetAnimationDelay().
UINT32 GetAnimationLoopCount () const
 Support function to obtain export options See Also: SetAnimationLoopCount().
BOOL SetAnimationLoopCount (UINT32 LoopCount, BOOL Value)
 Support function to set up information for the ensuing export See Also: GetAnimationLoopCount().
Coord GetAnimationSize () const
BOOL SetAnimationSize (const Coord &Size)
BOOL GetDelayValueIsDefault () const
BOOL SetDelayValueIsDefault (BOOL Value)
virtual BOOL CopyFrom (BitmapExportOptions *pOther)
 Sets the contents of this object from the passed object See Also: BitmapExportOptions::MakeCopy().
virtual BOOL FileTypeChangeCopyFrom (BitmapExportOptions *pOther)
 Copies the information from the BitmapExportOptions object passed in as the argument to the variables in this class.
virtual UINT32 GetFilterNameStrID ()

Static Public Member Functions

static BOOL Declare ()
 To declare preferences associated with these export options.
static KernelBitmap ** GetBitmapList ()
static void SetBitmapList (KernelBitmap **pBitmap)
static UINT32 GetListSize ()
static void SetListSize (UINT32 n)
static void IncListSize (UINT32 n)
static void DecListSize (UINT32 n)

Public Attributes

UINT32 DelayIndex
UINT32 RestoreIndex

Protected Attributes

BOOL m_GlobalPalette
UINT32 m_LeftOffset
UINT32 m_TopOffset
CENTISECONDS m_AnimDelay
GIFDisposalMethod m_AnimDispose
UINT32 m_AnimLoop
Coord m_AnimSize
BOOL DelayValueIsDefault

Static Protected Attributes

static KernelBitmap ** m_pBitmapList = NULL
static UINT32 m_ListSize = 0
static CENTISECONDS g_AnimationDelay = 10
static GIFDisposalMethod g_AnimationRestoreType = GDM_LEAVE
static UINT32 g_AnimationLoopCount = 1

Detailed Description

Base class for storing information about the bitmap we're exporting.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/10/96

Definition at line 140 of file giffiltr.h.


Constructor & Destructor Documentation

GIFExportOptions::GIFExportOptions  ) 
 

Default constructor for a GIFExportOptions object to provide GIF export options.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96

Definition at line 201 of file giffiltr.cpp.

GIFExportOptions::GIFExportOptions const FilterType  FilterID,
const StringBase pFilterName
 

Constructor for a GIFExportOptions object to provide GIF export options.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96

Definition at line 227 of file giffiltr.cpp.

00228   : MaskedFilterExportOptions(_R(IDD_EXPORTBMPOPTS), FilterID, pFilterName),
00229     DelayIndex(0),
00230     RestoreIndex(0),
00231     m_GlobalPalette(TRUE),
00232     m_LeftOffset(0),
00233     m_TopOffset(0),
00234     m_AnimDelay(g_AnimationDelay),
00235     m_AnimDispose((GIFDisposalMethod) g_AnimationRestoreType),
00236     m_AnimLoop(g_AnimationLoopCount),
00237     m_AnimSize(0, 0),
00238     DelayValueIsDefault(FALSE)
00239 {
00240     g_AnimationLoopCount = 1;
00241 }


Member Function Documentation

BOOL GIFExportOptions::CopyFrom BitmapExportOptions pSource  )  [virtual]
 

Sets the contents of this object from the passed object See Also: BitmapExportOptions::MakeCopy().

Author:
Stefan_Stoykov (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/05/97
Parameters:
pSource - the other BitmapExportOptions object to copy the data from [INPUTS]

Reimplemented from MaskedFilterExportOptions.

Definition at line 256 of file giffiltr.cpp.

00257 {
00258     // copy the base class first
00259     if (!MaskedFilterExportOptions::CopyFrom(pSource))
00260         return FALSE;
00261 
00262     // must be the same class, otherwise the base class  function above returns FALSE
00263     GIFExportOptions *pOther = (GIFExportOptions *)pSource;
00264 
00265     m_AnimDelay         = pOther->m_AnimDelay;
00266     m_AnimDispose       = pOther->m_AnimDispose;
00267     m_AnimLoop          = pOther->m_AnimLoop;
00268     DelayValueIsDefault = pOther->DelayValueIsDefault;
00269     DelayIndex          = pOther->DelayIndex;
00270     RestoreIndex        = pOther->RestoreIndex;
00271     m_GlobalPalette     = pOther->m_GlobalPalette;
00272     m_LeftOffset        = pOther->m_LeftOffset;
00273     m_TopOffset         = pOther->m_TopOffset;
00274     m_AnimSize          = pOther->m_AnimSize;
00275 
00276     return TRUE;
00277 };

BOOL GIFExportOptions::Declare  )  [static]
 

To declare preferences associated with these export options.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com> (from Peter)
Date:
29/10/96
Returns:
TRUE if successfully declared preferences FALSE otherwise

Reimplemented from MaskedFilterExportOptions.

Definition at line 176 of file giffiltr.cpp.

00177 {
00178     if (Camelot.DeclareSection(_T("Filters"), 10))
00179     {
00180         Camelot.DeclarePref( NULL, _T("ExportGIFtype"), &g_DefaultGIFType, 0, 3 );
00181         Camelot.DeclarePref( NULL, _T("AnimationDelay"), &g_AnimationDelay, 0, 65535 );
00182         Camelot.DeclarePref( NULL, _T("AnimationRestoreType"), (INT32*)&g_AnimationRestoreType, 0, 3 );
00183         Camelot.DeclarePref( NULL, _T("AnimationLoopCount"), &g_AnimationLoopCount, 0, 65535 );
00184     }
00185 
00186     // All ok
00187     return TRUE;
00188 }

static void GIFExportOptions::DecListSize UINT32  n  )  [inline, static]
 

Definition at line 188 of file giffiltr.h.

00188 { m_ListSize -= n;   } 

BOOL GIFExportOptions::FileTypeChangeCopyFrom BitmapExportOptions pOther  )  [virtual]
 

Copies the information from the BitmapExportOptions object passed in as the argument to the variables in this class.

Author:
Alex_Price (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/10/99
Parameters:
pOther - A BitmapExportOptions object we want to make a copy of. [INPUTS]
Returns:
-

Reimplemented from MaskedFilterExportOptions.

Definition at line 280 of file giffiltr.cpp.

00281 {
00282     if( !MaskedFilterExportOptions::FileTypeChangeCopyFrom(pOther) )
00283         return FALSE;
00284 
00285     //  Since we are not copying from another GIFOptions-based object, then the variables
00286     //  in this object must be assigned some default values.
00287     m_AnimDelay             = g_AnimationDelay;
00288     m_AnimDispose           = (GIFDisposalMethod)g_AnimationRestoreType;
00289     m_AnimLoop              = g_AnimationLoopCount;
00290 
00291     g_AnimationLoopCount    = 1;
00292     DelayValueIsDefault     = FALSE;
00293     DelayIndex              = 0;
00294     RestoreIndex            = 0;
00295 
00296     m_GlobalPalette         = TRUE;
00297     m_LeftOffset            = 0;
00298     m_TopOffset             = 0;
00299 
00300     // Graeme (14-9-00) - Limit the colour depth to be no more than 8bpp. Otherwise we get
00301     // problems with changing file types in the export dialogue.
00302     if ( GetDepth () > 8 )
00303     {
00304         SetDepth ( 8 );
00305     }
00306 
00307     return TRUE;
00308 }

CENTISECONDS GIFExportOptions::GetAnimationDelay  ) 
 

Support function to obtain export options.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
The delay desired for animated GIFs

Definition at line 480 of file giffiltr.cpp.

00481 {
00482     //  return m_AnimDelay;
00483     UINT32 Delay = m_pBitmapList[DelayIndex]->GetDelay();
00484     DelayIndex++;
00485     return Delay;
00486 }

UINT32 GIFExportOptions::GetAnimationLoopCount  )  const
 

Support function to obtain export options See Also: SetAnimationLoopCount().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
How loopy our animated GIF will be

Definition at line 559 of file giffiltr.cpp.

00560 {
00561     return m_AnimLoop;
00562 }

GIFDisposalMethod GIFExportOptions::GetAnimationRestore  ) 
 

Support function to obtain export options.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
The disposal method to be used in animated GIFs

Definition at line 519 of file giffiltr.cpp.

00520 {
00521     // return m_AnimDispose;
00522     GIFDisposalMethod Restore = m_pBitmapList[RestoreIndex]->GetActualBitmap()->GetAnimationRestoreType();
00523     RestoreIndex++;
00524     return Restore;
00525 }

Coord GIFExportOptions::GetAnimationSize  )  const
 

static KernelBitmap** GIFExportOptions::GetBitmapList  )  [inline, static]
 

Definition at line 182 of file giffiltr.h.

00182 { return m_pBitmapList; }

BOOL GIFExportOptions::GetDelayValueIsDefault  )  const [inline]
 

Definition at line 179 of file giffiltr.h.

00179 { return DelayValueIsDefault; }

virtual UINT32 GIFExportOptions::GetFilterNameStrID  )  [inline, virtual]
 

Reimplemented from BitmapExportOptions.

Definition at line 199 of file giffiltr.h.

00199 { return _R(IDN_FILTERNAME_GIF);}

BOOL GIFExportOptions::GetGlobalPalette  )  const [inline]
 

Definition at line 158 of file giffiltr.h.

00158 { return m_GlobalPalette; }

UINT32 GIFExportOptions::GetLeftOffset  )  const [inline]
 

Definition at line 161 of file giffiltr.h.

00161 { return m_LeftOffset; }

static UINT32 GIFExportOptions::GetListSize  )  [inline, static]
 

Definition at line 185 of file giffiltr.h.

00185 { return m_ListSize; }

virtual BOOL GIFExportOptions::GetSupportsImageMap  )  [inline, virtual]
 

Reimplemented from BitmapExportOptions.

Definition at line 156 of file giffiltr.h.

00156 { return TRUE; }

UINT32 GIFExportOptions::GetTopOffset  )  const [inline]
 

Definition at line 164 of file giffiltr.h.

00164 { return m_TopOffset; }

static void GIFExportOptions::IncListSize UINT32  n  )  [inline, static]
 

Definition at line 187 of file giffiltr.h.

00187 { m_ListSize += n;   }  

BOOL GIFExportOptions::Read CXaraFileRecord pRec  )  [virtual]
 

Reads this object from the given record.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/2/00
Parameters:
pRec --- record to read [INPUTS]
Returns:
TRUE if successful.
See also:
GIFExportOptions::Write

Reimplemented from MaskedFilterExportOptions.

Definition at line 452 of file giffiltr.cpp.

00453 {
00454     m_GlobalPalette = DelayValueIsDefault = FALSE;
00455     return MaskedFilterExportOptions::Read(pRec) &&
00456            pRec->ReadUINT32((UINT32*) &DelayIndex) &&
00457            pRec->ReadUINT32((UINT32*) &RestoreIndex) &&
00458            pRec->ReadBYTE((BYTE*) &m_GlobalPalette) &&
00459            pRec->ReadUINT32((UINT32*) &m_LeftOffset) &&
00460            pRec->ReadUINT32((UINT32*) &m_TopOffset) &&
00461            pRec->ReadUINT32((UINT32*) &m_AnimDelay) &&
00462            pRec->ReadINT16((INT16*) &m_AnimDispose) &&
00463            pRec->ReadUINT32((UINT32*) &m_AnimLoop) &&
00464            pRec->ReadCoord((DocCoord*) &m_AnimSize) &&
00465            pRec->ReadBYTE((BYTE*) &DelayValueIsDefault);
00466 }

BOOL GIFExportOptions::RetrieveDefaults  )  [virtual]
 

Compares the contents of this and pOther objects See BitmapExportOptions for interface details Notes: Gets GIF specific preferences.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96

Reimplemented from MaskedFilterExportOptions.

Definition at line 355 of file giffiltr.cpp.

00356 {
00357     if (!MaskedFilterExportOptions::RetrieveDefaults())
00358     {
00359         return FALSE;
00360     }
00361 
00362     ERROR2IF(g_AnimationRestoreType != GDM_NONE && g_AnimationRestoreType != GDM_LEAVE &&
00363             g_AnimationRestoreType != GDM_BACKTOBACK && g_AnimationRestoreType != GDM_PREVIOUS,
00364             FALSE, "Invalid g_AnimationRestoreType");
00365 
00366     // Ensure that the depth is no more than 8 bits.
00367     if ( GetDepth () > 8 )
00368     {
00369         this->SetDepth ( 8 );
00370     }
00371 
00372     m_AnimDelay     = g_AnimationDelay;
00373     m_AnimDispose   = g_AnimationRestoreType;
00374     m_AnimLoop      = g_AnimationLoopCount;
00375 
00376 //  SetMakeTransparent((g_DefaultGIFType >> 1) & 1);
00377     SetMakeInterlaced(g_DefaultGIFType & 1);
00378 
00379     return TRUE;
00380 }

BOOL GIFExportOptions::SetAnimationDelay CENTISECONDS  Delay  ) 
 

Support function to set up information for the ensuing export See Also: GetAnimationDelay().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Parameters:
Delay : The desired delay to be set in the animated GIF [INPUTS]
Returns:
TRUE if set successfully FALSE otherwise

Definition at line 502 of file giffiltr.cpp.

00503 {
00504     m_AnimDelay = Delay;
00505     return TRUE;
00506 }

BOOL GIFExportOptions::SetAnimationLoopCount UINT32  LoopCount,
BOOL  Value
 

Support function to set up information for the ensuing export See Also: GetAnimationLoopCount().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Parameters:
LoopCount : For Animated GIFs: 0 = Repeat forever, 1 = One shot animation. [INPUTS] n = Plays animation n times.
Returns:
TRUE if set successfully FALSE otherwise

Definition at line 579 of file giffiltr.cpp.

00580 {
00581     if(Value)
00582     {
00583         m_AnimLoop = ZERO;
00584         return TRUE;
00585     }
00586     else
00587     {
00588         m_AnimLoop = LoopCount;
00589         return TRUE;
00590     }
00591 }

BOOL GIFExportOptions::SetAnimationRestore const GIFDisposalMethod DisposalMethod  ) 
 

Support function to set up information for the ensuing export See Also: GetAnimationRestore(), enum GIFDisposalMethod.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Parameters:
DisposalMethod : The desired DisposalMethod to be set in the animated GIF [INPUTS]
Returns:
TRUE if set successfully FALSE otherwise

Definition at line 541 of file giffiltr.cpp.

00542 {
00543     m_AnimDispose = DisposalMethod;
00544     return TRUE;
00545 }

BOOL GIFExportOptions::SetAnimationSize const Coord Size  ) 
 

BOOL GIFExportOptions::SetAsDefaults  )  const [virtual]
 

Provides additional implementation to set GIF specific info as defaults See Also: BitmapExportOptions::SetAsDefaults().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96

Reimplemented from MaskedFilterExportOptions.

Definition at line 393 of file giffiltr.cpp.

00394 {
00395     if (!MaskedFilterExportOptions::SetAsDefaults())
00396     {
00397         return FALSE;
00398     }
00399 
00400     g_AnimationDelay        = m_AnimDelay;
00401     
00402     g_AnimationRestoreType  = m_AnimDispose;
00403     g_AnimationLoopCount    = m_AnimLoop;
00404 
00405     g_DefaultGIFType = WantTransparent() ? 2 : 0;
00406     g_DefaultGIFType |= WantInterlaced() ? 1 : 0;
00407 
00408     return TRUE;
00409 }

static void GIFExportOptions::SetBitmapList KernelBitmap **  pBitmap  )  [inline, static]
 

Definition at line 183 of file giffiltr.h.

00183 { m_pBitmapList = pBitmap; }

BOOL GIFExportOptions::SetDelayValueIsDefault BOOL  Value  )  [inline]
 

Definition at line 180 of file giffiltr.h.

00180 { DelayValueIsDefault = Value; return TRUE; }

void GIFExportOptions::SetGlobalPalette UINT32  GlobalPalette  )  [inline]
 

Definition at line 159 of file giffiltr.h.

00159 { m_GlobalPalette = GlobalPalette; }

void GIFExportOptions::SetLeftOffset UINT32  LeftOffset  )  [inline]
 

Definition at line 162 of file giffiltr.h.

00162 { m_LeftOffset = LeftOffset; }

static void GIFExportOptions::SetListSize UINT32  n  )  [inline, static]
 

Definition at line 186 of file giffiltr.h.

00186 { m_ListSize = n;    }

void GIFExportOptions::SetTopOffset UINT32  TopOffset  )  [inline]
 

Definition at line 165 of file giffiltr.h.

00165 { m_TopOffset = TopOffset; }

BOOL GIFExportOptions::Write CXaraFileRecord pRec  )  [virtual]
 

Writes this object to the given record.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/2/00
Parameters:
pRec --- record to write [INPUTS]
Returns:
TRUE if successful.
See also:
GIFExportOptions::Read

Reimplemented from MaskedFilterExportOptions.

Definition at line 424 of file giffiltr.cpp.

00425 {
00426     return MaskedFilterExportOptions::Write(pRec) &&
00427            pRec->WriteUINT32(DelayIndex) &&
00428            pRec->WriteUINT32(RestoreIndex) &&
00429            pRec->WriteBYTE((BYTE) !!m_GlobalPalette) &&
00430            pRec->WriteUINT32(m_LeftOffset) &&
00431            pRec->WriteUINT32(m_TopOffset) &&
00432            pRec->WriteUINT32((UINT32) m_AnimDelay) &&
00433            pRec->WriteINT16((INT16) m_AnimDispose) &&
00434            pRec->WriteUINT32(m_AnimLoop) &&
00435            pRec->WriteCoord((const DocCoord&) m_AnimSize) &&
00436            pRec->WriteBYTE((BYTE) !!DelayValueIsDefault);
00437 }


Member Data Documentation

UINT32 GIFExportOptions::DelayIndex
 

Definition at line 196 of file giffiltr.h.

BOOL GIFExportOptions::DelayValueIsDefault [protected]
 

Definition at line 210 of file giffiltr.h.

CENTISECONDS GIFExportOptions::g_AnimationDelay = 10 [static, protected]
 

Definition at line 215 of file giffiltr.h.

UINT32 GIFExportOptions::g_AnimationLoopCount = 1 [static, protected]
 

Definition at line 217 of file giffiltr.h.

GIFDisposalMethod GIFExportOptions::g_AnimationRestoreType = GDM_LEAVE [static, protected]
 

Definition at line 216 of file giffiltr.h.

CENTISECONDS GIFExportOptions::m_AnimDelay [protected]
 

Definition at line 206 of file giffiltr.h.

GIFDisposalMethod GIFExportOptions::m_AnimDispose [protected]
 

Definition at line 207 of file giffiltr.h.

UINT32 GIFExportOptions::m_AnimLoop [protected]
 

Definition at line 208 of file giffiltr.h.

Coord GIFExportOptions::m_AnimSize [protected]
 

Definition at line 209 of file giffiltr.h.

BOOL GIFExportOptions::m_GlobalPalette [protected]
 

Definition at line 203 of file giffiltr.h.

UINT32 GIFExportOptions::m_LeftOffset [protected]
 

Definition at line 204 of file giffiltr.h.

UINT32 GIFExportOptions::m_ListSize = 0 [static, protected]
 

Definition at line 212 of file giffiltr.h.

KernelBitmap ** GIFExportOptions::m_pBitmapList = NULL [static, protected]
 

Definition at line 211 of file giffiltr.h.

UINT32 GIFExportOptions::m_TopOffset [protected]
 

Definition at line 205 of file giffiltr.h.

UINT32 GIFExportOptions::RestoreIndex
 

Definition at line 197 of file giffiltr.h.


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