PreviewFilterBMP Class Reference

The filter will save out the BMP Preview Bitmap. Overrides GetExportOptions so dialogs are not put up but returns preview export options. More...

#include <prvwflt.h>

Inheritance diagram for PreviewFilterBMP:

BMPFilter BaseBitmapFilter BitmapFilter Filter ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 PreviewFilterBMP ()
 Constructor for an PreviewFilterBMP object. The object should be initialised before use.
BOOL Init ()
 Initialise an PreviewFilter object.
virtual BOOL DoExport (Operation *, CCLexFile *, PathName *, Document *, BOOL)
 Do some set up before exporting so the BaseBitmapFilter base class knows it is really a preview. The BaseBitmapFilter can then do resizing as necessary.

Protected Member Functions

virtual BOOL GetExportOptions (BitmapExportOptions *pOptions)
 Override base class so we don't put up a dialog but still provide fixed options for preview bitmap filters. Notes: See BaseBitmapFilter for interface details.

Private Member Functions

 CC_DECLARE_DYNAMIC (PreviewFilterBMP)

Detailed Description

The filter will save out the BMP Preview Bitmap. Overrides GetExportOptions so dialogs are not put up but returns preview export options.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/95

Definition at line 170 of file prvwflt.h.


Constructor & Destructor Documentation

PreviewFilterBMP::PreviewFilterBMP  ) 
 

Constructor for an PreviewFilterBMP object. The object should be initialised before use.

/

/*!

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/95
See also:
PreviewFilterBMP::Init

Definition at line 301 of file prvwflt.cpp.

00301                                    : BMPFilter()
00302 {
00303     ImportMsgID = _R(IDT_IMPORTMSG_BMP);
00304     
00305     // Set it up so that it can neither Import or Export so that it does not appear in the
00306     // Filter menus.
00307     Flags.CanImport = FALSE;
00308     Flags.CanExport = FALSE;
00309     FilterID = FILTERID_PREVIEW_BMP;
00310 
00311     ExportRegion = NULL;
00312     ExportMsgID = _R(IDS_BUILDINGPREVIEW);
00313     ExportingMsgID = _R(IDS_BUILDINGPREVIEW);
00314 }


Member Function Documentation

PreviewFilterBMP::CC_DECLARE_DYNAMIC PreviewFilterBMP   )  [private]
 

BOOL PreviewFilterBMP::DoExport Operation pOp,
CCLexFile pFile,
PathName pPath,
Document TheDocument,
BOOL  ShowOptions
[virtual]
 

Do some set up before exporting so the BaseBitmapFilter base class knows it is really a preview. The BaseBitmapFilter can then do resizing as necessary.

Author:
Martin_Bell (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/01/97
Notes: copied from BaseCamelotFilter::ExportPreviewBitmap which does the set up for us usually (why?). We repeat it here so the _BATCHING thumnail generation stuff is the right size as well.

Reimplemented from BaseBitmapFilter.

Definition at line 361 of file prvwflt.cpp.

00363 {
00364     INT32 OldPreviewSize = PreviewFilter::PreviewBitmapSize;
00365     // Set the Preview to be just over an inch accross
00366     PreviewFilter::PreviewBitmapSize = 96000;
00367 
00368     // set ourselves up - this flags the BaseBitmapFilter to do resizing, which needs to be
00369     // done there because of Accusoft.
00370     SetPreviewBitmap(TRUE);
00371 
00372     // Export the Preview to the file by doing what our base class does
00373     BOOL ok = BMPFilter::DoExport(pOp, pFile, pPath, TheDocument, TRUE);
00374 
00375     // Set ourselves back
00376     SetPreviewBitmap(FALSE);
00377     // Set the Preview back to its default setting
00378     PreviewFilter::PreviewBitmapSize = OldPreviewSize;
00379 
00380     return ok;
00381 }

BOOL PreviewFilterBMP::GetExportOptions BitmapExportOptions pOptions  )  [protected, virtual]
 

Override base class so we don't put up a dialog but still provide fixed options for preview bitmap filters. Notes: See BaseBitmapFilter for interface details.

Author:
Martin_Bell (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/01/97

Reimplemented from BMPFilter.

Definition at line 395 of file prvwflt.cpp.

00396 {
00397     ERROR2IF(pOptions == NULL, FALSE, "NULL Args");
00398     ERROR3IF(!pOptions->IS_KIND_OF(BMPExportOptions), "pOptions isn't a BMPExportOptions");
00399 
00400     BMPExportOptions* pBMPOptions = (BMPExportOptions*)pOptions;
00401 
00402     // the depth we ask GDraw to render is always 32-bit, so we can get transparency
00403     // we have to convert for other formats when writing the actual bytes to the file
00404     SetDepthToRender(32);
00405 
00406     // We haven't written the header yet
00407     WrittenHeader = FALSE;
00408 
00410     // BitmapExportOptions
00411     //
00412 
00413     // this dpi will be used to scale the preview
00414     pBMPOptions->SetDPI(96.0);
00415 
00416     // the export depth of the preview is always 8
00417     pBMPOptions->SetDepth(8);
00418 
00419     // I'm fairly sure this isn't used for anything in WEBSTER-Martin-17/01/97
00420     // PreviewDither = ?;
00421     PreviewPalette = PAL_OPTIMISED;
00422 
00424     // BMPExportOptions
00425     //
00426 
00427     pBMPOptions->SetDither( XARADITHER_NONE );
00428 
00429     // Previews have an optimized palette
00430     PaletteType = PreviewPalette;
00431     pBMPOptions->SetPalette( (PALETTE)PreviewPalette );
00432 
00433     return TRUE;
00434 }

BOOL PreviewFilterBMP::Init void   )  [virtual]
 

Initialise an PreviewFilter object.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/95
Returns:
TRUE if the filter was initialised ok, FALSE otherwise.

Errors: Will fail if not enough memory to initialise.

See also:
BMPFilter::Init()

Reimplemented from BMPFilter.

Definition at line 329 of file prvwflt.cpp.

00330 {
00331     // Get the OILFilter object
00332     pOILFilter = new BMPOILFilter(this);
00333     if (pOILFilter==NULL)
00334         return FALSE;
00335 
00336     // Load the description strings
00337     FilterName.Load(_R(IDT_BMP_FILTERNAME));
00338     FilterInfo.Load(_R(IDT_BMP_FILTERINFO));
00339 
00340     // All ok
00341     return TRUE;
00342 }


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