PreviewFilterPNG Class Reference

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

#include <prvwflt.h>

Inheritance diagram for PreviewFilterPNG:

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

Public Member Functions

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

Detailed Description

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


Constructor & Destructor Documentation

PreviewFilterPNG::PreviewFilterPNG  ) 
 

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

/

/*!

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

Definition at line 773 of file prvwflt.cpp.

00773                                    : PNGFilter()
00774 {
00775     ImportMsgID = _R(IDS_IMPORTMSG_PNG);
00776     
00777     // Set it up so that it can neither Import or Export so that it does not appear in the
00778     // Filter menus.
00779     Flags.CanImport = FALSE;
00780     Flags.CanExport = FALSE;
00781     FilterID = FILTERID_PNG;        // FILTERID_PREVIEW_PNG;
00782 
00783     ExportRegion = NULL;
00784     ExportMsgID = _R(IDS_BUILDINGPREVIEW);
00785     ExportingMsgID = _R(IDS_BUILDINGPREVIEW);
00786 }


Member Function Documentation

PreviewFilterPNG::CC_DECLARE_DYNAMIC PreviewFilterPNG   )  [private]
 

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

Reimplemented in ThumbnailFilterPNG.

Definition at line 833 of file prvwflt.cpp.

00835 {
00836     INT32 OldPreviewSize = PreviewFilter::PreviewBitmapSize;
00837     // Set the Preview to be just over an inch accross
00838     PreviewFilter::PreviewBitmapSize = 96000;
00839 
00840     // set ourselves up - this flags the BaseBitmapFilter to do resizing, which needs to be
00841     // done there because of Accusoft.
00842     SetPreviewBitmap(TRUE);
00843 
00844     // Export the Preview to the file by doing what our base class does
00845     BOOL ok = PNGFilter::DoExport(pOp, pFile, pPath, TheDocument, TRUE);
00846 
00847     // Set ourselves back
00848     SetPreviewBitmap(FALSE);
00849     // Set the Preview back to its default setting
00850     PreviewFilter::PreviewBitmapSize = OldPreviewSize;
00851 
00852     return ok;
00853 }

BOOL PreviewFilterPNG::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 PNGFilter.

Definition at line 867 of file prvwflt.cpp.

00868 {
00869     ERROR2IF(pOptions == NULL, FALSE, "NULL Args");
00870     ERROR3IF(!pOptions->IS_KIND_OF(PNGExportOptions), "pOptions isn't a PNGExportOptions");
00871 
00872     PNGExportOptions* pPNGOptions = (PNGExportOptions*)pOptions;
00873 
00874     // the depth we ask GDraw to render is always 32-bit, so we can get transparency
00875     // we have to convert for other formats when writing the actual bytes to the file
00876     SetDepthToRender(32);
00877 
00878     // We haven't written the header yet
00879     WrittenHeader = FALSE;
00880 
00882     // BitmapExportOptions
00883     //
00884 
00885     // this dpi will be used to scale the preview
00886     pPNGOptions->SetDPI(96.0);
00887 
00888     // the export depth of the preview is always 8
00889     pPNGOptions->SetDepth(8);
00890 
00891     // I'm fairly sure this isn't used for anything in WEBSTER-Martin-17/01/97
00892     //PreviewDither = ?;
00893     PreviewPalette = PAL_OPTIMISED;
00894 
00896     // MaskedFilterExportOptions
00897     //
00898 
00899     pPNGOptions->SetDither( XARADITHER_NONE );
00900 
00901     // Previews have an optimized palette
00902     PaletteType = PreviewPalette;
00903 //  pPNGOptions->SetPalette( (PALETTE)PreviewPalette );
00904 
00905     // Previews have no interlace/transparency
00906 //  pPNGOptions->SetMakeTransparent( FALSE );
00907     pPNGOptions->SetTransparencyIndex(-1);
00908     pPNGOptions->SetMakeInterlaced( FALSE );
00909 
00910     // We are a first pass render and not doing the mask, by default
00911     SecondPass = FALSE;
00912     DoingMask = FALSE;
00913 
00914     // Default will range from 0 to 4 types which correspond to the combinations of
00915     // on/off interlaced and on/off transparent
00916     Compression = 0;                // Previews have no interlace/transparency
00917 
00918     // Determine the filter type currently in use in Accusoft format
00919     FilterID = FILTERID_PNG;
00920     pPNGOptions->SetFilterType(PNG);
00921 
00922     return TRUE;
00923 }

BOOL PreviewFilterPNG::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 PNGFilter.

Definition at line 801 of file prvwflt.cpp.

00802 {
00803     // Get the OILFilter object
00804     pOILFilter = new PNGOILFilter(this);
00805     if (pOILFilter==NULL)
00806         return FALSE;
00807 
00808     // Load the description strings
00809     FilterName.Load(_R(IDS_PNG_FILTERNAME));
00810     FilterInfo.Load(_R(IDS_PNG_FILTERINFO));
00811 
00812     // All ok
00813     return TRUE;
00814 }


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