MaskedFilterExportOptions Class Reference

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

#include <maskfilt.h>

Inheritance diagram for MaskedFilterExportOptions:

BitmapExportOptions OpParam CCObject SimpleCCObject GIFExportOptions ImageMagickExportOptions MakeBitmapExportOptions PNGExportOptions List of all members.

Public Member Functions

 MaskedFilterExportOptions ()
 Default constructor Notes: This is a base class for GIF, PNG, etc.. Since MakedFilter doesn't provide a CreateExportOptions() member subclasses should either derive a new class from this one or provide objects of this class in their CreateExportOptions().
 MaskedFilterExportOptions (const CDlgResID &Dialog, const FilterType FilterID, const StringBase *pFilterName)
 Constructor Notes: This is a base class for GIF, PNG, etc.. Since MakedFilter doesn't provide a CreateExportOptions() member subclasses should either derive a new class from this one or provide objects of this class in their CreateExportOptions().
virtual BOOL RetrieveDefaults ()
 See BitmapExportOptions for interface details Notes: Gets MaskedFilter specific preferences (compression mainly).
virtual BOOL SetAsDefaults () const
 See BitmapExportOptions for interface details Notes: Sets MaskedFilter specific preferences.
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 DITHER GetDither () const
virtual BOOL SetDither (const DITHER &Dither)
 Support function to set up information for the ensuing export See Also: GetDither().
BOOL WantTransparent () const
 Support function to obtain export options See Also: SetMakeTransparent().
BOOL WantInterlaced () const
BOOL SetMakeInterlaced (BOOL bInterlaced)
 Support function to set up information for the ensuing export See Also: WantInterlaced().
void SetFilterType (FilterType ID)
virtual BOOL UseSpecificNumColsInPalette ()
 Masked filters have the ability to specify the exact number of colours in the generated optimised palette.
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.
BOOL CopyFromMasked (MaskedFilterExportOptions *pOther)
 Compares the contents of this and pOther objects Sets the contents of this object from the passed object. This differs form the more general function in that it doesn't require the two objects to be of the same class. Used to convert from/to PNG options and MakeBitmapExportOptions. See Also: BitmapExportOptions::MakeCopy().

Static Public Member Functions

static BOOL Declare ()
 To declare preferences associated with these export options.

Protected Attributes

DITHER m_Dither
BOOL m_bInterlaced

Static Protected Attributes

static DITHER g_Dither = XARADITHER_NONE
static PALETTE g_Palette = PAL_OPTIMISED
static BOOL g_bTransparent
static BOOL g_bInterlaced

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 121 of file maskfilt.h.


Constructor & Destructor Documentation

MaskedFilterExportOptions::MaskedFilterExportOptions  ) 
 

Default constructor Notes: This is a base class for GIF, PNG, etc.. Since MakedFilter doesn't provide a CreateExportOptions() member subclasses should either derive a new class from this one or provide objects of this class in their CreateExportOptions().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Parameters:
Dialog : [INPUTS] pFilterName : the name of the filter

Definition at line 179 of file maskfilt.cpp.

00180   : m_Dither(XARADITHER_NONE),                          // Dither type
00181     m_bInterlaced(FALSE)
00182 {
00183     m_NumColsInPalette = g_NumColsInPalette;            // override base class
00184     m_UseSystemColours = g_UseSystemColours;
00185 }

MaskedFilterExportOptions::MaskedFilterExportOptions const CDlgResID Dialog,
const FilterType  FilterID,
const StringBase pFilterName
 

Constructor Notes: This is a base class for GIF, PNG, etc.. Since MakedFilter doesn't provide a CreateExportOptions() member subclasses should either derive a new class from this one or provide objects of this class in their CreateExportOptions().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Parameters:
Dialog : [INPUTS] pFilterName : the name of the filter

Definition at line 200 of file maskfilt.cpp.

00202   : BitmapExportOptions(Dialog, FilterID, pFilterName),
00203     m_Dither(XARADITHER_NONE),                          // Dither type
00204     m_bInterlaced(FALSE)
00205 {
00206     m_NumColsInPalette = g_NumColsInPalette;            // override base class
00207     m_UseSystemColours = g_UseSystemColours;
00208 }


Member Function Documentation

BOOL MaskedFilterExportOptions::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 BitmapExportOptions.

Reimplemented in MakeBitmapExportOptions, and GIFExportOptions.

Definition at line 221 of file maskfilt.cpp.

00222 {
00223     // copy the base class first
00224     if (!BitmapExportOptions::CopyFrom(pSource))
00225         return FALSE;
00226 
00227     // must be the same class, otherwise the base class  function above returns FALSE
00228     MaskedFilterExportOptions *pOther = (MaskedFilterExportOptions *)pSource;
00229 
00230     m_Dither        = pOther->m_Dither;
00231     m_bInterlaced   = pOther->m_bInterlaced;
00232 
00233     return TRUE;
00234 }

BOOL MaskedFilterExportOptions::CopyFromMasked MaskedFilterExportOptions pOther  ) 
 

Compares the contents of this and pOther objects Sets the contents of this object from the passed object. This differs form the more general function in that it doesn't require the two objects to be of the same class. Used to convert from/to PNG options and MakeBitmapExportOptions. See Also: BitmapExportOptions::MakeCopy().

Author:
Stefan_Stoykov (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/07/97
Parameters:
pOther - the other MaskedFilterExportOptions object to copy the data from [INPUTS]

Definition at line 325 of file maskfilt.cpp.

00326 {
00327     if (pOther == NULL)
00328         return FALSE;
00329     
00330     //BitmapExportOptions members
00331     m_SelectionType     = pOther->m_SelectionType;
00332     m_OutputSize        = pOther->m_OutputSize;
00333     m_PixelOutputSize   = pOther->m_PixelOutputSize;
00334     m_pBmpDlgParam      = pOther->m_pBmpDlgParam;       
00335     m_NumColsInPalette  = pOther->m_NumColsInPalette;
00336     m_UseSystemColours  = pOther->m_UseSystemColours;
00337     m_bSeparateLayerFiles = pOther->m_bSeparateLayerFiles;
00338     m_bTempFileFlag     = pOther->m_bTempFileFlag;
00339 
00340     SetDPI(pOther->GetDPI());
00341     SetDepth(pOther->GetDepth());
00342     SetTransparencyIndex(pOther->GetTransparencyIndex());
00343     if (pOther->IsValid())
00344         MarkValid();
00345     else
00346         MarkInvalid();
00347 
00348     //MaskedFilterExportOptions
00349     m_Dither        = pOther->m_Dither;
00350     m_bInterlaced   = pOther->m_bInterlaced;
00351 
00352     return TRUE;
00353 }

BOOL MaskedFilterExportOptions::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 BitmapExportOptions.

Reimplemented in MakeBitmapExportOptions, GIFExportOptions, and PNGExportOptions.

Definition at line 154 of file maskfilt.cpp.

00155 {
00156     if (Camelot.DeclareSection(_T("Filters"), 10))
00157     {
00158         Camelot.DeclarePref( NULL, _T("Palette"), (INT32*)&g_Palette, 0, 1 );
00159         Camelot.DeclarePref( NULL, _T("NumColsInPalette"), (INT32*)&g_NumColsInPalette, 0, 256 );
00160         Camelot.DeclarePref( NULL, _T("UseSystemColours"), (INT32*)&g_UseSystemColours, 0, 1 );
00161     }
00162 
00163     // All ok
00164     return TRUE;
00165 }

BOOL MaskedFilterExportOptions::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 BitmapExportOptions.

Reimplemented in GIFExportOptions.

Definition at line 248 of file maskfilt.cpp.

00249 {
00250     //  Do the base class piece first
00251     if ( !BitmapExportOptions::FileTypeChangeCopyFrom( pOther ) )
00252         return FALSE;
00253 
00254     MaskedFilterExportOptions* pOther2 = ( MaskedFilterExportOptions* )pOther;
00255 
00256 PORTNOTE("BMPFilter", "Removed use of BmpExportOptions")
00257 #ifndef EXCLUDE_FROM_XARALX
00258     if ( pOther->IS_KIND_OF(BMPExportOptions) )
00259     {
00260         m_Dither        = pOther2->m_Dither;
00261         //  The following 2 don't exist in the bmp options.
00262         m_bInterlaced   = 0;
00263     }
00264     else
00265 #endif
00266     if ( pOther->IS_KIND_OF(JPEGExportOptions) )
00267     {
00268         //  None of these exist in the jpeg options.
00269         //  So, give them default values.
00270         m_Dither        = g_Dither;
00271         m_bInterlaced   = 0;
00272     }
00273     else
00274     {
00275         //  Just copy them over
00276         m_Dither        = pOther2->m_Dither;
00277         m_bInterlaced   = pOther2->m_bInterlaced;
00278     }
00279 
00280     return TRUE;
00281 }

virtual DITHER MaskedFilterExportOptions::GetDither  )  const [inline, virtual]
 

Reimplemented from BitmapExportOptions.

Definition at line 140 of file maskfilt.h.

00140 { return m_Dither; }

BOOL MaskedFilterExportOptions::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:
MaskedFilterExportOptions::Write

Reimplemented from BitmapExportOptions.

Reimplemented in GIFExportOptions.

Definition at line 444 of file maskfilt.cpp.

00445 {
00446     BYTE Unused;
00447     INT16 AlsoUnused;
00448     m_bInterlaced = FALSE;
00449     return BitmapExportOptions::Read(pRec) &&
00450            pRec->ReadINT16((INT16*) &m_Dither) &&
00451            pRec->ReadINT16((INT16*) &AlsoUnused /*m_Palette*/) &&
00452            pRec->ReadBYTE(&Unused) &&
00453            pRec->ReadBYTEtoBOOL(&m_bInterlaced);
00454 }

BOOL MaskedFilterExportOptions::RetrieveDefaults  )  [virtual]
 

See BitmapExportOptions for interface details Notes: Gets MaskedFilter specific preferences (compression mainly).

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

Reimplemented from BitmapExportOptions.

Reimplemented in MakeBitmapExportOptions, GIFExportOptions, ImageMagickExportOptions, and PNGExportOptions.

Definition at line 365 of file maskfilt.cpp.

00366 {
00367     if (!BitmapExportOptions::RetrieveDefaults())
00368         return FALSE;
00369 
00370 PORTNOTE("BMPFilter", "Remove use of GetDefaultExportDither")
00371 #ifndef EXCLUDE_FROM_XARALX
00372     UINT32 Dither = BMPFilter::GetDefaultExportDither();
00373     ERROR2IF(Dither > 4, FALSE, "Dither Invalid");
00374 #else
00375     UINT32 Dither = 0;
00376 #endif
00377     SetDither((DITHER)Dither);
00378 
00379     m_Dither  = g_Dither;
00380     m_NumColsInPalette = g_NumColsInPalette;
00381     m_UseSystemColours = g_UseSystemColours;
00382 
00383     return TRUE;
00384 }

BOOL MaskedFilterExportOptions::SetAsDefaults  )  const [virtual]
 

See BitmapExportOptions for interface details Notes: Sets MaskedFilter specific preferences.

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

Reimplemented from BitmapExportOptions.

Reimplemented in MakeBitmapExportOptions, GIFExportOptions, ImageMagickExportOptions, and PNGExportOptions.

Definition at line 396 of file maskfilt.cpp.

00397 {
00398 PORTNOTE("BMPFilter", "Removed use of BmpExportOptions")
00399 #ifndef EXCLUDE_FROM_XARALX
00400     if (!BitmapExportOptions::SetAsDefaults())
00401         return FALSE;
00402 
00403     BMPFilter::SetDefaultExportDither(GetDither());
00404 #endif
00405 
00406     // Derived classes can do their own thing with these...
00407     // m_bInterlaced;
00408     g_Dither  = m_Dither;
00409     g_NumColsInPalette = m_NumColsInPalette;
00410     g_UseSystemColours = m_UseSystemColours;
00411 
00412     return TRUE;
00413 }

BOOL MaskedFilterExportOptions::SetDither const DITHER Dither  )  [virtual]
 

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

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Parameters:
Dither : The desired dither to be applied to the bitmap before being exported [INPUTS]
Returns:
TRUE if set successfully FALSE otherwise

Reimplemented from BitmapExportOptions.

Definition at line 491 of file maskfilt.cpp.

00492 {
00493     if (m_Dither != Dither)
00494         SetTempFileMatchesExportOptions(FALSE);
00495     m_Dither = Dither;
00496     return TRUE;
00497 }

void MaskedFilterExportOptions::SetFilterType FilterType  ID  )  [inline]
 

Definition at line 147 of file maskfilt.h.

00147 {   m_FilterID = ID;    }

BOOL MaskedFilterExportOptions::SetMakeInterlaced BOOL  bInterlaced  ) 
 

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

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Parameters:
bInterlaced : TRUE to indicate the exported bitmap should be interlaced [INPUTS] ...somehow; FALSE for normal non-interlaced mode
Returns:
TRUE if set successfully FALSE otherwise

Definition at line 530 of file maskfilt.cpp.

00531 {
00532     if (m_bInterlaced != bInterlaced)
00533         SetTempFileMatchesExportOptions(FALSE);
00534     m_bInterlaced = bInterlaced;
00535     return TRUE;
00536 }

BOOL MaskedFilterExportOptions::UseSpecificNumColsInPalette  )  [virtual]
 

Masked filters have the ability to specify the exact number of colours in the generated optimised palette.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/1/97
Returns:
TRUE if the options define a specific number of colours in the palette
This only returns TRUE if we are generating a bitmap from objects in the document. It is not available when exporting a bitmap directly, as it will already have a palette

Introduced for WEBSTER

Reimplemented from BitmapExportOptions.

Definition at line 472 of file maskfilt.cpp.

00473 {
00474     // Don't use specific num colours when exporting bitmaps
00475     return (GetSelectionType() != ABITMAP && GetSelectionType() != SOMEBITMAPS);
00476 }

BOOL MaskedFilterExportOptions::WantInterlaced  )  const [inline]
 

Definition at line 144 of file maskfilt.h.

00144 { return m_bInterlaced; }

BOOL MaskedFilterExportOptions::WantTransparent  )  const
 

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

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
TRUE if the bitmap should be exported interlaced, FALSE not

Definition at line 510 of file maskfilt.cpp.

00511 {
00512     // smfix - only go on the transp index
00513     return GetTransparencyIndex() != -1;
00514 }

BOOL MaskedFilterExportOptions::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:
MaskedFilterExportOptions::Read

Reimplemented from BitmapExportOptions.

Reimplemented in GIFExportOptions.

Definition at line 425 of file maskfilt.cpp.

00426 {
00427     return BitmapExportOptions::Write(pRec) &&
00428            pRec->WriteINT16((INT16) m_Dither) &&
00429            pRec->WriteINT16((INT16) 0 /*m_Palette*/) &&
00430            pRec->WriteBYTE((BYTE) TRUE) &&
00431            pRec->WriteBYTE((BYTE) !!m_bInterlaced);
00432 }


Member Data Documentation

BOOL MaskedFilterExportOptions::g_bInterlaced [static, protected]
 

Definition at line 172 of file maskfilt.h.

BOOL MaskedFilterExportOptions::g_bTransparent [static, protected]
 

Definition at line 171 of file maskfilt.h.

DITHER MaskedFilterExportOptions::g_Dither = XARADITHER_NONE [static, protected]
 

Reimplemented in MakeBitmapExportOptions.

Definition at line 169 of file maskfilt.h.

PALETTE MaskedFilterExportOptions::g_Palette = PAL_OPTIMISED [static, protected]
 

Reimplemented in MakeBitmapExportOptions.

Definition at line 170 of file maskfilt.h.

BOOL MaskedFilterExportOptions::m_bInterlaced [protected]
 

Definition at line 166 of file maskfilt.h.

DITHER MaskedFilterExportOptions::m_Dither [protected]
 

Definition at line 165 of file maskfilt.h.


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