BMPExportOptions Class Reference

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

#include <bmpfiltr.h>

Inheritance diagram for BMPExportOptions:

BitmapExportOptions OpParam CCObject SimpleCCObject List of all members.

Public Member Functions

 BMPExportOptions ()
 Default constructor.
 BMPExportOptions (const FilterType FilterID, const StringBase *pFilterName)
 Constructor for a BMPExportOptions object to provide BMP specific options.
virtual BOOL RetrieveDefaults ()
 Compares the contents of this and pOther objects Gets GIF specific preferences Notes: See BitmapExportOptions for interface details.
virtual BOOL SetAsDefaults () const
 Provides additional implementation to set GIF specific info as defaults See Also: BitmapExportInfo::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 ()
virtual DITHER GetDither () const
 Support function to obtain export options.
virtual BOOL SetDither (const DITHER &Dither)
 Support function to set up information for the ensuing export See Also: GetDither().
PALETTE GetPalette () const
 Support function to obtain export options.
BOOL SetPalette (const PALETTE &Palette)
 Support function to set up information for the ensuing export See Also: GetPalette().
BMP_COMPRESSION GetCompression () const
 Support function to obtain export options.
BOOL SetCompression (const BMP_COMPRESSION &Compression)
 Support function to set up information for the ensuing export See Also: GetCompression().
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 palette object in this class.
virtual UINT32 GetFilterNameStrID ()

Protected Attributes

DITHER m_Dither
PALETTE m_Palette
BMP_COMPRESSION m_Compression

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 128 of file bmpfiltr.h.


Constructor & Destructor Documentation

BMPExportOptions::BMPExportOptions  ) 
 

Default constructor.

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

Definition at line 142 of file bmpfiltr.cpp.

00143   : m_Dither(XARADITHER_NONE),
00144     m_Palette(DefaultExportPalette),
00145     m_Compression(BMP_RGB)
00146 {
00147     // Empty.
00148 }

BMPExportOptions::BMPExportOptions const FilterType  FilterID,
const StringBase pFilterName
 

Constructor for a BMPExportOptions object to provide BMP specific options.

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

Definition at line 161 of file bmpfiltr.cpp.

00162   : BitmapExportOptions(_R(IDD_EXPORTBMPOPTS), FilterID, pFilterName),
00163     m_Dither(XARADITHER_NONE),
00164     m_Palette(DefaultExportPalette),
00165     m_Compression(BMP_RGB)
00166 {
00167     // Empty.
00168 }


Member Function Documentation

BOOL BMPExportOptions::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.

Definition at line 183 of file bmpfiltr.cpp.

00184 {
00185     // copy the base class first
00186     if (!BitmapExportOptions::CopyFrom(pSource))
00187         return FALSE;
00188 
00189     // must be the same class, otherwise the base class  function above returns FALSE
00190     BMPExportOptions *pOther = (BMPExportOptions *)pSource;
00191 
00192     m_Dither        = pOther->m_Dither;
00193     m_Palette       = pOther->m_Palette;
00194     m_Compression   = pOther->m_Compression;
00195 
00196     return TRUE;
00197 };

BOOL BMPExportOptions::FileTypeChangeCopyFrom BitmapExportOptions pSource  )  [virtual]
 

Copies the information from the BitmapExportOptions object passed in as the argument to the palette object 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.

Definition at line 200 of file bmpfiltr.cpp.

00201 {
00202     ASSERT(FALSE);
00203     /*
00204     // copy the base class first
00205     if (!BitmapExportOptions::FileTypeChangeCopyFrom(pSource))
00206         return FALSE;
00207 
00208     BMPExportOptions* pOther = (BMPExportOptions*)pSource;
00209 
00210     //  Coming from a jpeg image
00211     if( pOther->IS_KIND_OF(JPEGExportOptions) )
00212     {
00213         m_Dither    = XARADITHER_NONE;
00214         m_Palette   = DefaultExportPalette;
00215     }
00216     else
00217     {
00218         //  Coming from a gif or png image.
00219         m_Dither    = pOther->m_Dither;
00220         m_Palette   = pOther->m_Palette;
00221     }
00222 
00223     m_Compression   = BMP_RGB;
00224 
00225     // Ensure that the bitmap depth is less than 32 bpp.
00226     if( GetDepth() == 32 )
00227     {
00228         SetDepth( 24 );
00229     }
00230 */
00231     return TRUE;
00232 }

BMP_COMPRESSION BMPExportOptions::GetCompression  )  const
 

Support function to obtain export options.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
The compression desired for BMP bitmap export

Definition at line 446 of file bmpfiltr.cpp.

00447 {
00448     return m_Compression;
00449 }

DITHER BMPExportOptions::GetDither  )  const [virtual]
 

Support function to obtain export options.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
The dither desired for the bitmap to export

Reimplemented from BitmapExportOptions.

Definition at line 371 of file bmpfiltr.cpp.

00372 {
00373     return m_Dither;
00374 }

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

Reimplemented from BitmapExportOptions.

Definition at line 158 of file bmpfiltr.h.

00158 { return _R(IDT_FILTERNAME_BMP) /*_R(IDN_FILTERNAME_ACCUSOFTBMP)*/ /*_R(IDT_BMP_FILTERNAME) */;}

PALETTE BMPExportOptions::GetPalette  )  const
 

Support function to obtain export options.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
The palette desired to be exported with the bitmap

Definition at line 409 of file bmpfiltr.cpp.

00410 {
00411     return m_Palette;
00412 }

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

Reimplemented from BitmapExportOptions.

Definition at line 142 of file bmpfiltr.h.

00142 { return TRUE; }

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

Reimplemented from BitmapExportOptions.

Definition at line 351 of file bmpfiltr.cpp.

00352 {
00353     return BitmapExportOptions::Read(pRec) &&
00354            pRec->ReadINT16((INT16*) &m_Dither) &&
00355            pRec->ReadINT16((INT16*) &m_Palette) &&
00356            pRec->ReadINT16((INT16*) &m_Compression);
00357 }

BOOL BMPExportOptions::RetrieveDefaults  )  [virtual]
 

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

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

Reimplemented from BitmapExportOptions.

Definition at line 275 of file bmpfiltr.cpp.

00276 {
00277     if (!BitmapExportOptions::RetrieveDefaults())
00278     {
00279         return FALSE;
00280     }
00281 
00282     SetDither((DITHER)BMPFilter::GetDefaultExportDither());
00283     SetPalette(DefaultExportPalette);
00284 
00285     BOOL Compression = DefaultExportCompression;
00286     ERROR2IF(Compression > 1, FALSE, "Invalid Compression");
00287     SetCompression((BMP_COMPRESSION)Compression);
00288 
00289     return TRUE;
00290 }

BOOL BMPExportOptions::SetAsDefaults  )  const [virtual]
 

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

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

Reimplemented from BitmapExportOptions.

Definition at line 303 of file bmpfiltr.cpp.

00304 {
00305     if (!BitmapExportOptions::SetAsDefaults())
00306     {
00307         return FALSE;
00308     }
00309 
00310     BMPFilter::SetDefaultExportDither(GetDither());
00311     DefaultExportCompression    = (BOOL)GetCompression();
00312     DefaultExportPalette        = GetPalette();
00313 
00314     return TRUE;
00315 }

BOOL BMPExportOptions::SetCompression const BMP_COMPRESSION Compression  ) 
 

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

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Parameters:
Compression : The compression to be used for the export [INPUTS]
Returns:
TRUE if set successfully FALSE otherwise

Definition at line 465 of file bmpfiltr.cpp.

00466 {
00467     ERROR2IF(Compression != BMP_RLE && Compression != BMP_RGB, FALSE, "Invalid Compression");
00468 
00469     m_Compression = Compression;
00470 
00471     return TRUE;
00472 }

BOOL BMPExportOptions::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 390 of file bmpfiltr.cpp.

00391 {
00392     if (m_Dither != Dither)
00393         SetTempFileMatchesExportOptions(FALSE);
00394     m_Dither = Dither;
00395     return TRUE;
00396 }

BOOL BMPExportOptions::SetPalette const PALETTE Palette  ) 
 

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

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

Definition at line 428 of file bmpfiltr.cpp.

00429 {
00430     m_Palette = Palette;
00431     return TRUE;
00432 }

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

Reimplemented from BitmapExportOptions.

Definition at line 330 of file bmpfiltr.cpp.

00331 {
00332     return BitmapExportOptions::Write(pRec) &&
00333            pRec->WriteINT16((INT16) m_Dither) &&
00334            pRec->WriteINT16((INT16) m_Palette) &&
00335            pRec->WriteINT16((INT16) m_Compression);
00336 }


Member Data Documentation

BMP_COMPRESSION BMPExportOptions::m_Compression [protected]
 

Definition at line 165 of file bmpfiltr.h.

DITHER BMPExportOptions::m_Dither [protected]
 

Definition at line 163 of file bmpfiltr.h.

PALETTE BMPExportOptions::m_Palette [protected]
 

Reimplemented from BitmapExportOptions.

Definition at line 164 of file bmpfiltr.h.


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