#include <maskfilt.h>
Inheritance diagram for MaskedFilterExportOptions:
Public Member Functions | |
MaskedFilterExportOptions () | |
Default constructor Notes: This is a base class for GIF, PNG, etc.. Since MakedFilter doesn't provide a CreateExportOptions() member subclasses should either derive a new class from this one or provide objects of this class in their CreateExportOptions(). | |
MaskedFilterExportOptions (const CDlgResID &Dialog, const FilterType FilterID, const StringBase *pFilterName) | |
Constructor Notes: This is a base class for GIF, PNG, etc.. Since MakedFilter doesn't provide a CreateExportOptions() member subclasses should either derive a new class from this one or provide objects of this class in their CreateExportOptions(). | |
virtual BOOL | RetrieveDefaults () |
See BitmapExportOptions for interface details Notes: Gets MaskedFilter specific preferences (compression mainly). | |
virtual BOOL | SetAsDefaults () const |
See BitmapExportOptions for interface details Notes: Sets MaskedFilter specific preferences. | |
virtual BOOL | Write (CXaraFileRecord *pRec) |
Writes this object to the given record. | |
virtual BOOL | Read (CXaraFileRecord *pRec) |
Reads this object from the given record. | |
virtual DITHER | GetDither () const |
virtual BOOL | SetDither (const DITHER &Dither) |
Support function to set up information for the ensuing export See Also: GetDither(). | |
BOOL | WantTransparent () const |
Support function to obtain export options See Also: SetMakeTransparent(). | |
BOOL | WantInterlaced () const |
BOOL | SetMakeInterlaced (BOOL bInterlaced) |
Support function to set up information for the ensuing export See Also: WantInterlaced(). | |
void | SetFilterType (FilterType ID) |
virtual BOOL | UseSpecificNumColsInPalette () |
Masked filters have the ability to specify the exact number of colours in the generated optimised palette. | |
virtual BOOL | CopyFrom (BitmapExportOptions *pOther) |
Sets the contents of this object from the passed object See Also: BitmapExportOptions::MakeCopy(). | |
virtual BOOL | FileTypeChangeCopyFrom (BitmapExportOptions *pOther) |
Copies the information from the BitmapExportOptions object passed in as the argument to the variables in this class. | |
BOOL | CopyFromMasked (MaskedFilterExportOptions *pOther) |
Compares the contents of this and pOther objects Sets the contents of this object from the passed object. This differs form the more general function in that it doesn't require the two objects to be of the same class. Used to convert from/to PNG options and MakeBitmapExportOptions. See Also: BitmapExportOptions::MakeCopy(). | |
Static Public Member Functions | |
static BOOL | Declare () |
To declare preferences associated with these export options. | |
Protected Attributes | |
DITHER | m_Dither |
BOOL | m_bInterlaced |
Static Protected Attributes | |
static DITHER | g_Dither = XARADITHER_NONE |
static PALETTE | g_Palette = PAL_OPTIMISED |
static BOOL | g_bTransparent |
static BOOL | g_bInterlaced |
Definition at line 121 of file maskfilt.h.
|
Default constructor Notes: This is a base class for GIF, PNG, etc.. Since MakedFilter doesn't provide a CreateExportOptions() member subclasses should either derive a new class from this one or provide objects of this class in their CreateExportOptions().
Definition at line 179 of file maskfilt.cpp. 00180 : m_Dither(XARADITHER_NONE), // Dither type 00181 m_bInterlaced(FALSE) 00182 { 00183 m_NumColsInPalette = g_NumColsInPalette; // override base class 00184 m_UseSystemColours = g_UseSystemColours; 00185 }
|
|
Constructor Notes: This is a base class for GIF, PNG, etc.. Since MakedFilter doesn't provide a CreateExportOptions() member subclasses should either derive a new class from this one or provide objects of this class in their CreateExportOptions().
Definition at line 200 of file maskfilt.cpp. 00202 : BitmapExportOptions(Dialog, FilterID, pFilterName), 00203 m_Dither(XARADITHER_NONE), // Dither type 00204 m_bInterlaced(FALSE) 00205 { 00206 m_NumColsInPalette = g_NumColsInPalette; // override base class 00207 m_UseSystemColours = g_UseSystemColours; 00208 }
|
|
Sets the contents of this object from the passed object See Also: BitmapExportOptions::MakeCopy().
Reimplemented from BitmapExportOptions. Reimplemented in MakeBitmapExportOptions, and GIFExportOptions. Definition at line 221 of file maskfilt.cpp. 00222 { 00223 // copy the base class first 00224 if (!BitmapExportOptions::CopyFrom(pSource)) 00225 return FALSE; 00226 00227 // must be the same class, otherwise the base class function above returns FALSE 00228 MaskedFilterExportOptions *pOther = (MaskedFilterExportOptions *)pSource; 00229 00230 m_Dither = pOther->m_Dither; 00231 m_bInterlaced = pOther->m_bInterlaced; 00232 00233 return TRUE; 00234 }
|
|
Compares the contents of this and pOther objects Sets the contents of this object from the passed object. This differs form the more general function in that it doesn't require the two objects to be of the same class. Used to convert from/to PNG options and MakeBitmapExportOptions. See Also: BitmapExportOptions::MakeCopy().
Definition at line 325 of file maskfilt.cpp. 00326 { 00327 if (pOther == NULL) 00328 return FALSE; 00329 00330 //BitmapExportOptions members 00331 m_SelectionType = pOther->m_SelectionType; 00332 m_OutputSize = pOther->m_OutputSize; 00333 m_PixelOutputSize = pOther->m_PixelOutputSize; 00334 m_pBmpDlgParam = pOther->m_pBmpDlgParam; 00335 m_NumColsInPalette = pOther->m_NumColsInPalette; 00336 m_UseSystemColours = pOther->m_UseSystemColours; 00337 m_bSeparateLayerFiles = pOther->m_bSeparateLayerFiles; 00338 m_bTempFileFlag = pOther->m_bTempFileFlag; 00339 00340 SetDPI(pOther->GetDPI()); 00341 SetDepth(pOther->GetDepth()); 00342 SetTransparencyIndex(pOther->GetTransparencyIndex()); 00343 if (pOther->IsValid()) 00344 MarkValid(); 00345 else 00346 MarkInvalid(); 00347 00348 //MaskedFilterExportOptions 00349 m_Dither = pOther->m_Dither; 00350 m_bInterlaced = pOther->m_bInterlaced; 00351 00352 return TRUE; 00353 }
|
|
To declare preferences associated with these export options.
Reimplemented from BitmapExportOptions. Reimplemented in MakeBitmapExportOptions, GIFExportOptions, and PNGExportOptions. Definition at line 154 of file maskfilt.cpp. 00155 { 00156 if (Camelot.DeclareSection(_T("Filters"), 10)) 00157 { 00158 Camelot.DeclarePref( NULL, _T("Palette"), (INT32*)&g_Palette, 0, 1 ); 00159 Camelot.DeclarePref( NULL, _T("NumColsInPalette"), (INT32*)&g_NumColsInPalette, 0, 256 ); 00160 Camelot.DeclarePref( NULL, _T("UseSystemColours"), (INT32*)&g_UseSystemColours, 0, 1 ); 00161 } 00162 00163 // All ok 00164 return TRUE; 00165 }
|
|
Copies the information from the BitmapExportOptions object passed in as the argument to the variables in this class.
Reimplemented from BitmapExportOptions. Reimplemented in GIFExportOptions. Definition at line 248 of file maskfilt.cpp. 00249 { 00250 // Do the base class piece first 00251 if ( !BitmapExportOptions::FileTypeChangeCopyFrom( pOther ) ) 00252 return FALSE; 00253 00254 MaskedFilterExportOptions* pOther2 = ( MaskedFilterExportOptions* )pOther; 00255 00256 PORTNOTE("BMPFilter", "Removed use of BmpExportOptions") 00257 #ifndef EXCLUDE_FROM_XARALX 00258 if ( pOther->IS_KIND_OF(BMPExportOptions) ) 00259 { 00260 m_Dither = pOther2->m_Dither; 00261 // The following 2 don't exist in the bmp options. 00262 m_bInterlaced = 0; 00263 } 00264 else 00265 #endif 00266 if ( pOther->IS_KIND_OF(JPEGExportOptions) ) 00267 { 00268 // None of these exist in the jpeg options. 00269 // So, give them default values. 00270 m_Dither = g_Dither; 00271 m_bInterlaced = 0; 00272 } 00273 else 00274 { 00275 // Just copy them over 00276 m_Dither = pOther2->m_Dither; 00277 m_bInterlaced = pOther2->m_bInterlaced; 00278 } 00279 00280 return TRUE; 00281 }
|
|
Reimplemented from BitmapExportOptions. Definition at line 140 of file maskfilt.h. 00140 { return m_Dither; }
|
|
Reads this object from the given record.
Reimplemented from BitmapExportOptions. Reimplemented in GIFExportOptions. Definition at line 444 of file maskfilt.cpp. 00445 { 00446 BYTE Unused; 00447 INT16 AlsoUnused; 00448 m_bInterlaced = FALSE; 00449 return BitmapExportOptions::Read(pRec) && 00450 pRec->ReadINT16((INT16*) &m_Dither) && 00451 pRec->ReadINT16((INT16*) &AlsoUnused /*m_Palette*/) && 00452 pRec->ReadBYTE(&Unused) && 00453 pRec->ReadBYTEtoBOOL(&m_bInterlaced); 00454 }
|
|
See BitmapExportOptions for interface details Notes: Gets MaskedFilter specific preferences (compression mainly).
Reimplemented from BitmapExportOptions. Reimplemented in MakeBitmapExportOptions, GIFExportOptions, ImageMagickExportOptions, and PNGExportOptions. Definition at line 365 of file maskfilt.cpp. 00366 { 00367 if (!BitmapExportOptions::RetrieveDefaults()) 00368 return FALSE; 00369 00370 PORTNOTE("BMPFilter", "Remove use of GetDefaultExportDither") 00371 #ifndef EXCLUDE_FROM_XARALX 00372 UINT32 Dither = BMPFilter::GetDefaultExportDither(); 00373 ERROR2IF(Dither > 4, FALSE, "Dither Invalid"); 00374 #else 00375 UINT32 Dither = 0; 00376 #endif 00377 SetDither((DITHER)Dither); 00378 00379 m_Dither = g_Dither; 00380 m_NumColsInPalette = g_NumColsInPalette; 00381 m_UseSystemColours = g_UseSystemColours; 00382 00383 return TRUE; 00384 }
|
|
See BitmapExportOptions for interface details Notes: Sets MaskedFilter specific preferences.
Reimplemented from BitmapExportOptions. Reimplemented in MakeBitmapExportOptions, GIFExportOptions, ImageMagickExportOptions, and PNGExportOptions. Definition at line 396 of file maskfilt.cpp. 00397 { 00398 PORTNOTE("BMPFilter", "Removed use of BmpExportOptions") 00399 #ifndef EXCLUDE_FROM_XARALX 00400 if (!BitmapExportOptions::SetAsDefaults()) 00401 return FALSE; 00402 00403 BMPFilter::SetDefaultExportDither(GetDither()); 00404 #endif 00405 00406 // Derived classes can do their own thing with these... 00407 // m_bInterlaced; 00408 g_Dither = m_Dither; 00409 g_NumColsInPalette = m_NumColsInPalette; 00410 g_UseSystemColours = m_UseSystemColours; 00411 00412 return TRUE; 00413 }
|
|
Support function to set up information for the ensuing export See Also: GetDither().
Reimplemented from BitmapExportOptions. Definition at line 491 of file maskfilt.cpp. 00492 { 00493 if (m_Dither != Dither) 00494 SetTempFileMatchesExportOptions(FALSE); 00495 m_Dither = Dither; 00496 return TRUE; 00497 }
|
|
Definition at line 147 of file maskfilt.h. 00147 { m_FilterID = ID; }
|
|
Support function to set up information for the ensuing export See Also: WantInterlaced().
Definition at line 530 of file maskfilt.cpp. 00531 { 00532 if (m_bInterlaced != bInterlaced) 00533 SetTempFileMatchesExportOptions(FALSE); 00534 m_bInterlaced = bInterlaced; 00535 return TRUE; 00536 }
|
|
Masked filters have the ability to specify the exact number of colours in the generated optimised palette.
Introduced for WEBSTER Reimplemented from BitmapExportOptions. Definition at line 472 of file maskfilt.cpp. 00473 { 00474 // Don't use specific num colours when exporting bitmaps 00475 return (GetSelectionType() != ABITMAP && GetSelectionType() != SOMEBITMAPS); 00476 }
|
|
Definition at line 144 of file maskfilt.h. 00144 { return m_bInterlaced; }
|
|
Support function to obtain export options See Also: SetMakeTransparent().
Definition at line 510 of file maskfilt.cpp. 00511 { 00512 // smfix - only go on the transp index 00513 return GetTransparencyIndex() != -1; 00514 }
|
|
Writes this object to the given record.
Reimplemented from BitmapExportOptions. Reimplemented in GIFExportOptions. Definition at line 425 of file maskfilt.cpp. 00426 { 00427 return BitmapExportOptions::Write(pRec) && 00428 pRec->WriteINT16((INT16) m_Dither) && 00429 pRec->WriteINT16((INT16) 0 /*m_Palette*/) && 00430 pRec->WriteBYTE((BYTE) TRUE) && 00431 pRec->WriteBYTE((BYTE) !!m_bInterlaced); 00432 }
|
|
Definition at line 172 of file maskfilt.h. |
|
Definition at line 171 of file maskfilt.h. |
|
Reimplemented in MakeBitmapExportOptions. Definition at line 169 of file maskfilt.h. |
|
Reimplemented in MakeBitmapExportOptions. Definition at line 170 of file maskfilt.h. |
|
Definition at line 166 of file maskfilt.h. |
|
Definition at line 165 of file maskfilt.h. |