BitmapExportOptions Class Reference

Base class for storing information about the bitmap we're exporting. More...

#include <bmpprefs.h>

Inheritance diagram for BitmapExportOptions:

OpParam CCObject SimpleCCObject BMPExportOptions JPEGExportOptions MaskedFilterExportOptions GIFExportOptions ImageMagickExportOptions MakeBitmapExportOptions PNGExportOptions List of all members.

Public Types

enum  eCOLOUR_DEPTHS {
  COLOUR_2 = 1, COLOUR_16 = 2, COLOUR_256 = 4, COLOUR_16BIT = 8,
  COLOUR_24BIT = 16, COLOUR_32BIT = 32
}
enum  eINTERLACE_PROGRESSIVE { GIF_INTERLACE = 1, PNG_INTERLACE = 2, JPG_PROGRESSIVE = 4 }
enum  eDITHERING { ORDERED_DITHER = 1, ERROR_DITHER = 2 }

Public Member Functions

 BitmapExportOptions ()
 Default constructor. See Also: BaseBitmapFilter::CreateBitmapOptions().
 BitmapExportOptions (const CDlgResID DialogID, const FilterType FilterID, const StringBase *pFilterName)
 Allows options in the bitmap export dialog to be freely passed around See Also: BaseBitmapFilter::CreateBitmapOptions().
 ~BitmapExportOptions ()
BOOL IsValid () const
 Determines whether or not the values contained in this object are valid or whether the user has cancelled the export: using MarkValid() & MarkInvalid() will state the veracity of this fact.
void MarkInvalid ()
void MarkValid ()
virtual BOOL RetrieveDefaults ()
 Retrieves defaults for accessible members from preferences See Also: BitmapExportOptions::SetAsDefaults().
virtual BOOL SetAsDefaults () const
 Sets the current options as preferences which may be retrieved by a subsequent RetrieveDefaults() See Also: BitmapExportOptions::RetrieveDefaults().
virtual BOOL Write (CXaraFileRecord *pRec)
 Writes this object to the given record.
virtual BOOL Read (CXaraFileRecord *pRec)
 Reads this object from the given record.
DPI GetDPI () const
 Support function to obtain bitmap info.
BOOL SetDPI (const DPI &Dpi)
 Support function to set up information for the ensuing export See Also: GetDpi().
virtual BOOL GetSupportsImageMap ()
virtual INT32 GetTransparencyIndex () const
virtual void SetTransparencyIndex (INT32 TransparencyIndex)
BMP_DEPTH GetDepth () const
 Support function to obtain bitmap options.
BOOL SetDepth (const BMP_DEPTH &Depth)
 Support function to set up information for the ensuing export See Also: GetDepth().
SelectionType GetSelectionType () const
void SetSelectionType (const SelectionType &Sel)
 sets the the item(s) being exported eg selection, page, drawing, etc
BOOL GetSeparateLayerFiles () const
void SetSeparateLayerFiles (const BOOL newFlag)
BOOL GetTempFileFlag () const
void SetTempFileFlag (const BOOL newFlag)
CDlgResID GetDialogType () const
const FilterType GetFilterType () const
const StringBaseGetFilterName () const
 Allows the export dialog to display the filter name in its title bar.
virtual UINT32 GetFilterNameStrID ()
BaseBitmapFilterFindBitmapFilterForTheseExportOptions ()
Coord GetOutputSize ()
void SetOutputSize (UINT32 x, UINT32 y)
Coord GetPixelOutputSize ()
void SetPixelOutputSize (UINT32 x, UINT32 y)
BmpDlgParamGetBmpDlgParam ()
BOOL SetBitmapExportParam (BitmapExportParam *pParam)
virtual BOOL CanExportSeparateLayers ()
 
  • See Also: -

virtual void SetNumColsInPalette (UINT32 NumCols)
virtual void SetUseSystemColours (BOOL SystemColours)
virtual UINT32 GetNumColsInPalette ()
virtual BOOL GetUseSystemColours ()
virtual BOOL UseSpecificNumColsInPalette ()
ANTIALIASING GetAntiAliasing () const
void SetAntiAliasing (ANTIALIASING aa)
 Sets the anti-aliasing on the export bitmap.
virtual DITHER GetDither () const
virtual BOOL SetDither (const DITHER &)
BOOL ShouldPutHTMLTagOnClipboard ()
void SetPutHTMLTagOnClipboard (BOOL fValueToSet)
void SetPathName (PathName *pTempPath)
 Allows the export options to keep the path to a temporary file, created during bitmap preview, so the export function can simply rename this to create the final exported file.
PathName GetPathName ()
BOOL HasTempFile ()
void SetTempFileMatchesExportOptions (BOOL OptionsMatch)
BOOL DoesTempFileMatchExportOptions ()
BitmapExportOptionsMakeCopy ()
 Makes a copy object of this object See Also: BitmapExportOptions::CopyFrom().
virtual BOOL CopyFrom (BitmapExportOptions *pOther)
virtual BOOL FileTypeChangeCopyFrom (BitmapExportOptions *pOther)
 Copies the information from the BitmapExportOptions object passed in as the argument to the palette object in this class.
void SetCanUseDesignNotes (BOOL ok)
BOOL GetCanUseDesignNotes () const
ExtendedPaletteGetPalette ()
void MakePaletteEntryUnreadable (INT32 i)
BOOL CreatePaletteOptimiser ()
void BitmapSourceHasChanged ()
void GatherPaletteStats (const RGBQUAD *pBitmap, UINT32 nSize)
void CreateValidPalette ()
void CreateValidPalette (LOGPALETTE *pPal, INT32 TranspIndex=0)
void CreateValidBrowserPalette (BOOL WantTransp=TRUE)
LOGPALETTEGetLogicalPalette ()
BOOL SwapEditedColoursInLogicalPalette ()
INT32 FindNextLockedColour (INT32 pos)
BOOL IsBackgroundTransparent ()
void SetBackgroundTransparency (BOOL t)
ExtendedPaletteGetExtendedPalette ()
BOOL IsClipToPage ()
BOOL IsPaletteValid ()
void InvalidatePalette ()
INT32 GetNumberOfUserRequestedColours ()
void SetNumberOfUserRequestedColours (INT32 n)
BOOL IsUsingBrowserPalette ()
void SetToUseBrowserPalette (BOOL SetIt)
BOOL IsUsingSystemPalette ()
void SetToUseSystemPalette (BOOL SetIt)
INT32 GetWebSnapPaletteAmount ()
void SetWebSnapPaletteAmount (INT32 SetIt)
INT32 GetPrimarySnapPaletteAmount ()
void SetPrimarySnapPaletteAmount (INT32 SetIt)
DWORD GetSupportedDithers ()
 Returns the allowed dither types the current filter supports.
DWORD GetInterlaceType ()
 Return true if the current filter allows palette info.
DWORD GetSupportedColourDepths ()
 Returns the all the colour depths the current filter supports.
BOOL GetSupportsTransparency ()
 Used to see if the current filter allows transparencies.
BOOL GetSupportsPalette ()
 Return true if the current filter allows palette info.
void SetCMYK (BOOL SetIt)
BOOL IsCMYK ()

Static Public Member Functions

static BOOL Init ()
 Declares a preference that allows you to clear memory in delete().
static BOOL Declare ()
 Declares our base class preferences.

Public Attributes

BOOL m_fPutHTMLTagOnClipboard

Static Public Attributes

static BOOL ms_fPutHTMLTagOnClipboard = FALSE
 The path to default to when opening the Export File dialogWhether we should put an HTML tag on the clipboard. FALSE by default.
static TCHAR ms_strPutHTMLTagOnClipboard [] = _T("Filters\\PutHTMLTagOnClipboard")
static BOOL ms_IsBackGroundTransparent = TRUE
static ANTIALIASING ms_Antialiasing = MINIMISE_VISIBLE_AA
static BOOL ms_bSeparateLayerFiles = FALSE

Protected Member Functions

BOOL ArePalettesEqual (BitmapExportOptions *pOther)
void CopyPaletteInformationFrom (BitmapExportOptions *pOther)

Protected Attributes

SelectionType m_SelectionType
Coord m_OutputSize
Coord m_PixelOutputSize
FilterType m_FilterID
BmpDlgParamm_pBmpDlgParam
BOOL m_UseDesignNotes
BOOL m_bSeparateLayerFiles
BOOL m_bTempFileFlag
UINT32 m_NumColsInPalette
BOOL m_UseSystemColours

Static Protected Attributes

static UINT32 g_NumColsInPalette = 256
static BOOL g_UseSystemColours = FALSE

Private Attributes

BOOL m_bValid
DPI m_DPI
BMP_DEPTH m_Depth
INT32 m_TransparencyIndex
CDlgResID m_DialogID
const StringBasem_pFilterName
PathName m_TempPath
BOOL m_bTempFileExported
ExtendedPalette m_Palette
ANTIALIASING m_Antialiasing
BOOL m__PaletteIsValid
LOGPALETTEm__pLogicalPalette
INT32 m__NumberOfColoursUserRequested
BOOL m__UseBrowserPalette
BOOL m__UseSystemColoursInPalette
INT32 m__UseWebSnapPalette
INT32 m__UsePrimarySnapPalette
BOOL m__BackgroundIsTransparent
PaletteOptimiserm__pPaletteOptimiser
BOOL m__HavePrimedOptimier
BOOL m__TempFileMatchesExportOptions
BOOL m_bCMYK

Detailed Description

Base class for storing information about the bitmap we're exporting.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/10/96

Definition at line 196 of file bmpprefs.h.


Member Enumeration Documentation

enum BitmapExportOptions::eCOLOUR_DEPTHS
 

Enumerator:
COLOUR_2 
COLOUR_16 
COLOUR_256 
COLOUR_16BIT 
COLOUR_24BIT 
COLOUR_32BIT 

Definition at line 369 of file bmpprefs.h.

00370     {
00371         COLOUR_2 = 1,
00372         COLOUR_16 = 2,
00373         COLOUR_256 = 4,
00374         COLOUR_16BIT = 8,
00375         COLOUR_24BIT = 16,
00376         COLOUR_32BIT = 32
00377     };

enum BitmapExportOptions::eDITHERING
 

Enumerator:
ORDERED_DITHER 
ERROR_DITHER 

Definition at line 392 of file bmpprefs.h.

00393     {
00394         ORDERED_DITHER = 1,
00395         ERROR_DITHER = 2
00396     };

enum BitmapExportOptions::eINTERLACE_PROGRESSIVE
 

Enumerator:
GIF_INTERLACE 
PNG_INTERLACE 
JPG_PROGRESSIVE 

Definition at line 382 of file bmpprefs.h.

00383     {
00384         GIF_INTERLACE = 1,
00385         PNG_INTERLACE = 2,
00386         JPG_PROGRESSIVE = 4
00387     };


Constructor & Destructor Documentation

BitmapExportOptions::BitmapExportOptions  ) 
 

Default constructor. See Also: BaseBitmapFilter::CreateBitmapOptions().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96

Definition at line 216 of file bmpprefs.cpp.

00216                                          :
00217     m_SelectionType(SELECTION),         // BaseBitmapFilter uses these...
00218     m_OutputSize(0, 0),                 // And initialise the output size
00219     m_PixelOutputSize(0, 0),
00220     m_FilterID(INVALID),
00221     m_pBmpDlgParam(0),
00222     m_bSeparateLayerFiles(FALSE),
00223     m_bTempFileFlag(FALSE),
00224     m_NumColsInPalette(0),
00225     m_UseSystemColours(FALSE),
00226     m_fPutHTMLTagOnClipboard(ms_fPutHTMLTagOnClipboard), // default HTML to clipboard
00227     m_bValid(FALSE),                    // Always use this...
00228     m_DPI(0),
00229     m_Depth(0),
00230     m_TransparencyIndex(-1),            // WEBSTER - markn 5/2/97 - no transparent colour
00231     m_DialogID(0),                      // BmpPrefsDlg uses these...
00232     m_pFilterName(0),
00233     m_bTempFileExported(FALSE),         // export preview uses this
00234     m_Antialiasing(MINIMISE_VISIBLE_AA) // Always start with the highest quality option
00235 {
00236     m_Palette.NumberOfColours = 0;
00237     memset(&(m_Palette.Data), 0, sizeof(ExtendedPaletteEntry)*256);
00238 PORTNOTE("DesignNotes", "Removed use of DesignNotes")
00239 #if !defined(EXCLUDE_FROM_XARALX)
00240     m_UseDesignNotes = GetRegistryFlagForDesignNotes();
00241 #else
00242     m_UseDesignNotes = FALSE;
00243 #endif
00244     m__pLogicalPalette = NULL;
00245     m__NumberOfColoursUserRequested = 256;
00246     m__UseBrowserPalette = FALSE;
00247     m__UseSystemColoursInPalette = FALSE;
00248     m__UseWebSnapPalette = 0;
00249     m__UsePrimarySnapPalette = 1;
00250     m__PaletteIsValid = FALSE;
00251     m__BackgroundIsTransparent = TRUE;
00252     m__pPaletteOptimiser = NULL;
00253     m__HavePrimedOptimier = FALSE;
00254     m__TempFileMatchesExportOptions = FALSE;
00255     m_bCMYK = FALSE;
00256 }

BitmapExportOptions::BitmapExportOptions const CDlgResID  DialogID,
const FilterType  FilterID,
const StringBase pFilterName
 

Allows options in the bitmap export dialog to be freely passed around See Also: BaseBitmapFilter::CreateBitmapOptions().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96

Definition at line 270 of file bmpprefs.cpp.

00273                                                                :
00274     m_SelectionType(SELECTION),         // BaseBitmapFilter uses these...
00275     m_OutputSize(0, 0),                 // And initialise the output size
00276     m_PixelOutputSize(0, 0),
00277     m_FilterID(FilterID),
00278     m_pBmpDlgParam(0),
00279     m_bSeparateLayerFiles(FALSE),
00280     m_bTempFileFlag(FALSE),
00281     m_NumColsInPalette(0),
00282     m_UseSystemColours(FALSE),
00283     m_fPutHTMLTagOnClipboard(ms_fPutHTMLTagOnClipboard), // default HTML to clipboard
00284     m_bValid(FALSE),                    // Always use this...
00285     m_DPI(0),
00286     m_Depth(0),
00287     m_TransparencyIndex(-1),            // WEBsTER - markn 5/2/97 - no transparent colour
00288     m_DialogID(DialogID),               // BmpPrefsDlg uses these...
00289     m_pFilterName(pFilterName),
00290     m_bTempFileExported(FALSE),         // export preview uses this
00291     m_Antialiasing(MINIMISE_VISIBLE_AA) // Always start with the highest quality option
00292 {
00293     m_Palette.NumberOfColours = 0;
00294     memset(&(m_Palette.Data), 0, sizeof(ExtendedPaletteEntry)*256);
00295 PORTNOTE("DesignNotes", "Removed use of DesignNotes")
00296 #if !defined(EXCLUDE_FROM_XARALX)
00297     m_UseDesignNotes = GetRegistryFlagForDesignNotes();
00298 #else
00299     m_UseDesignNotes = FALSE;
00300 #endif
00301     m__pLogicalPalette = NULL;
00302     m__NumberOfColoursUserRequested = 256;
00303     m__UseBrowserPalette = FALSE;
00304     m__UseSystemColoursInPalette = FALSE;
00305     m__UseWebSnapPalette = 0;
00306     m__UsePrimarySnapPalette = 1;
00307     m__PaletteIsValid = FALSE;
00308     m__BackgroundIsTransparent = TRUE;
00309     m__pPaletteOptimiser = NULL;
00310     m__HavePrimedOptimier = FALSE;
00311     m__TempFileMatchesExportOptions = FALSE;
00312     m_bCMYK = FALSE;
00313 }

BitmapExportOptions::~BitmapExportOptions  ) 
 

Definition at line 316 of file bmpprefs.cpp.

00317 {
00318     // the export options manages the logical palette so this is deleted when the export options are deleted
00319     if (m__pLogicalPalette)
00320     {
00321         delete m__pLogicalPalette;
00322         m__pLogicalPalette = NULL;
00323     }
00324 
00325     // the cache for the palette optimiser which holds the stats on the image
00326     if (m__pPaletteOptimiser)
00327     {
00328         delete m__pPaletteOptimiser;
00329         m__pPaletteOptimiser = NULL;
00330     }
00331 }


Member Function Documentation

BOOL BitmapExportOptions::ArePalettesEqual BitmapExportOptions pOther  )  [protected]
 

void BitmapExportOptions::BitmapSourceHasChanged  ) 
 

Definition at line 4963 of file bmpprefs.cpp.

04964 {
04965     m__HavePrimedOptimier = FALSE;
04966     if (m__pPaletteOptimiser != NULL)
04967         delete m__pPaletteOptimiser;
04968 
04969     m__pPaletteOptimiser = NULL;
04970     InvalidatePalette(); // the palette we are holding will be wrong too
04971 }

BOOL BitmapExportOptions::CanExportSeparateLayers  )  [virtual]
 

  • See Also: -

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/04/2004
Parameters:
- [INPUTS]
Returns:
-

Definition at line 1065 of file bmpprefs.cpp.

01066 {
01067     return (GetSeparateLayerFiles() && GetTempFileFlag()==FALSE && (GetFilterNameStrID()==_R(IDN_FILTERNAME_GIF) || GetFilterNameStrID()==_R(IDS_FILTERNAME_PNG)));
01068 }

BOOL BitmapExportOptions::CopyFrom BitmapExportOptions pOther  )  [virtual]
 

Reimplemented in JPEGExportOptions, MakeBitmapExportOptions, BMPExportOptions, GIFExportOptions, and MaskedFilterExportOptions.

Definition at line 374 of file bmpprefs.cpp.

00375 {
00376     if (pOther == 0)
00377         return FALSE;
00378 
00379     // Copy all the data items that can be copied for any type of BitmapExportOptions
00380     
00381     m_SelectionType                 = pOther->m_SelectionType;
00382     m_fPutHTMLTagOnClipboard        = pOther->m_fPutHTMLTagOnClipboard;
00383     m_Antialiasing                  = pOther->m_Antialiasing;
00384     m_UseDesignNotes                = pOther->m_UseDesignNotes;
00385     m_bSeparateLayerFiles           = pOther->m_bSeparateLayerFiles;
00386     m_bTempFileFlag                 = pOther->m_bTempFileFlag;
00387 
00388 
00389     if (IS_SAME_CLASS(pOther, this))
00390     {
00391         // Only copy these if we are copying from a class that is of the
00392         // same type
00393         
00394         m_OutputSize                = pOther->m_OutputSize;
00395         m_PixelOutputSize           = pOther->m_PixelOutputSize;
00396         m_FilterID                  = pOther->m_FilterID;
00397         m_pBmpDlgParam              = pOther->m_pBmpDlgParam;       
00398         m_NumColsInPalette          = pOther->m_NumColsInPalette;
00399         m_UseSystemColours          = pOther->m_UseSystemColours;
00400         m_TransparencyIndex         = pOther->m_TransparencyIndex;
00401         m_DialogID                  = pOther->m_DialogID;
00402         m_pFilterName               = pOther->m_pFilterName;
00403         m_bValid                    = pOther->m_bValid;
00404         m_bTempFileExported         = pOther->m_bTempFileExported;
00405         m_TempPath                  = pOther->m_TempPath;
00406         m_Depth                     = pOther->m_Depth; // move to derived classes
00407 
00408         // Added to stop the name gallery killing itself on export
00409         m_DPI                       = pOther->m_DPI;
00410 
00411         // It should be safe to copy the following for any file type but I have not tested this
00412         // so I am only copying them if they are of the same type for now - Jonathan.
00413 
00414         // smfix new ones added
00415         m__NumberOfColoursUserRequested = pOther->m__NumberOfColoursUserRequested;
00416         m__UseBrowserPalette            = pOther->m__UseBrowserPalette;
00417         m__UseSystemColoursInPalette    = pOther->m__UseSystemColoursInPalette;
00418         m__UseWebSnapPalette            = pOther->m__UseWebSnapPalette;
00419         m__UsePrimarySnapPalette        = pOther->m__UsePrimarySnapPalette;
00420         m__BackgroundIsTransparent      = pOther->m__BackgroundIsTransparent;
00421 
00422         // Also need to copy all the palette information over.  It should also be safe to copy
00423         // this but again, I have not tested this so I am going for the safe option - Jonathan.
00424         CopyPaletteInformationFrom(pOther);
00425         return TRUE;
00426     }
00427     else
00428     {
00429         return FALSE;
00430     }
00431 };

void BitmapExportOptions::CopyPaletteInformationFrom BitmapExportOptions pOther  )  [protected]
 

Definition at line 496 of file bmpprefs.cpp.

00497 {
00498     //  The first few times that this function is called, the palette passed in
00499     //  is uninitialised. If this is the case, then just make our palette a default one.
00500     if( ( pOther->m_Palette.NumberOfColours > 256 ) || ( pOther->m_Palette.NumberOfColours < 0 ) )
00501     {
00502         m_Palette.NumberOfColours = 0;
00503 
00504         INT32 i = 0;
00505         for( i=0; i < 256; i++ )
00506         {
00507             m_Palette.Data[ i ].Red                 = 0;
00508             m_Palette.Data[ i ].Green               = 0;
00509             m_Palette.Data[ i ].Blue                = 0;
00510             m_Palette.Data[ i ].Flags               = 0;
00511         }
00512         //  Finished here, so return.
00513         return;
00514     }
00515 
00516     //  Simply copy the entire palette over from pOther.
00517     m_Palette.NumberOfColours   = pOther->m_Palette.NumberOfColours;
00518 
00519     INT32 i = 0;
00520     INT32 Colours = m_Palette.NumberOfColours;
00521     Colours = max( 256, Colours );
00522     for( i=0; i < Colours; i++ )
00523     {
00524         m_Palette.Data[ i ].Red                 = ( pOther->m_Palette ).Data[ i ].Red;
00525         m_Palette.Data[ i ].Green               = ( pOther->m_Palette ).Data[ i ].Green;
00526         m_Palette.Data[ i ].Blue                = ( pOther->m_Palette ).Data[ i ].Blue;
00527         m_Palette.Data[ i ].Flags               = ( pOther->m_Palette ).Data[ i ].Flags;
00528     }
00529 
00530     // delete our old logical palette if we had one
00531     if (m__pLogicalPalette)
00532     {
00533         delete m__pLogicalPalette;
00534         m__pLogicalPalette = NULL;
00535     }
00536 
00537     // our copy is valid if the original is valid
00538     m__PaletteIsValid = pOther->IsPaletteValid();
00539 
00540     // copy the logical palette data if it was valid
00541     if (m__PaletteIsValid)
00542     {
00543         m__pLogicalPalette = (LOGPALETTE * ) new BYTE[sizeof(LOGPALETTE) + ( sizeof(PALETTEENTRY) * 256 )];
00544 
00545         memcpy(m__pLogicalPalette, pOther->GetLogicalPalette(), sizeof(LOGPALETTE) + ( sizeof(PALETTEENTRY) * 256 ));
00546     }
00547 
00548 }

BOOL BitmapExportOptions::CreatePaletteOptimiser  ) 
 

Definition at line 4944 of file bmpprefs.cpp.

04945 {
04946     if (m__pPaletteOptimiser == NULL)
04947     {
04948         m__HavePrimedOptimier = FALSE;
04949         m__pPaletteOptimiser = new PaletteOptimiser();
04950 
04951         ERROR2IF(m__pPaletteOptimiser == NULL, FALSE, "Low on memory, couldn't create palette optimiser");
04952 
04953         m__pPaletteOptimiser->Initialise();
04954 
04955         return TRUE; // we created a new one
04956     }
04957 
04958     return FALSE; // we kept the old one
04959 }

void BitmapExportOptions::CreateValidBrowserPalette BOOL  WantTransp = TRUE  ) 
 

Definition at line 5352 of file bmpprefs.cpp.

05353 {
05354     // tell the export dlg palette ctrl that a new palette is on the horizon
05355     BitmapExportPaletteInterface::InvalidateSortedPalette();
05356     // delete our old logical palette if we had one
05357     if (m__pLogicalPalette)
05358     {
05359         delete m__pLogicalPalette;
05360         m__pLogicalPalette = NULL;
05361     }
05362 
05363     m__PaletteIsValid = TRUE;
05364 
05365     // copy the logical palette data if it was valid
05366     m__pLogicalPalette = (LOGPALETTE * ) new BYTE[sizeof(LOGPALETTE) + ( sizeof(PALETTEENTRY) * 256 )];
05367 
05368     if (m__pLogicalPalette == NULL)
05369     {
05370         InvalidatePalette();
05371         return;
05372     }
05373 
05374     m__pLogicalPalette->palVersion = 0x300;
05375 
05376     // set the number of colours in the extended palette to match those in the new palette passed in
05377     m_Palette.NumberOfColours = m__pLogicalPalette->palNumEntries = WantTransp ? 217 : 216;
05378     // fill in the extended palette from the new logical palette from the logical palette passed in
05379 
05380     m_Palette.Data[0].Red = 255 ;
05381     m_Palette.Data[0].Green = 255;
05382     m_Palette.Data[0].Blue = 255;
05383     m_Palette.Data[0].Flags = WantTransp ? TRANSPARENT_COLOUR : 0;
05384     m__pLogicalPalette->palPalEntry[ 0 ].peRed = m_Palette.Data[0].Red;
05385     m__pLogicalPalette->palPalEntry[ 0 ].peGreen = m_Palette.Data[0].Green;
05386     m__pLogicalPalette->palPalEntry[ 0 ].peBlue = m_Palette.Data[0].Blue;
05387     m__pLogicalPalette->palPalEntry[ 0 ].peFlags = WantTransp ? 255 : 0;
05388 
05389     SetTransparencyIndex(WantTransp ? 0 : -1);
05390     
05391     INT32 i = 1;
05392     for (INT32 r = 0; r < 256; r += 51)
05393         for (INT32 g = 0; g < 256; g += 51)
05394             for (INT32 b = 0; b < 256; b += 51)
05395             {
05396                 m_Palette.Data[i].Red = r ;
05397                 m_Palette.Data[i].Green = g;
05398                 m_Palette.Data[i].Blue = b;
05399                 m_Palette.Data[i].Flags = 0; // no flags set this will loose any locked colours etc as these are not part of a logical palette
05400 
05401                 m__pLogicalPalette->palPalEntry[ i ].peRed = m_Palette.Data[i].Red;
05402                 m__pLogicalPalette->palPalEntry[ i ].peGreen = m_Palette.Data[i].Green;
05403                 m__pLogicalPalette->palPalEntry[ i ].peBlue = m_Palette.Data[i].Blue;
05404                 m__pLogicalPalette->palPalEntry[ i ].peFlags = 0;
05405                 i++;
05406             }
05407 }

void BitmapExportOptions::CreateValidPalette LOGPALETTE pPal,
INT32  TranspIndex = 0
 

Definition at line 5299 of file bmpprefs.cpp.

05300 {
05301     // tell the export dlg palette ctrl that a new palette is on the horizon
05302     BitmapExportPaletteInterface::InvalidateSortedPalette();
05303     // delete our old logical palette if we had one
05304     if (m__pLogicalPalette)
05305     {
05306         delete m__pLogicalPalette;
05307         m__pLogicalPalette = NULL;
05308     }
05309 
05310     m__PaletteIsValid = (pPal != NULL);
05311 
05312     if (!m__PaletteIsValid)
05313         return;
05314 
05315     // copy the logical palette data if it was valid
05316     m__pLogicalPalette = (LOGPALETTE * ) new BYTE[sizeof(LOGPALETTE) + ( sizeof(PALETTEENTRY) * 256 )];
05317 
05318     if (m__pLogicalPalette == NULL)
05319     {
05320         InvalidatePalette();
05321         return;
05322     }
05323 
05324     m__pLogicalPalette->palVersion = 0x300;
05325 
05326     // set the number of colours in the extended palette to match those in the new palette passed in
05327     m_Palette.NumberOfColours = m__pLogicalPalette->palNumEntries = pPal->palNumEntries;
05328     // fill in the extended palette from the new logical palette from the logical palette passed in
05329     for (INT32 i = 0; i < pPal->palNumEntries; i++)
05330     {
05331         m_Palette.Data[i].Red = pPal->palPalEntry[ i ].peRed;
05332         m_Palette.Data[i].Green = pPal->palPalEntry[ i ].peGreen;
05333         m_Palette.Data[i].Blue = pPal->palPalEntry[ i ].peBlue;
05334         m_Palette.Data[i].Flags = 0; // no flags set this will loose any locked colours etc as these are not part of a logical palette
05335 
05336         m__pLogicalPalette->palPalEntry[ i ].peRed = m_Palette.Data[i].Red;
05337         m__pLogicalPalette->palPalEntry[ i ].peGreen = m_Palette.Data[i].Green;
05338         m__pLogicalPalette->palPalEntry[ i ].peBlue = m_Palette.Data[i].Blue;
05339         m__pLogicalPalette->palPalEntry[ i ].peFlags = 0;
05340     }
05341 
05342     if (TranspIndex >= 0 && TranspIndex < pPal->palNumEntries)
05343     {
05344         m_Palette.Data[TranspIndex].Flags = TRANSPARENT_COLOUR;
05345         m__pLogicalPalette->palPalEntry[ TranspIndex ].peFlags = 255;
05346         SetTransparencyIndex(TranspIndex);
05347     }
05348 }

void BitmapExportOptions::CreateValidPalette  ) 
 

Definition at line 5076 of file bmpprefs.cpp.

05077 {
05078     ASSERT(m__pPaletteOptimiser);
05079 
05080     // tell the export dlg palette ctrl that a new palette is on the horizon
05081     BitmapExportPaletteInterface::InvalidateSortedPalette();
05082 
05083     // delete our old logical palette if we had one
05084     if (m__pLogicalPalette)
05085     {
05086         delete m__pLogicalPalette;
05087         m__pLogicalPalette = NULL;
05088     }
05089 
05090     // allocate space for a logical palette
05091     m__pLogicalPalette = (LOGPALETTE * ) new BYTE[sizeof(LOGPALETTE) + ( sizeof(PALETTEENTRY) * 256 )];
05092     if (m__pLogicalPalette == NULL)
05093         return;
05094     INT32 NewFlags[256];
05095     BYTE EditedColours[256][3];
05096     INT32 BackGroundTransp = m__BackgroundIsTransparent? 1: 0;
05097 
05098     // init the flags for the new palette
05099     memset(&NewFlags, 0, sizeof(INT32)*256);
05100     // init the edited colours for the new palette
05101     memset(&EditedColours, 0, 3*256);
05102 
05103     INT32 i = 0;
05104     // count the locked colours that we had in the last palette,
05105     // these are still the same locked colours for the new palette 
05106     // as the flags would have been removed if they were no longer required
05107     m__pPaletteOptimiser->RemoveLockedColours();
05108     INT32 LockedColours = 0;
05109     for (i = 0; i < m_Palette.NumberOfColours; i++)
05110     {
05111         if (m_Palette.Data[i].Flags & LOCKED_COLOUR || m_Palette.Data[i].Flags & DELETED_COLOUR) // found a locked colour?
05112         {
05113             // add it as a locked colour to the palette
05114             m__pPaletteOptimiser->AddLockedColour(m_Palette.Data[i].Red, m_Palette.Data[i].Green, m_Palette.Data[i].Blue);
05115             // count the locked colours so far
05116             LockedColours++;
05117         }
05118     }
05119     // how many colours can we fit in the palette
05120     INT32 MaxColoursInPalette = 256;
05121     if (m_Depth == 4)
05122         MaxColoursInPalette = 16;
05123     else if (m_Depth == 1)
05124         MaxColoursInPalette = 2;
05125 
05126     MaxColoursInPalette = max(2, min(MaxColoursInPalette, m__NumberOfColoursUserRequested));
05127 
05128     // work out how many spare colours we have within the user defined restraint
05129     // once we have kept these locked colours and have account for the transparency
05130 //  INT32 NoOfColoursToOptimise = MaxColoursInPalette - LockedColours - BackGroundTransp;
05131 
05132     m__pPaletteOptimiser->SnapToBrowserPalette(m__UseWebSnapPalette);
05133     m__pPaletteOptimiser->SnapToPrimaries(m__UsePrimarySnapPalette);
05134     m__pPaletteOptimiser->AddSystemColours((m__UseSystemColoursInPalette == TRUE));
05135     m__pPaletteOptimiser->UseBrowserPalette((m__UseBrowserPalette == TRUE));
05136 
05137     // tell the optimiser that we have finished gathering the stats
05138     //if (!m__HavePrimedOptimier) // can I get away with putting this optimisation back gav?
05139     {
05140         m__pPaletteOptimiser->GenPalette(max(2,MaxColoursInPalette - BackGroundTransp));
05141         m__HavePrimedOptimier = TRUE;
05142     }
05143 
05144     m__pLogicalPalette->palNumEntries = MaxColoursInPalette;
05145     m__pLogicalPalette->palVersion = 0x300;
05146 
05147     // get the optimised palette from the optimser
05148     /*BOOL JustBmpColours =*/ m__pPaletteOptimiser->GetPalette( m__pLogicalPalette, max(2,MaxColoursInPalette - BackGroundTransp));
05149 
05150 //  if (JustBmpColours)
05151 //      TRACE( _T("Just bmp colours\n"));
05152 //  else
05153 //      TRACE( _T("fully optimised colours\n"));
05154 
05155     // reset the flags in the new palette from the locked/deleted colours we had in the old palette
05156     // they may not be in the new palette, but they are LIKELY to be there
05157     INT32 index = -1;
05158     while ((index = FindNextLockedColour(index)) != -1) // find the next locked colour
05159     {
05160         // does this match in the palette
05161         for (i = 0; i < m__pLogicalPalette->palNumEntries; i++)
05162             if (NewFlags[i] == 0 &&
05163                 m_Palette.Data[index].Red   == m__pLogicalPalette->palPalEntry[ i ].peRed &&
05164                 m_Palette.Data[index].Green == m__pLogicalPalette->palPalEntry[ i ].peGreen &&
05165                 m_Palette.Data[index].Blue  == m__pLogicalPalette->palPalEntry[ i ].peBlue
05166                 )
05167             {
05168                 NewFlags[i] = m_Palette.Data[index].Flags;
05169                 EditedColours[i][0] = m_Palette.Data[index].PreEditedRed;
05170                 EditedColours[i][1] = m_Palette.Data[index].PreEditedGreen;
05171                 EditedColours[i][2] = m_Palette.Data[index].PreEditedBlue;
05172                 break;
05173             }
05174     }
05175 
05176     // special case for 1 colour - dont mix them up
05177     if (MaxColoursInPalette - BackGroundTransp == 1)
05178     {
05179         m_Palette.NumberOfColours = m__pLogicalPalette->palNumEntries = 2;
05180         // bias against the background colour and use the other colour if 
05181         // the background colour is more predominant
05182         DocColour dcol = Page::GetPageColour();
05183         INT32 bgr = 255, bgg = 255, bgb = 255;
05184 
05185         // the above call the GetPageColour doesn't work very well
05186         // this code gets it better if the spread and the layer exist
05187         Spread* pSelSpread = Document::GetSelectedSpread();
05188         if (pSelSpread)
05189         {
05190             Layer * pLayer = pSelSpread->FindFirstPageBackgroundLayer();
05191             if (pLayer)
05192             {
05193                 Node * pNode = SliceHelper::FindNextOfClass(pLayer, pLayer, CC_RUNTIME_CLASS(AttrFlatColourFill));
05194                 if (pNode)
05195                     dcol = *(((AttrFlatFill *)pNode)->GetStartColour());
05196             }
05197         }
05198 
05199         dcol.GetRGBValue(&bgr,&bgg,&bgb);
05200 
05201         // pick which of the two colours to use
05202         if (BackGroundTransp && 
05203             (m__pLogicalPalette->palPalEntry[ 0 ].peRed == (BYTE)bgr || m__pLogicalPalette->palPalEntry[ 0 ].peRed == (BYTE)bgr-1) &&
05204             (m__pLogicalPalette->palPalEntry[ 0 ].peGreen == (BYTE)bgg || m__pLogicalPalette->palPalEntry[ 0 ].peGreen == (BYTE)bgg-1) &&
05205             (m__pLogicalPalette->palPalEntry[ 0 ].peBlue == (BYTE)bgb || m__pLogicalPalette->palPalEntry[ 0 ].peBlue == (BYTE)bgb-1))
05206         {
05207             m__pLogicalPalette->palPalEntry[ 0 ].peRed = m__pLogicalPalette->palPalEntry[ 1 ].peRed;
05208             m__pLogicalPalette->palPalEntry[ 0 ].peGreen = m__pLogicalPalette->palPalEntry[ 1 ].peGreen;
05209             m__pLogicalPalette->palPalEntry[ 0 ].peBlue = m__pLogicalPalette->palPalEntry[ 1 ].peBlue;
05210         }
05211     }
05212     else if (MaxColoursInPalette == 2) // special case for two colour none transp
05213     {
05214         // make it black and white
05215         m__pLogicalPalette->palPalEntry[ 0 ].peRed = 0;
05216         m__pLogicalPalette->palPalEntry[ 0 ].peGreen = 0;
05217         m__pLogicalPalette->palPalEntry[ 0 ].peBlue = 0;
05218         m__pLogicalPalette->palPalEntry[ 0 ].peFlags = 0;
05219         m__pLogicalPalette->palPalEntry[ 1 ].peRed = 255;
05220         m__pLogicalPalette->palPalEntry[ 1 ].peGreen = 255;
05221         m__pLogicalPalette->palPalEntry[ 1 ].peBlue = 255;
05222         m__pLogicalPalette->palPalEntry[ 1 ].peFlags = 0;
05223     }
05224 
05225     // make room for transp as the first colour
05226     // by moving the other colours up
05227     if (BackGroundTransp)
05228     {
05229         // add the background colour to the palette which is one more colour in there
05230         if (m__pLogicalPalette->palNumEntries <  MaxColoursInPalette)
05231             m__pLogicalPalette->palNumEntries++;
05232 
05233         // move all the colours up a place
05234         for (INT32 i = m__pLogicalPalette->palNumEntries-1; i > 0; i--)
05235         {
05236             m__pLogicalPalette->palPalEntry[ i ].peRed = m__pLogicalPalette->palPalEntry[ i-1 ].peRed;
05237             m__pLogicalPalette->palPalEntry[ i ].peGreen = m__pLogicalPalette->palPalEntry[ i-1 ].peGreen;
05238             m__pLogicalPalette->palPalEntry[ i ].peBlue = m__pLogicalPalette->palPalEntry[ i-1 ].peBlue;
05239             NewFlags[i] = NewFlags[i-1];
05240             EditedColours[i][0] = EditedColours[i-1][0];
05241             EditedColours[i][1] = EditedColours[i-1][1];
05242             EditedColours[i][2] = EditedColours[i-1][2];
05243         }
05244 
05245         // the transp coluor is white 255,255,255
05246         m__pLogicalPalette->palPalEntry[ 0 ].peRed = 255;
05247         m__pLogicalPalette->palPalEntry[ 0 ].peGreen = 255;
05248         m__pLogicalPalette->palPalEntry[ 0 ].peBlue = 255;
05249 
05250         NewFlags[0] = TRANSPARENT_COLOUR;
05251         SetTransparencyIndex(0);
05252     }
05253     else
05254     {
05255         // we dont have background transparancy but do we have any other colour that is
05256         // set to being transparent?
05257         INT32 TranspIndex = -1; // the default no transp
05258         // find a transp marker in the new flags
05259         for (i = 0; i < m__pLogicalPalette->palNumEntries && TranspIndex == -1; i++)
05260         {
05261             if (NewFlags[i] & TRANSPARENT_COLOUR)
05262                 TranspIndex = i;
05263 
05264         }
05265         // set the transp index
05266         SetTransparencyIndex(TranspIndex);
05267     }
05268 
05269     // the palette is now valid
05270     m__PaletteIsValid = TRUE;
05271 
05272     // set the number of colours in the extended palette to match those in the new palette that
05273     // the optimiser returned to us
05274     m_Palette.NumberOfColours = m__pLogicalPalette->palNumEntries;
05275 
05276     // fill in the extended palette from the logical palette that is now optimal for this export
05277     for (i = 0; i < 256; i++)
05278     {
05279         m_Palette.Data[i].Red = m__pLogicalPalette->palPalEntry[ i ].peRed;
05280         m_Palette.Data[i].Green = m__pLogicalPalette->palPalEntry[ i ].peGreen;
05281         m_Palette.Data[i].Blue = m__pLogicalPalette->palPalEntry[ i ].peBlue;
05282         m_Palette.Data[i].Flags = NewFlags[i];
05283         m_Palette.Data[i].PreEditedRed = EditedColours[i][0];
05284         m_Palette.Data[i].PreEditedGreen = EditedColours[i][1];
05285         m_Palette.Data[i].PreEditedBlue = EditedColours[i][2];
05286 
05287         if (i >= m__pLogicalPalette->palNumEntries || 
05288             (m_Palette.Data[i].Flags & (DELETED_COLOUR | TRANSPARENT_COLOUR)))
05289             m__pLogicalPalette->palPalEntry[ i ].peFlags = 255; // meaning dont display this colour
05290         else
05291             m__pLogicalPalette->palPalEntry[ i ].peFlags = 0; // meaning do display this colour
05292     }
05293 
05294 }

BOOL BitmapExportOptions::Declare  )  [static]
 

Declares our base class preferences.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/7/97
Returns:
TRUE if successfully declared preferences FALSE otherwise

Reimplemented in MakeBitmapExportOptions, GIFExportOptions, MaskedFilterExportOptions, and PNGExportOptions.

Definition at line 658 of file bmpprefs.cpp.

00659 {
00660     if (Camelot.DeclareSection(_T("Filters"), 10))
00661     {
00662         Camelot.DeclarePref( NULL, ms_strPutHTMLTagOnClipboard, &ms_fPutHTMLTagOnClipboard, FALSE, TRUE );
00663     }
00664 
00665     return TRUE;
00666 }

BOOL BitmapExportOptions::DoesTempFileMatchExportOptions  )  [inline]
 

Definition at line 282 of file bmpprefs.h.

BOOL BitmapExportOptions::FileTypeChangeCopyFrom BitmapExportOptions pOther  )  [virtual]
 

Copies the information from the BitmapExportOptions object passed in as the argument to the palette object in this class.

Author:
Alex_Price (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/10/99
Parameters:
pOther - A BitmapExportOptions object we want to make a copy of. [INPUTS]
Returns:
-

Reimplemented in JPEGExportOptions, BMPExportOptions, GIFExportOptions, and MaskedFilterExportOptions.

Definition at line 452 of file bmpprefs.cpp.

00453 {
00454     m_SelectionType     = pOther->m_SelectionType;
00455     m_OutputSize        = pOther->m_OutputSize;
00456     m_PixelOutputSize   = pOther->m_PixelOutputSize;
00457     m_pBmpDlgParam      = pOther->m_pBmpDlgParam;       
00458     m_NumColsInPalette  = pOther->m_NumColsInPalette;
00459     m_UseSystemColours  = pOther->m_UseSystemColours;
00460     m_DPI               = pOther->m_DPI;
00461     m_Depth             = pOther->m_Depth;
00462     m_TransparencyIndex = pOther->m_TransparencyIndex;
00463     m_DialogID          = pOther->m_DialogID;
00464     m_bValid            = pOther->m_bValid;
00465     m_bTempFileExported = pOther->m_bTempFileExported;
00466     m_TempPath          = pOther->m_TempPath;
00467     m_fPutHTMLTagOnClipboard    = pOther->m_fPutHTMLTagOnClipboard;
00468     m_Antialiasing      = pOther->m_Antialiasing;
00469     m_UseDesignNotes    = pOther->m_UseDesignNotes;
00470     m_bSeparateLayerFiles = pOther->m_bSeparateLayerFiles;
00471     m_bTempFileFlag     = pOther->m_bTempFileFlag;
00472 
00473     // smfix new ones added
00474     m__NumberOfColoursUserRequested =   pOther->m__NumberOfColoursUserRequested;
00475     m__UseBrowserPalette =              pOther->m__UseBrowserPalette;
00476     m__UseSystemColoursInPalette =      pOther->m__UseSystemColoursInPalette;
00477     m__UseWebSnapPalette =              pOther->m__UseWebSnapPalette;
00478     m__UsePrimarySnapPalette =          pOther->m__UsePrimarySnapPalette;
00479     m__BackgroundIsTransparent =        pOther->m__BackgroundIsTransparent;
00480 
00481     // Also need to copy all the palette information over.
00482     CopyPaletteInformationFrom( pOther );
00483 
00484     return TRUE;
00485 }

BaseBitmapFilter * BitmapExportOptions::FindBitmapFilterForTheseExportOptions  ) 
 

> BaseBitmapFilter * BitmapExportOptions::FindBitmapFilterForTheseExportOptions()

Author:
Simon_Knight (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/12/00
Returns:
ptr to a filter that can be used to export using these export options

Definition at line 5567 of file bmpprefs.cpp.

05568 {
05569     // get the name this filter thinks it is
05570     const StringBase * pFilterName = GetFilterName();
05571     String_256 PreferedFiltersName = "";
05572     
05573     // check this ptr can be NULL
05574     if (pFilterName)
05575         PreferedFiltersName = *(GetFilterName());
05576 
05577     // fill it with the name that the export options thinks should be using the options
05578     // if the filters name hasn't been put in
05579     if (PreferedFiltersName.IsEmpty() || GetFilterNameStrID() == _R(IDT_FILTERNAME_BMP)) // bodge for _R(IDT_FILTERNAME_BMP) since the program is using multiple strings for this filter BMP/Windows bitmaps
05580     {
05581         PreferedFiltersName.Load(GetFilterNameStrID());
05582     }
05583 
05584 
05585     Filter *pFilter = Filter::GetFirst();
05586     while (pFilter != NULL)
05587     {
05588         // If we are filtering for bitmap filters then check that if a Bpp has been
05589         // specified that the bitmap filter can cope with that.
05590         FilterFlags Flags = pFilter->GetFlags();
05591         if (Flags.CanExport && pFilter->IsKindOf(CC_RUNTIME_CLASS(BaseBitmapFilter)))
05592         {
05593             BaseBitmapFilter* pBitmapFilter = (BaseBitmapFilter*)pFilter;
05594             if (PreferedFiltersName.CompareTo(pFilter->pOILFilter->FilterName, FALSE) == 0)
05595                 return pBitmapFilter;
05596         }
05597         // Try the next filter
05598         pFilter = Filter::GetNext(pFilter);
05599     }
05600 
05601     return NULL;
05602 }

INT32 BitmapExportOptions::FindNextLockedColour INT32  pos  ) 
 

Definition at line 5054 of file bmpprefs.cpp.

05055 {
05056     pos++;
05057     while (pos < m_Palette.NumberOfColours)
05058     {
05059         if (m_Palette.Data[pos].Flags & LOCKED_COLOUR || m_Palette.Data[pos].Flags & DELETED_COLOUR)
05060             return pos;
05061 
05062         pos++;
05063     }
05064     return -1;
05065 }

void BitmapExportOptions::GatherPaletteStats const RGBQUAD pBitmap,
UINT32  nSize
 

Definition at line 4974 of file bmpprefs.cpp.

04975 {
04976     if (m__pPaletteOptimiser)
04977     {
04978         m__pPaletteOptimiser->AddStats(pBitmap, nSize);
04979     }
04980 }

ANTIALIASING BitmapExportOptions::GetAntiAliasing  )  const [inline]
 

Definition at line 267 of file bmpprefs.h.

00267 { return m_Antialiasing; }

BmpDlgParam* BitmapExportOptions::GetBmpDlgParam  )  [inline]
 

Definition at line 255 of file bmpprefs.h.

00255 { return m_pBmpDlgParam; }

BOOL BitmapExportOptions::GetCanUseDesignNotes  )  const [inline]
 

Definition at line 293 of file bmpprefs.h.

00293 { return m_UseDesignNotes; }

BMP_DEPTH BitmapExportOptions::GetDepth  )  const
 

Support function to obtain bitmap options.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
The desired depth of the bitmap to export

Definition at line 960 of file bmpprefs.cpp.

00961 {
00963     // THIS IS JUST FOR TESTING! WHEN THE BITMAP COPY DIALOG GETS IT`s OWN 32BPP BUTTON
00964     // THEN THIS MUST BE REMOVED!!!!!!!
00965     //  I've change '>1' to '>=1' below, otherwise the 2 colour optimised palette
00966     //  is not available.
00967     if( m_Depth >= 1 )
00968     {
00969         return m_Depth;
00970     }
00971     else
00972     {
00973         return 32;
00974     }
00975 }

CDlgResID BitmapExportOptions::GetDialogType  )  const [inline]
 

Definition at line 243 of file bmpprefs.h.

00243 {return m_DialogID;}

virtual DITHER BitmapExportOptions::GetDither  )  const [inline, virtual]
 

Reimplemented in BMPExportOptions, and MaskedFilterExportOptions.

Definition at line 271 of file bmpprefs.h.

00271 { return XARADITHER_NONE; }

DPI BitmapExportOptions::GetDPI  )  const
 

Support function to obtain bitmap info.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
The desired dpi of the bitmap to export

Definition at line 911 of file bmpprefs.cpp.

00912 {
00913     return m_DPI;
00914 }

ExtendedPalette* BitmapExportOptions::GetExtendedPalette  )  [inline]
 

Definition at line 337 of file bmpprefs.h.

00337 { return &m_Palette; }

const StringBase * BitmapExportOptions::GetFilterName  )  const
 

Allows the export dialog to display the filter name in its title bar.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
The name of the filter associated with this BitmapExportOptions object

Definition at line 846 of file bmpprefs.cpp.

00847 {
00848     return m_pFilterName;
00849 }

virtual UINT32 BitmapExportOptions::GetFilterNameStrID  )  [inline, virtual]
 

Reimplemented in JPEGExportOptions, BMPExportOptions, GIFExportOptions, ImageMagickExportOptions, and PNGExportOptions.

Definition at line 248 of file bmpprefs.h.

00248 { return 0;} // this should be overriden by other export option subclasses

const FilterType BitmapExportOptions::GetFilterType  )  const [inline]
 

Definition at line 244 of file bmpprefs.h.

00244 {return m_FilterID;}

DWORD BitmapExportOptions::GetInterlaceType  ) 
 

Return true if the current filter allows palette info.

> DWORD BitmapExportOptions::GetInterlaceType()

Author:
Mark_Howitt (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/00
Returns:
TRUE if supported or FALSE if not!

Definition at line 5541 of file bmpprefs.cpp.

05542 {
05543     // Set up the return variable
05544     DWORD Supported = 0;
05545     UINT32 FilterStrID = GetFilterNameStrID();
05546 
05547     if(FilterStrID == _R(IDN_FILTERNAME_GIF))
05548         Supported = GIF_INTERLACE;
05549     else if(FilterStrID == _R(IDS_FILTERNAME_PNG))
05550         Supported = PNG_INTERLACE;
05551     else if(FilterStrID == _R(IDS_JPG_EXP_FILTERNAME))
05552         Supported = JPG_PROGRESSIVE;
05553 
05554     return Supported;
05555 }

LOGPALETTE * BitmapExportOptions::GetLogicalPalette  ) 
 

Definition at line 4984 of file bmpprefs.cpp.

04985 {
04986     ERROR3IF(!m__PaletteIsValid, "Palette not validated");
04987 
04988     // the logical palette is valid and current
04989     if (m__pLogicalPalette)
04990         return m__pLogicalPalette;
04991 
04992     // build a logical palette based on the extended palette
04993     // calling functions can read and use this data, but they should not delete it
04994     // the logical palette is managed by the export options
04995     m__pLogicalPalette = (LOGPALETTE * ) new BYTE[sizeof(LOGPALETTE) + ( sizeof(PALETTEENTRY) * 256 )];
04996     if (m__pLogicalPalette == NULL)
04997         return NULL;
04998 
04999     // pick a colour to duplicate for deleted colours to be
05000 //  INT32 OptimisedCommonColour = m_Palette.NumberOfColours-1;
05001 
05002     m__pLogicalPalette->palNumEntries = m_Palette.NumberOfColours;
05003     m__pLogicalPalette->palVersion = 0x300;
05004     INT32 i = 0;
05005     for( ; i < m__pLogicalPalette->palNumEntries; i++ )
05006     {
05007         m__pLogicalPalette->palPalEntry[ i ].peRed = m_Palette.Data[ i ].Red;
05008         m__pLogicalPalette->palPalEntry[ i ].peGreen = m_Palette.Data[ i ].Green;           
05009         m__pLogicalPalette->palPalEntry[ i ].peBlue = m_Palette.Data[ i ].Blue;
05010         BOOL NonRenderable = (m_Palette.Data[i].Flags & (DELETED_COLOUR | TRANSPARENT_COLOUR));
05011         m__pLogicalPalette->palPalEntry[ i ].peFlags = NonRenderable ? 255 : 0;
05012     }
05013 
05014     return m__pLogicalPalette;
05015 }

INT32 BitmapExportOptions::GetNumberOfUserRequestedColours  ) 
 

Definition at line 4874 of file bmpprefs.cpp.

04875 {
04876     return m__NumberOfColoursUserRequested;
04877 }

virtual UINT32 BitmapExportOptions::GetNumColsInPalette  )  [inline, virtual]
 

Definition at line 262 of file bmpprefs.h.

00262 { return m_NumColsInPalette; }

Coord BitmapExportOptions::GetOutputSize  )  [inline]
 

Definition at line 251 of file bmpprefs.h.

00251 { return m_OutputSize;  }

ExtendedPalette * BitmapExportOptions::GetPalette  ) 
 

Definition at line 559 of file bmpprefs.cpp.

00560 {
00561     return &m_Palette;
00562 }

PathName BitmapExportOptions::GetPathName  )  [inline]
 

Definition at line 279 of file bmpprefs.h.

00279 { return m_TempPath; };

Coord BitmapExportOptions::GetPixelOutputSize  )  [inline]
 

Definition at line 253 of file bmpprefs.h.

00253 { return m_PixelOutputSize; }

INT32 BitmapExportOptions::GetPrimarySnapPaletteAmount  ) 
 

Definition at line 4928 of file bmpprefs.cpp.

04929 {
04930     return m__UsePrimarySnapPalette;
04931 }

SelectionType BitmapExportOptions::GetSelectionType  )  const [inline]
 

Definition at line 234 of file bmpprefs.h.

00234 { return m_SelectionType;   }

BOOL BitmapExportOptions::GetSeparateLayerFiles  )  const [inline]
 

Definition at line 237 of file bmpprefs.h.

00237 {return m_bSeparateLayerFiles;}

DWORD BitmapExportOptions::GetSupportedColourDepths  ) 
 

Returns the all the colour depths the current filter supports.

> DWORD BitmapExportOptions::GetSupportedColourDepths()

Author:
Mark_Howitt (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/00
Returns:
BitField value of the avaliable colours allowed

Definition at line 5485 of file bmpprefs.cpp.

05486 {
05487     // Set up the return variable
05488     DWORD Supported = 0;
05489     UINT32 FilterStrID = GetFilterNameStrID();
05490 
05491     if(FilterStrID == _R(IDN_FILTERNAME_GIF))
05492         Supported = (COLOUR_2 | COLOUR_16 | COLOUR_256 );
05493     else if(FilterStrID == _R(IDT_FILTERNAME_BMP))
05494         Supported = (COLOUR_2 | COLOUR_16 | COLOUR_256 | COLOUR_24BIT);
05495     else if(FilterStrID == _R(IDS_FILTERNAME_PNG))
05496         Supported = (COLOUR_2 | COLOUR_16 | COLOUR_256 | COLOUR_24BIT | COLOUR_32BIT);
05497     else if (FilterStrID == _R(IDS_JPG_EXP_FILTERNAME))
05498         Supported = COLOUR_24BIT;
05499     else
05500         // Anything else gets a choice of all types
05501         Supported = (COLOUR_2 | COLOUR_16 | COLOUR_256 | COLOUR_24BIT | COLOUR_32BIT);
05502 
05503     return Supported;
05504 }

DWORD BitmapExportOptions::GetSupportedDithers  ) 
 

Returns the allowed dither types the current filter supports.

> DWORD BitmapExportOptions::GetSupportedDithers()

Author:
Mark_Howitt (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/00
Returns:
ENUM of the avaliable dither types, 0 if dithering not supported

Definition at line 5442 of file bmpprefs.cpp.

05443 {
05444     // Set up the return variable
05445     DWORD Supported = 0;
05446     UINT32 FilterStrID = GetFilterNameStrID();
05447 
05448     // We can only use palettes with Bitmaps of 8 BPP or less, so quick check first!
05449     if(m_Depth <= 8)
05450     {
05451         // Find out what Filter Type we are
05452 //      switch (FilterStrID)
05453 //      {
05454 //      case _R(IDN_FILTERNAME_GIF):
05455 //      case _R(IDS_FILTERNAME_PNG):
05456 //      case _R(IDT_FILTERNAME_BMP):
05457         if (FilterStrID==_R(IDN_FILTERNAME_GIF) || FilterStrID==_R(IDS_FILTERNAME_PNG) || FilterStrID==_R(IDT_FILTERNAME_BMP))
05458             {
05459                 Supported |= ERROR_DITHER;
05460 
05461                 if (m__UseBrowserPalette && m_Depth != 4)
05462                     Supported |= ORDERED_DITHER;
05463 
05464 //              break;
05465             }
05466 //      case _R(IDS_JPG_EXP_FILTERNAME):
05467 //      default:
05468 //          break; // Not supported so don`t do anything!
05469 //      }
05470     }
05471 
05472     return Supported;
05473 }

virtual BOOL BitmapExportOptions::GetSupportsImageMap  )  [inline, virtual]
 

Reimplemented in JPEGExportOptions, BMPExportOptions, GIFExportOptions, ImageMagickExportOptions, and PNGExportOptions.

Definition at line 225 of file bmpprefs.h.

00225 { return FALSE; }

BOOL BitmapExportOptions::GetSupportsPalette  ) 
 

Return true if the current filter allows palette info.

Author:
Mark_Howitt (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/00
Returns:
TRUE if supported or FALSE if not!

Definition at line 5416 of file bmpprefs.cpp.

05417 {
05418     // Set up the return variable
05419     BOOL Supported = FALSE;
05420     UINT32 FilterStrID = GetFilterNameStrID();
05421 
05422     // We can only use palettes with Bitmaps of 8 BPP or less, so quick check first!
05423     if(m_Depth <= 8)
05424     {
05425         // Find out what Filter Type we are
05426         Supported = (FilterStrID == _R(IDN_FILTERNAME_GIF) || FilterStrID == _R(IDT_FILTERNAME_BMP) || FilterStrID == _R(IDS_FILTERNAME_PNG));
05427     }
05428 
05429     return Supported;
05430 }

BOOL BitmapExportOptions::GetSupportsTransparency  ) 
 

Used to see if the current filter allows transparencies.

> BOOL BitmapExportOptions::SupportsTransparency()

Author:
Mark_Howitt (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/11/00
Returns:
TRUE if Supported else FALSE!

Definition at line 5516 of file bmpprefs.cpp.

05517 {
05518     // Set up the return variable
05519     BOOL Supported = FALSE;
05520     UINT32 FilterStrID = GetFilterNameStrID();
05521 
05522     // We can only use Transparency with Bitmaps of 8 BPP or less, so quick check first!
05523     if(m_Depth <= 8)
05524     {
05525         Supported = (FilterStrID == _R(IDN_FILTERNAME_GIF) || FilterStrID == _R(IDS_FILTERNAME_PNG));
05526     }
05527 
05528     return Supported;
05529 }

BOOL BitmapExportOptions::GetTempFileFlag  )  const [inline]
 

Definition at line 240 of file bmpprefs.h.

00240 {return m_bTempFileFlag;}

virtual INT32 BitmapExportOptions::GetTransparencyIndex  )  const [inline, virtual]
 

Definition at line 228 of file bmpprefs.h.

00228 { return m_TransparencyIndex; }

virtual BOOL BitmapExportOptions::GetUseSystemColours  )  [inline, virtual]
 

Definition at line 263 of file bmpprefs.h.

00263 { return m_UseSystemColours; }

INT32 BitmapExportOptions::GetWebSnapPaletteAmount  ) 
 

Definition at line 4914 of file bmpprefs.cpp.

04915 {
04916     return m__UseWebSnapPalette;
04917 }

BOOL BitmapExportOptions::HasTempFile  )  [inline]
 

Definition at line 280 of file bmpprefs.h.

00280 { return m_bTempFileExported; }

static BOOL BitmapExportOptions::Init void   )  [static]
 

Declares a preference that allows you to clear memory in delete().

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/4/94
Returns:
TRUE if it worked OK, FALSE if not

Reimplemented from SimpleCCObject.

void BitmapExportOptions::InvalidatePalette  ) 
 

Definition at line 4852 of file bmpprefs.cpp.

BOOL BitmapExportOptions::IsBackgroundTransparent  )  [inline]
 

Definition at line 332 of file bmpprefs.h.

00332 { return m__BackgroundIsTransparent; }

BOOL BitmapExportOptions::IsClipToPage  ) 
 

Definition at line 1032 of file bmpprefs.cpp.

01033 {
01034     if( m_SelectionType == PAGE )
01035         return TRUE;
01036     else
01037         return FALSE;
01038 }

BOOL BitmapExportOptions::IsCMYK  ) 
 

Definition at line 1041 of file bmpprefs.cpp.

01042 {
01043     return m_bCMYK;
01044 }

BOOL BitmapExportOptions::IsPaletteValid  ) 
 

Access functions add on 20/10/00 for use by the palette optimiser sjk SMFIX

All added in the cpp file so we can breakpoint on them nicely

Definition at line 4847 of file bmpprefs.cpp.

04848 {
04849     return m__PaletteIsValid;
04850 }

BOOL BitmapExportOptions::IsUsingBrowserPalette  ) 
 

Definition at line 4886 of file bmpprefs.cpp.

04887 {
04888     return m__UseBrowserPalette;
04889 }

BOOL BitmapExportOptions::IsUsingSystemPalette  ) 
 

Definition at line 4900 of file bmpprefs.cpp.

04901 {
04902     return m__UseSystemColoursInPalette;
04903 }

BOOL BitmapExportOptions::IsValid  )  const
 

Determines whether or not the values contained in this object are valid or whether the user has cancelled the export: using MarkValid() & MarkInvalid() will state the veracity of this fact.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
TRUE if this BitmapExportOptions object is valid for use in a subsequent export operation. FALSE otherwise

Definition at line 579 of file bmpprefs.cpp.

00580 {
00581     return m_bValid;
00582 }

BitmapExportOptions * BitmapExportOptions::MakeCopy  ) 
 

Makes a copy object of this object See Also: BitmapExportOptions::CopyFrom().

Author:
Stefan_Stoykov (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/05/97

Reimplemented in MakeBitmapExportOptions.

Definition at line 342 of file bmpprefs.cpp.

00343 {
00344     // Get the runtime class info on this object
00345     CCRuntimeClass* pCCRuntimeClass = GetRuntimeClass();
00346 
00347     // Create another object of the same type
00348     BitmapExportOptions* p = (BitmapExportOptions*) pCCRuntimeClass->CreateObject();
00349     if (p != 0)
00350     {
00351         // clear the exported file flag to prevent attempts to delete any temp files
00352         p->m_bTempFileExported = FALSE;
00353 
00354         // copy the contents accross
00355         p->CopyFrom(this);
00356     }
00357     
00358     return p;
00359 }

void BitmapExportOptions::MakePaletteEntryUnreadable INT32  i  )  [inline]
 

Definition at line 301 of file bmpprefs.h.

00301 { if (m__pLogicalPalette) m__pLogicalPalette->palPalEntry[i].peFlags = 255; }

void BitmapExportOptions::MarkInvalid  ) 
 

Definition at line 585 of file bmpprefs.cpp.

00586 {
00587     m_bValid = FALSE;
00588 }

void BitmapExportOptions::MarkValid  ) 
 

Definition at line 591 of file bmpprefs.cpp.

00592 {
00593     m_bValid = TRUE;
00594 }

BOOL BitmapExportOptions::Read CXaraFileRecord pRec  )  [virtual]
 

Reads this object from the given record.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/2/00
Parameters:
pRec --- record to read [INPUTS]
Returns:
TRUE if successful.
See also:
BitmapExportOptions::Write

Reimplemented in JPEGExportOptions, BMPExportOptions, GIFExportOptions, and MaskedFilterExportOptions.

Definition at line 748 of file bmpprefs.cpp.

00749 {
00750     // Make sure these bools are preset to zero as we only saved their
00751     // least significant byte.
00752     m_UseDesignNotes = m_UseSystemColours = m_fPutHTMLTagOnClipboard = FALSE;
00753 
00754     INT16 Packed = 0;
00755     UINT32 PackedRequestedColours = 0;
00756 
00757     // Read in every user-definable data member.
00758     String_256 strFilterName;
00759     if (!pRec->ReadINT16((INT16*) &m_SelectionType) ||
00760         !pRec->ReadCoord((DocCoord*) &m_OutputSize) ||
00761         !pRec->ReadCoord((DocCoord*) &m_PixelOutputSize) ||
00762         !pRec->ReadUINT32((UINT32*) &m_FilterID) ||
00763         !pRec->ReadBYTEtoBOOL(&m_UseDesignNotes) ||
00764         !pRec->ReadUINT32((UINT32*) &PackedRequestedColours) ||
00765         !pRec->ReadBYTEtoBOOL(&m__UseSystemColoursInPalette) ||
00766         !pRec->ReadBYTEtoBOOL(&m_fPutHTMLTagOnClipboard) ||
00767         !pRec->ReadDOUBLE((double*) &m_DPI) ||
00768         !pRec->ReadUINT32((UINT32*) &m_Depth) ||
00769         !pRec->ReadINT32(&m_TransparencyIndex) ||
00770         !pRec->ReadUINT32((UINT32*) &m_DialogID) ||
00771         !pRec->ReadINT16((INT16*) &Packed) ||
00772         !pRec->ReadINT32((INT32*) &m_Palette.NumberOfColours) ||
00773         !pRec->ReadUnicode(&strFilterName))
00774             return FALSE;
00775 
00776     // unpack the packed varibale to get the smfix data
00777     if (Packed & 1)
00778         m_Antialiasing = MINIMISE_VISIBLE_AA;
00779     else
00780         m_Antialiasing = MAINTAIN_SCREEN_AA;
00781 
00782     m__BackgroundIsTransparent = Packed & 2;
00783     m__UseBrowserPalette = Packed & 4;
00784     m__UsePrimarySnapPalette = (Packed >> 4) & 15;
00785     m__UseWebSnapPalette = (Packed >> 8) & 0xff;
00786 
00787     m__NumberOfColoursUserRequested = PackedRequestedColours;
00788 
00789     // Read in the palette.
00790     BYTE Dummy = 0;
00791     INT32 DummyPopularity = 0;
00792     ExtendedPaletteEntry* peEnd = &m_Palette.Data[min(m_Palette.NumberOfColours, 256)];
00793     for (ExtendedPaletteEntry* pe = m_Palette.Data; pe < peEnd; pe++)
00794     {
00795         if (!pRec->ReadBYTE(&pe->Red) ||
00796             !pRec->ReadBYTE(&pe->Green) ||
00797             !pRec->ReadBYTE(&pe->Blue) ||
00798             !pRec->ReadBYTE(&Dummy) ||
00799             !pRec->ReadINT32((INT32*) &DummyPopularity) ||
00800             !pRec->ReadINT32((INT32*) &pe->Flags))
00801                 return FALSE;
00802 
00803         // unpack the pre-edited colours
00804         DWORD PackedPreEditedColours = DummyPopularity;
00805         pe->PreEditedRed = (PackedPreEditedColours && 0xff);
00806         pe->PreEditedGreen = ((PackedPreEditedColours >> 8) && 0xff);
00807         pe->PreEditedBlue = ((PackedPreEditedColours >> 16) && 0xff);
00808     }
00809 
00810     if (m_DPI == 0)
00811     {
00812         TRACE( _T("DPI not set in export options in the .xar file - setting it to 96.0\n"));
00813         m_DPI = 96.0;
00814     }
00815 
00816 
00817     // Fix up the filter name string (for some brain-damaged reason this bears
00818     // little relation to the saved-out filter ID).
00819     if (strFilterName.IsEmpty())
00820         strFilterName.Load(GetFilterNameStrID());
00821 
00822     for (Filter* pf = Filter::GetFirst(); pf != 0; pf = Filter::GetNext(pf))
00823         if (pf->FilterName == strFilterName)
00824         {
00825             // Success.
00826             m_pFilterName = &pf->FilterName;
00827             return TRUE;
00828         }
00829     
00830     // Couldn't find the filter with the given name.
00831     TRACE( _T("BitmapExportOptions::Read: can't find %s filter\n"), (LPCTSTR) strFilterName);
00832     return FALSE;
00833 }

BOOL BitmapExportOptions::RetrieveDefaults  )  [virtual]
 

Retrieves defaults for accessible members from preferences See Also: BitmapExportOptions::SetAsDefaults().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Returns:
TRUE if successful FALSE otherwise

Reimplemented in JPEGExportOptions, MakeBitmapExportOptions, BMPExportOptions, GIFExportOptions, ImageMagickExportOptions, MaskedFilterExportOptions, and PNGExportOptions.

Definition at line 609 of file bmpprefs.cpp.

void BitmapExportOptions::SetAntiAliasing ANTIALIASING  aa  ) 
 

Sets the anti-aliasing on the export bitmap.

Author:
Simon_Knight (Xara Group Ltd) <camelotdev@xara.com>
Date:
long while ago - modified sjk 10/12/00

Definition at line 942 of file bmpprefs.cpp.

00943 {
00944     if (m_Antialiasing != aa)
00945         BitmapSourceHasChanged(); // flush cache
00946     m_Antialiasing = aa;
00947 }

BOOL BitmapExportOptions::SetAsDefaults  )  const [virtual]
 

Sets the current options as preferences which may be retrieved by a subsequent RetrieveDefaults() See Also: BitmapExportOptions::RetrieveDefaults().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96

Reimplemented in JPEGExportOptions, MakeBitmapExportOptions, BMPExportOptions, GIFExportOptions, ImageMagickExportOptions, MaskedFilterExportOptions, and PNGExportOptions.

Definition at line 634 of file bmpprefs.cpp.

void BitmapExportOptions::SetBackgroundTransparency BOOL  t  ) 
 

Definition at line 4866 of file bmpprefs.cpp.

04867 {
04868     if (m__BackgroundIsTransparent != t)
04869         InvalidatePalette();
04870     m__BackgroundIsTransparent = t;
04871 }

BOOL BitmapExportOptions::SetBitmapExportParam BitmapExportParam pParam  ) 
 

Definition at line 1020 of file bmpprefs.cpp.

01021 {
01022     ERROR2IF(pParam == NULL,FALSE,"pParam is NULL");
01023     m_pBmpDlgParam=pParam->GetBmpDlgParam();
01024 
01025     if(m_pBmpDlgParam == NULL)
01026         return FALSE;
01027 
01028     return TRUE;
01029 }

void BitmapExportOptions::SetCanUseDesignNotes BOOL  ok  )  [inline]
 

Definition at line 292 of file bmpprefs.h.

00292 { m_UseDesignNotes = ok; }

void BitmapExportOptions::SetCMYK BOOL  SetIt  ) 
 

Definition at line 1046 of file bmpprefs.cpp.

01047 {
01048     m_bCMYK = SetIt;
01049 }

BOOL BitmapExportOptions::SetDepth const BMP_DEPTH Depth  ) 
 

Support function to set up information for the ensuing export See Also: GetDepth().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Parameters:
Depth : The depth of the bitmap to be exported [INPUTS]
Returns:
TRUE if the operation was successful FALSE otherwise

Definition at line 991 of file bmpprefs.cpp.

00992 {
00993     if (m_Depth != Depth)
00994     {
00995         InvalidatePalette();
00996 
00997         // sjk bodge if we did have two colours moving up sometimes needs to regather the stats
00998         if (m_Depth == 1)
00999             BitmapSourceHasChanged();
01000     }
01001 
01002     m_Depth = Depth;
01003     return TRUE;
01004 }

virtual BOOL BitmapExportOptions::SetDither const DITHER  )  [inline, virtual]
 

Reimplemented in BMPExportOptions, and MaskedFilterExportOptions.

Definition at line 272 of file bmpprefs.h.

00272 { ERROR3("The base class has no concept of dithering"); return FALSE; }

BOOL BitmapExportOptions::SetDPI const DPI Dpi  ) 
 

Support function to set up information for the ensuing export See Also: GetDpi().

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/10/96
Parameters:
Dpi : The dpi of the bitmap to be exported [INPUTS]
Returns:
TRUE if the operation was successful FALSE otherwise

Definition at line 891 of file bmpprefs.cpp.

00892 {
00893     if (m_DPI != Dpi)
00894         BitmapSourceHasChanged(); // flush cache
00895 
00896     m_DPI = Dpi;
00897     return TRUE;
00898 }

void BitmapExportOptions::SetNumberOfUserRequestedColours INT32  n  ) 
 

Definition at line 4879 of file bmpprefs.cpp.

04880 {
04881     if (m__NumberOfColoursUserRequested != n)
04882         InvalidatePalette();
04883     m__NumberOfColoursUserRequested = n;
04884 }

virtual void BitmapExportOptions::SetNumColsInPalette UINT32  NumCols  )  [inline, virtual]
 

Definition at line 260 of file bmpprefs.h.

00260 { m_NumColsInPalette = NumCols; }

void BitmapExportOptions::SetOutputSize UINT32  x,
UINT32  y
[inline]
 

Definition at line 252 of file bmpprefs.h.

00252 { m_OutputSize.x = (INT32) x; m_OutputSize.y = (INT32) y;   }

void BitmapExportOptions::SetPathName PathName pTempPath  ) 
 

Allows the export options to keep the path to a temporary file, created during bitmap preview, so the export function can simply rename this to create the final exported file.

> void BitmapExportOptions::SetPathName(PathName *pTempPath)

Author:
Stefan_Stoykov (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/7/96
Parameters:
pTempPath - path name of a temporary file [INPUTS]
Returns:
None

Definition at line 865 of file bmpprefs.cpp.

00866 {
00867     // set the flag, to indicate that we have a temp file, but only if the path name is not null
00868     m_bTempFileExported = (pTempPath != NULL);
00869 
00870     if (m_bTempFileExported)
00871     {
00872         // remember the new path
00873         m_TempPath = *pTempPath;
00874     }
00875 }

void BitmapExportOptions::SetPixelOutputSize UINT32  x,
UINT32  y
[inline]
 

Definition at line 254 of file bmpprefs.h.

void BitmapExportOptions::SetPrimarySnapPaletteAmount INT32  SetIt  ) 
 

Definition at line 4933 of file bmpprefs.cpp.

04934 {
04935     if (m__UsePrimarySnapPalette != SetIt)
04936     {
04937         m__UsePrimarySnapPalette = SetIt;
04938         InvalidatePalette();
04939     }
04940 }

void BitmapExportOptions::SetPutHTMLTagOnClipboard BOOL  fValueToSet  )  [inline]
 

Definition at line 275 of file bmpprefs.h.

00275 { m_fPutHTMLTagOnClipboard = fValueToSet; }

void BitmapExportOptions::SetSelectionType const SelectionType Sel  ) 
 

sets the the item(s) being exported eg selection, page, drawing, etc

Author:
Simon_Knight (Xara Group Ltd) <camelotdev@xara.com>
Date:
long while ago - modified sjk 10/12/00

Definition at line 926 of file bmpprefs.cpp.

00927 {
00928     if (m_SelectionType != Sel)
00929         BitmapSourceHasChanged(); // flush cache
00930     m_SelectionType = Sel;
00931 }

void BitmapExportOptions::SetSeparateLayerFiles const BOOL  newFlag  )  [inline]
 

Definition at line 238 of file bmpprefs.h.

00238 {m_bSeparateLayerFiles = newFlag;}

void BitmapExportOptions::SetTempFileFlag const BOOL  newFlag  )  [inline]
 

Definition at line 241 of file bmpprefs.h.

00241 {m_bTempFileFlag = newFlag;}

void BitmapExportOptions::SetTempFileMatchesExportOptions BOOL  OptionsMatch  )  [inline]
 

Definition at line 281 of file bmpprefs.h.

00281 {m__TempFileMatchesExportOptions = OptionsMatch; }

void BitmapExportOptions::SetToUseBrowserPalette BOOL  SetIt  ) 
 

Definition at line 4891 of file bmpprefs.cpp.

04892 {
04893     if (m__UseBrowserPalette != SetIt)
04894     {
04895         m__UseBrowserPalette = SetIt;
04896         InvalidatePalette();
04897     }
04898 }

void BitmapExportOptions::SetToUseSystemPalette BOOL  SetIt  ) 
 

Definition at line 4905 of file bmpprefs.cpp.

04906 {
04907     if (m__UseSystemColoursInPalette != SetIt)
04908     {
04909         m__UseSystemColoursInPalette = SetIt;
04910         InvalidatePalette();
04911     }
04912 }

void BitmapExportOptions::SetTransparencyIndex INT32  TransparencyIndex  )  [virtual]
 

Definition at line 4859 of file bmpprefs.cpp.

04860 {
04861     if (m_TransparencyIndex != TransparencyIndex)
04862         SetTempFileMatchesExportOptions(FALSE);
04863     m_TransparencyIndex = TransparencyIndex; 
04864 }

virtual void BitmapExportOptions::SetUseSystemColours BOOL  SystemColours  )  [inline, virtual]
 

Definition at line 261 of file bmpprefs.h.

00261 { m_UseSystemColours = SystemColours; }

void BitmapExportOptions::SetWebSnapPaletteAmount INT32  SetIt  ) 
 

Definition at line 4919 of file bmpprefs.cpp.

04920 {
04921     if (m__UseWebSnapPalette != SetIt)
04922     {
04923         m__UseWebSnapPalette = SetIt;
04924         InvalidatePalette();
04925     }
04926 }

BOOL BitmapExportOptions::ShouldPutHTMLTagOnClipboard  )  [inline]
 

Definition at line 274 of file bmpprefs.h.

00274 { return m_fPutHTMLTagOnClipboard; }

BOOL BitmapExportOptions::SwapEditedColoursInLogicalPalette  ) 
 

Definition at line 5018 of file bmpprefs.cpp.

05019 {
05020     if (!m__pLogicalPalette)
05021         return FALSE;
05022 
05023     BOOL DidASwap = FALSE;
05024     for( INT32 i = 0; i < m__pLogicalPalette->palNumEntries; i++ )
05025     {
05026         if (m_Palette.Data[ i ].Flags & LOCKED_COLOUR)
05027         {
05028             BYTE t;
05029             t = m_Palette.Data[ i ].Red;
05030             m_Palette.Data[ i ].Red = m_Palette.Data[ i ].PreEditedRed;
05031             m_Palette.Data[ i ].PreEditedRed = t;
05032             m__pLogicalPalette->palPalEntry[ i ].peRed = m_Palette.Data[ i ].Red;
05033 
05034             t = m_Palette.Data[ i ].Green;
05035             m_Palette.Data[ i ].Green = m_Palette.Data[ i ].PreEditedGreen;
05036             m_Palette.Data[ i ].PreEditedGreen = t;
05037             m__pLogicalPalette->palPalEntry[ i ].peGreen = m_Palette.Data[ i ].Green;
05038 
05039             t = m_Palette.Data[ i ].Blue;
05040             m_Palette.Data[ i ].Blue = m_Palette.Data[ i ].PreEditedBlue;
05041             m_Palette.Data[ i ].PreEditedBlue = t;
05042             m__pLogicalPalette->palPalEntry[ i ].peBlue = m_Palette.Data[ i ].Blue;
05043 
05044             DidASwap = TRUE;
05045         }
05046     }
05047 
05048     return DidASwap;
05049 }

virtual BOOL BitmapExportOptions::UseSpecificNumColsInPalette  )  [inline, virtual]
 

Reimplemented in MaskedFilterExportOptions.

Definition at line 264 of file bmpprefs.h.

00264 { return FALSE; }

BOOL BitmapExportOptions::Write CXaraFileRecord pRec  )  [virtual]
 

Writes this object to the given record.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/2/00
Parameters:
pRec --- record to write [INPUTS]
Returns:
TRUE if successful.
See also:
BitmapExportOptions::Read

Reimplemented in JPEGExportOptions, BMPExportOptions, GIFExportOptions, and MaskedFilterExportOptions.

Definition at line 681 of file bmpprefs.cpp.

00682 {
00683     INT16 Packed = 0x0000;
00684 
00685     if (m_Antialiasing) Packed += 1;
00686     if (m__BackgroundIsTransparent) Packed += 2;
00687     if (m__UseBrowserPalette) Packed += 4;
00688 
00689     INT16 AmountOfPrimarySnap = (m__UsePrimarySnapPalette & 15) << 4;
00690     Packed += AmountOfPrimarySnap;
00691 
00692     INT16 AmountOfWebSnap = (m__UseWebSnapPalette & 0xff) << 8;
00693     Packed += AmountOfWebSnap;
00694 
00695     UINT32 PackedRequestedColours = m__NumberOfColoursUserRequested;
00696 
00697     // Write out every user-definable data member.  Note that as we save only
00698     // the lowest byte of a bool, we double-not them to ensure they are saved
00699     // out only as either 0 or 1.
00700     if (!pRec->WriteINT16((INT16) m_SelectionType) ||
00701         !pRec->WriteCoord((const DocCoord&) m_OutputSize) ||
00702         !pRec->WriteCoord((const DocCoord&) m_PixelOutputSize) ||
00703         !pRec->WriteUINT32((UINT32) m_FilterID) ||
00704         !pRec->WriteBYTE((BYTE) !!m_UseDesignNotes) ||
00705         !pRec->WriteUINT32(PackedRequestedColours) ||
00706         !pRec->WriteBYTE((BYTE) !!m__UseSystemColoursInPalette) ||
00707         !pRec->WriteBYTE((BYTE) !!m_fPutHTMLTagOnClipboard) ||
00708         !pRec->WriteDOUBLE((double) m_DPI) ||
00709         !pRec->WriteUINT32((UINT32) m_Depth) ||
00710         !pRec->WriteINT32(m_TransparencyIndex) ||
00711         !pRec->WriteUINT32((UINT32) m_DialogID) ||
00712         !pRec->WriteINT16(Packed) || // was m_Antialiasing but I have now packed this data to fit in the new stuff
00713         !pRec->WriteINT32(m_Palette.NumberOfColours) ||
00714         !pRec->WriteUnicode(m_pFilterName ? ((LPTSTR) (LPCTSTR) *m_pFilterName) : (LPTSTR) _T("")))
00715             return FALSE;
00716 
00717     // Write out the palette.
00718     BYTE Dummy = 0;
00719     ExtendedPaletteEntry* peEnd = &m_Palette.Data[min(m_Palette.NumberOfColours, 256)];
00720     for (ExtendedPaletteEntry* pe = m_Palette.Data; pe < peEnd; pe++)
00721     {
00722         DWORD PackedPreEditedColours = pe->PreEditedRed + (pe->PreEditedGreen << 8) + (pe->PreEditedBlue << 16);
00723         if (!pRec->WriteBYTE(pe->Red) ||
00724             !pRec->WriteBYTE(pe->Green) ||
00725             !pRec->WriteBYTE(pe->Blue) ||
00726             !pRec->WriteBYTE(Dummy) ||
00727             !pRec->WriteINT32((INT32)PackedPreEditedColours) || // used to be popularity but there should be no clash
00728             !pRec->WriteINT32(pe->Flags))
00729                 return FALSE;
00730     }
00731 
00732     return TRUE;
00733 }


Member Data Documentation

UINT32 BitmapExportOptions::g_NumColsInPalette = 256 [static, protected]
 

Definition at line 415 of file bmpprefs.h.

BOOL BitmapExportOptions::g_UseSystemColours = FALSE [static, protected]
 

Definition at line 416 of file bmpprefs.h.

BOOL BitmapExportOptions::m__BackgroundIsTransparent [private]
 

Definition at line 483 of file bmpprefs.h.

BOOL BitmapExportOptions::m__HavePrimedOptimier [private]
 

Definition at line 488 of file bmpprefs.h.

INT32 BitmapExportOptions::m__NumberOfColoursUserRequested [private]
 

Definition at line 470 of file bmpprefs.h.

BOOL BitmapExportOptions::m__PaletteIsValid [private]
 

Definition at line 457 of file bmpprefs.h.

LOGPALETTE* BitmapExportOptions::m__pLogicalPalette [private]
 

Definition at line 465 of file bmpprefs.h.

PaletteOptimiser* BitmapExportOptions::m__pPaletteOptimiser [private]
 

Definition at line 486 of file bmpprefs.h.

BOOL BitmapExportOptions::m__TempFileMatchesExportOptions [private]
 

Definition at line 490 of file bmpprefs.h.

BOOL BitmapExportOptions::m__UseBrowserPalette [private]
 

Definition at line 477 of file bmpprefs.h.

INT32 BitmapExportOptions::m__UsePrimarySnapPalette [private]
 

Definition at line 481 of file bmpprefs.h.

BOOL BitmapExportOptions::m__UseSystemColoursInPalette [private]
 

Definition at line 478 of file bmpprefs.h.

INT32 BitmapExportOptions::m__UseWebSnapPalette [private]
 

Definition at line 480 of file bmpprefs.h.

ANTIALIASING BitmapExportOptions::m_Antialiasing [private]
 

Definition at line 446 of file bmpprefs.h.

BOOL BitmapExportOptions::m_bCMYK [private]
 

Definition at line 492 of file bmpprefs.h.

BOOL BitmapExportOptions::m_bSeparateLayerFiles [protected]
 

Definition at line 409 of file bmpprefs.h.

BOOL BitmapExportOptions::m_bTempFileExported [private]
 

Definition at line 440 of file bmpprefs.h.

BOOL BitmapExportOptions::m_bTempFileFlag [protected]
 

Definition at line 410 of file bmpprefs.h.

BOOL BitmapExportOptions::m_bValid [private]
 

Definition at line 429 of file bmpprefs.h.

BMP_DEPTH BitmapExportOptions::m_Depth [private]
 

Definition at line 431 of file bmpprefs.h.

CDlgResID BitmapExportOptions::m_DialogID [private]
 

Definition at line 435 of file bmpprefs.h.

DPI BitmapExportOptions::m_DPI [private]
 

Definition at line 430 of file bmpprefs.h.

FilterType BitmapExportOptions::m_FilterID [protected]
 

Definition at line 406 of file bmpprefs.h.

BOOL BitmapExportOptions::m_fPutHTMLTagOnClipboard
 

Definition at line 419 of file bmpprefs.h.

UINT32 BitmapExportOptions::m_NumColsInPalette [protected]
 

Definition at line 413 of file bmpprefs.h.

Coord BitmapExportOptions::m_OutputSize [protected]
 

Definition at line 404 of file bmpprefs.h.

ExtendedPalette BitmapExportOptions::m_Palette [private]
 

Reimplemented in BMPExportOptions.

Definition at line 443 of file bmpprefs.h.

BmpDlgParam* BitmapExportOptions::m_pBmpDlgParam [protected]
 

Definition at line 407 of file bmpprefs.h.

const StringBase* BitmapExportOptions::m_pFilterName [private]
 

Definition at line 436 of file bmpprefs.h.

Coord BitmapExportOptions::m_PixelOutputSize [protected]
 

Definition at line 405 of file bmpprefs.h.

SelectionType BitmapExportOptions::m_SelectionType [protected]
 

Definition at line 403 of file bmpprefs.h.

PathName BitmapExportOptions::m_TempPath [private]
 

Definition at line 439 of file bmpprefs.h.

INT32 BitmapExportOptions::m_TransparencyIndex [private]
 

Definition at line 434 of file bmpprefs.h.

BOOL BitmapExportOptions::m_UseDesignNotes [protected]
 

Definition at line 408 of file bmpprefs.h.

BOOL BitmapExportOptions::m_UseSystemColours [protected]
 

Definition at line 414 of file bmpprefs.h.

ANTIALIASING BitmapExportOptions::ms_Antialiasing = MINIMISE_VISIBLE_AA [static]
 

Definition at line 423 of file bmpprefs.h.

BOOL BitmapExportOptions::ms_bSeparateLayerFiles = FALSE [static]
 

Definition at line 424 of file bmpprefs.h.

BOOL BitmapExportOptions::ms_fPutHTMLTagOnClipboard = FALSE [static]
 

The path to default to when opening the Export File dialogWhether we should put an HTML tag on the clipboard. FALSE by default.

Preference: HTMLToClipboard Section: Filters Range: FALSE, ranging all the way to TRUE

Definition at line 420 of file bmpprefs.h.

BOOL BitmapExportOptions::ms_IsBackGroundTransparent = TRUE [static]
 

Definition at line 422 of file bmpprefs.h.

TCHAR BitmapExportOptions::ms_strPutHTMLTagOnClipboard = _T("Filters\\PutHTMLTagOnClipboard") [static]
 

Definition at line 421 of file bmpprefs.h.


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