PreviewFilterJPEG Class Reference

The filter will save out the JPEG Preview Bitmap. Overrides GetExportOptions so dialogs are not put up but returns preview export options. Note: 22/01/97 Preview filters can generally import as well now (if their base class can) but obviously this one can't - use JPEGImportFilter instead. More...

#include <prvwflt.h>

Inheritance diagram for PreviewFilterJPEG:

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

Public Member Functions

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

Detailed Description

The filter will save out the JPEG Preview Bitmap. Overrides GetExportOptions so dialogs are not put up but returns preview export options. Note: 22/01/97 Preview filters can generally import as well now (if their base class can) but obviously this one can't - use JPEGImportFilter instead.

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

Definition at line 221 of file prvwflt.h.


Constructor & Destructor Documentation

PreviewFilterJPEG::PreviewFilterJPEG  ) 
 

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

/

/*!

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

Definition at line 626 of file prvwflt.cpp.

00626                                      : JPEGExportFilter()
00627 {
00628     ImportMsgID = _R(IDN_IMPORTMSG_JPEG);
00629     
00630     // Set it up so that it can neither Import or Export so that it does not appear in the
00631     // Filter menus.
00632     Flags.CanImport = FALSE;
00633     Flags.CanExport = FALSE;
00634     FilterID = FILTERID_PREVIEW_JPEG;
00635 
00636     ExportRegion = NULL;
00637     ExportMsgID = _R(IDS_BUILDINGPREVIEW);
00638     ExportingMsgID = _R(IDS_BUILDINGPREVIEW);
00639 }


Member Function Documentation

PreviewFilterJPEG::CC_DECLARE_MEMDUMP PreviewFilterJPEG   )  [private]
 

BOOL PreviewFilterJPEG::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 686 of file prvwflt.cpp.

00688 {
00689     INT32 OldPreviewSize = PreviewFilter::PreviewBitmapSize;
00690     // Set the Preview to be just over an inch accross
00691     PreviewFilter::PreviewBitmapSize = 96000;
00692 
00693     // set ourselves up - this flags the BaseBitmapFilter to do resizing, which needs to be
00694     // done there because of Accusoft.
00695     SetPreviewBitmap(TRUE);
00696 
00697     // Export the Preview to the file by doing what our base class does
00698     BOOL ok = JPEGExportFilter::DoExport(pOp, pFile, pPath, TheDocument, TRUE);
00699 
00700     // Set ourselves back
00701     SetPreviewBitmap(FALSE);
00702     // Set the Preview back to its default setting
00703     PreviewFilter::PreviewBitmapSize = OldPreviewSize;
00704 
00705     return ok;
00706 }

BOOL PreviewFilterJPEG::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 JPEGExportFilter.

Definition at line 720 of file prvwflt.cpp.

00721 {
00722     ERROR2IF(pOptions == NULL, FALSE, "NULL Args");
00723     ERROR3IF(!pOptions->IS_KIND_OF(JPEGExportOptions), "pOptions isn't a JPEGExportOptions");
00724 
00725     JPEGExportOptions* pJPEGOptions = (JPEGExportOptions*)pOptions;
00726 
00727     // the depth we ask GDraw to render is always 32-bit, so we can get transparency
00728     // we have to convert for other formats when writing the actual bytes to the file
00729     SetDepthToRender(32);
00730 
00731     // We haven't written the header yet
00732     WrittenHeader = FALSE;
00733 
00735     // BitmapExportOptions
00736     //
00737 
00738     // this dpi will be used to scale the preview
00739     pJPEGOptions->SetDPI(96.0);
00740 
00741     // the export depth of the preview is always 8
00742     pJPEGOptions->SetDepth(8);
00743 
00744     // I'm fairly sure this isn't used for anything in WEBSTER-Martin-17/01/97
00745     //PreviewDither = ?;
00746     PreviewPalette = PAL_OPTIMISED;
00747 
00749     // JPEGExportOptions
00750     //
00751 
00752     // Previews have an optimized palette
00753     PaletteType = PreviewPalette;
00754 
00755     return TRUE;
00756 }

BOOL PreviewFilterJPEG::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 JPEGExportFilter.

Definition at line 654 of file prvwflt.cpp.

00655 {
00656     // Get the OILFilter object
00657     pOILFilter = new JPEGOILFilter(this);
00658     if (pOILFilter==NULL)
00659         return FALSE;
00660 
00661     // Load the description strings
00662     FilterName.Load(_R(IDN_JPEG_FILTERNAME));
00663     FilterInfo.Load(_R(IDN_JPEG_FILTERINFO));
00664 
00665     // All ok
00666     return TRUE;
00667 }


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