PreviewFilterGIF Class Reference

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

#include <prvwflt.h>

Inheritance diagram for PreviewFilterGIF:

TI_GIFFilter MaskedFilter BaseBitmapFilter BitmapFilter Filter ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 PreviewFilterGIF ()
 Constructor for an PreviewFilterGIF 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 (PreviewFilterGIF)

Detailed Description

The filter will save out the GIF 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 194 of file prvwflt.h.


Constructor & Destructor Documentation

PreviewFilterGIF::PreviewFilterGIF  ) 
 

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

/

/*!

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

Definition at line 451 of file prvwflt.cpp.

00451                                    : TI_GIFFilter()
00452 {
00453     ImportMsgID = _R(IDN_IMPORTMSG_GIF);
00454     
00455     // Set it up so that it can neither Import or Export so that it does not appear in the
00456     // Filter menus.
00457     Flags.CanImport = FALSE;
00458     Flags.CanExport = FALSE;
00459     FilterID = FILTERID_PREVIEW_GIF;
00460 
00461     ExportRegion = NULL;
00462 
00463     ExportMsgID = _R(IDS_BUILDINGPREVIEW);
00464     ExportingMsgID = _R(IDS_BUILDINGPREVIEW);
00465 }


Member Function Documentation

PreviewFilterGIF::CC_DECLARE_DYNAMIC PreviewFilterGIF   )  [private]
 

BOOL PreviewFilterGIF::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 512 of file prvwflt.cpp.

00514 {
00515     INT32 OldPreviewSize = PreviewFilter::PreviewBitmapSize;
00516     // Set the Preview to be just over an inch accross
00517     PreviewFilter::PreviewBitmapSize = 96000;
00518 
00519     // set ourselves up - this flags the BaseBitmapFilter to do resizing, which needs to be
00520     // done there because of Accusoft.
00521     SetPreviewBitmap(TRUE);
00522 
00523     // Export the Preview to the file by doing what our base class does
00524     BOOL ok = TI_GIFFilter::DoExport(pOp, pFile, pPath, TheDocument, TRUE);
00525 
00526     // Set ourselves back
00527     SetPreviewBitmap(FALSE);
00528     // Set the Preview back to its default setting
00529     PreviewFilter::PreviewBitmapSize = OldPreviewSize;
00530 
00531     return ok;
00532 }

BOOL PreviewFilterGIF::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 TI_GIFFilter.

Definition at line 546 of file prvwflt.cpp.

00547 {
00548     ERROR2IF(pOptions == NULL, FALSE, "NULL Args");
00549     ERROR3IF(!pOptions->IS_KIND_OF(GIFExportOptions), "pOptions isn't a GIFExportOptions");
00550 
00551     GIFExportOptions* pGIFOptions = (GIFExportOptions*)pOptions;
00552 
00553     // the depth we ask GDraw to render is always 32-bit, so we can get transparency
00554     // we have to convert for other formats when writing the actual bytes to the file
00555     SetDepthToRender(32);
00556 
00557     // We haven't written the header yet
00558     WrittenHeader = FALSE;
00559 
00561     // BitmapExportOptions
00562     //
00563 
00564     // this dpi will be used to scale the preview
00565     pGIFOptions->SetDPI(96.0);
00566 
00567     // the export depth of the preview is always 8
00568     pGIFOptions->SetDepth(8);
00569 
00570     // I'm fairly sure this isn't used for anything in WEBSTER-Martin-17/01/97
00571     //PreviewDither = ?;
00572 
00573     // WEBSTER - markn 12/2/97
00574     // Use the standard palette for the preview
00575     PreviewPalette = PAL_STANDARD;
00576 
00578     // MaskedFilterExportOptions
00579     //
00580 
00581     // WEBSTER - markn 12/2/97
00582     // Use error diffusion
00583     pGIFOptions->SetDither( XARADITHER_ERROR_DIFFUSION );
00584 
00585     // Previews have an optimized palette
00586     PaletteType = PreviewPalette;
00587 //  pGIFOptions->SetPalette( (PALETTE)PreviewPalette );
00588 
00589     // Previews have no interlace/transparency
00590     //pGIFOptions->SetMakeTransparent( FALSE );
00591     pGIFOptions->SetTransparencyIndex(-1);
00592 
00593     pGIFOptions->SetMakeInterlaced( FALSE );
00594 
00595     // We are a first pass render and not doing the mask, by default
00596     SecondPass = FALSE;
00597     DoingMask = FALSE;
00598 
00599     // Default will range from 0 to 4 types which correspond to the combinations of
00600     // on/off interlaced and on/off transparent
00601     Compression = 0;                // Previews have no interlace/transparency
00602 
00603     // Determine the filter type currently in use in Accusoft format
00604     FilterID = FILTERID_TI_GIF;
00605     pGIFOptions->SetFilterType(TI_GIF);
00606 
00607     m_DoingAnimation = FALSE;
00608 
00609     return TRUE;
00610 }

BOOL PreviewFilterGIF::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 TI_GIFFilter.

Definition at line 480 of file prvwflt.cpp.

00481 {
00482     // Get the OILFilter object
00483     pOILFilter = new GIFOILFilter(this);
00484     if (pOILFilter==NULL)
00485         return FALSE;
00486 
00487     // Load the description strings
00488     FilterName.Load(_R(IDN_FILTERNAME_GIF));
00489     FilterInfo.Load(_R(IDN_GIF_FILTERINFO));
00490 
00491     // All ok
00492     return TRUE;
00493 }


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