예제 #1
0
파일: prvwflt.cpp 프로젝트: vata/xarino
BOOL PreviewFilterPNG::GetExportOptions(BitmapExportOptions* pOptions)
{
	ERROR2IF(pOptions == NULL, FALSE, "NULL Args");
	ERROR3IF(!pOptions->IS_KIND_OF(PNGExportOptions), "pOptions isn't a PNGExportOptions");

	PNGExportOptions* pPNGOptions = (PNGExportOptions*)pOptions;

	// the depth we ask GDraw to render is always 32-bit, so we can get transparency
	// we have to convert for other formats	when writing the actual bytes to the file
	SetDepthToRender(32);

	// We haven't written the header yet
	WrittenHeader = FALSE;

	/////////////////////////////////////////////////////////////////////////
	// BitmapExportOptions
	//

	// this dpi will be used to scale the preview
	pPNGOptions->SetDPI(96.0);

	// the export depth of the preview is always 8
	pPNGOptions->SetDepth(8);

	// I'm fairly sure this isn't used for anything in WEBSTER-Martin-17/01/97
	//PreviewDither = ?;
	PreviewPalette = PAL_OPTIMISED;

	/////////////////////////////////////////////////////////////////////////
	// MaskedFilterExportOptions
	//

	pPNGOptions->SetDither( XARADITHER_NONE );

	// Previews have an optimized palette
	PaletteType = PreviewPalette;
//	pPNGOptions->SetPalette( (PALETTE)PreviewPalette );

	// Previews have no interlace/transparency
//	pPNGOptions->SetMakeTransparent( FALSE );
	pPNGOptions->SetTransparencyIndex(-1);
	pPNGOptions->SetMakeInterlaced( FALSE );

	// We are a first pass render and not doing the mask, by default
	SecondPass = FALSE;
	DoingMask = FALSE;

	// Default will range from 0 to 4 types which correspond to the combinations of
	// on/off interlaced and on/off transparent
	Compression = 0;				// Previews have no interlace/transparency

	// Determine the filter type currently in use in Accusoft format
	FilterID = FILTERID_PNG;
	pPNGOptions->SetFilterType(PNG);

	return TRUE;
}