AdobeColourTableFilter Class Reference

Adobe Colour Table palette filter. More...

#include <coplfilr.h>

Inheritance diagram for AdobeColourTableFilter:

PaletteFilter Filter ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 AdobeColourTableFilter ()
 Constructor for a Adobe Colour Table palette filter.
 ~AdobeColourTableFilter ()
 Destructor for a Adobe Colour Table palette filter.
BOOL Init ()
 Initialise the filter, attaches OIL filter.
INT32 HowCompatible (PathName &Filename, ADDR HeaderStart, UINT32 HeaderSize, UINT32 FileSize)
 Examines a file to see how compatable it is with this filter.
virtual BOOL PreImport ()
 Reads the MS palette file header to see how many colours are in the file.
virtual BOOL ImportPalette ()
 Imports colours from an Abode Colour Table.
virtual BOOL PostImport ()
 Called to allow post import cleanup (if required) for this filter.

Private Member Functions

 CC_DECLARE_DYNAMIC (AdobeColourTableFilter)

Detailed Description

Adobe Colour Table palette filter.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/5/96

Definition at line 270 of file coplfilr.h.


Constructor & Destructor Documentation

AdobeColourTableFilter::AdobeColourTableFilter  ) 
 

Constructor for a Adobe Colour Table palette filter.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/5/96
Parameters:
- [INPUTS]
Returns:
-
See also:
PaletteFilter

Definition at line 1722 of file coplfilr.cpp.

01723 {
01724     // Set up filter descriptions.
01725     FilterName.Load(_R(IDT_FILTERNAME_ADOBECOLOURTABLE));
01726     FilterInfo.Load(_R(IDT_FILTERINFO_ADOBECOLOURTABLE));
01727     FilterID = FILTERID_ADOBECOLOURTABLE;
01728 
01729 #ifndef STANDALONE
01730     Flags.CanImport = TRUE;
01731     Flags.CanExport = FALSE;
01732 #else
01733     Flags.CanImport = FALSE;
01734     Flags.CanExport = FALSE;
01735 #endif
01736 
01737 #ifndef DO_EXPORT
01738     Flags.CanExport = FALSE;
01739 #endif
01740 }

AdobeColourTableFilter::~AdobeColourTableFilter  ) 
 

Destructor for a Adobe Colour Table palette filter.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/5/96
Parameters:
- [INPUTS]
Returns:
-
See also:
PaletteFilter

Definition at line 1753 of file coplfilr.cpp.

01754 {
01755 }


Member Function Documentation

AdobeColourTableFilter::CC_DECLARE_DYNAMIC AdobeColourTableFilter   )  [private]
 

INT32 AdobeColourTableFilter::HowCompatible PathName Filename,
ADDR  HeaderStart,
UINT32  HeaderSize,
UINT32  FileSize
[virtual]
 

Examines a file to see how compatable it is with this filter.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/5/96
Parameters:
Filename - the file being loads (allows checks on extensions). [INPUTS] HeaderStart - address of some bytes from the start of the file HeaderSize - the number of bytes at HeaderStart FileSize - the total length of the file
Returns:
Between 10 (Mine!) and 0 (Not Mine!) inclusive
See also:
Filter::HowCompatible

Reimplemented from Filter.

Definition at line 1791 of file coplfilr.cpp.

01792 {
01793 PORTNOTE("byteorder", "TODO: Check byte ordering")
01794     // Adobe colour tables are just raw data.  We have to go on file extension
01795     ERROR2IF(pOILFilter==NULL, 0, "No oil filter present");
01796     return ((AdobeColourTableOILFilter*)pOILFilter)->HowCompatible(Filename);
01797 }

BOOL AdobeColourTableFilter::ImportPalette  )  [virtual]
 

Imports colours from an Abode Colour Table.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/5/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE/FALSE for success/error

Implements PaletteFilter.

Definition at line 1827 of file coplfilr.cpp.

01828 {
01829     ERROR2IF(m_pImportFile==NULL, FALSE, "NULL pointer");
01830 
01831     BOOL ok = StartPercentage();
01832 
01833     while ( ok && m_pImportFile->good() && (m_pImportFile->tell()<m_pImportFile->Size()) )
01834     {
01835         // Read the RGB values for this colour from the file
01836         BYTE ColourDef[3];
01837         m_pImportFile->read(ColourDef, 3);
01838 
01839         // Add the colour to the imported colours list
01840         if (m_pImportFile->good())
01841             ok = ProcessRGBColour(ColourDef[0]/(double)0xff, ColourDef[1]/(double)0xff, ColourDef[2]/(double)0xff);
01842 
01843         SetPercentage();
01844     }
01845 
01846     return ok && m_pImportFile->good();
01847 }

BOOL AdobeColourTableFilter::Init void   )  [virtual]
 

Initialise the filter, attaches OIL filter.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/5/96
Parameters:
- [INPUTS]
Returns:
TRUE for successful init, FALSE if error occured
See also:
Filter::Init

Implements Filter.

Definition at line 1769 of file coplfilr.cpp.

01770 {
01771     // Get the OILFilter object
01772     pOILFilter = new AdobeColourTableOILFilter(this);
01773     
01774     return (pOILFilter != NULL);
01775 }

BOOL AdobeColourTableFilter::PostImport void   )  [virtual]
 

Called to allow post import cleanup (if required) for this filter.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/5/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE/FALSE for success/error

Implements PaletteFilter.

Definition at line 1860 of file coplfilr.cpp.

01861 {
01862     // Nothing to do, no cleanup required.
01863     return TRUE;
01864 }

BOOL AdobeColourTableFilter::PreImport  )  [virtual]
 

Reads the MS palette file header to see how many colours are in the file.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/5/96
Parameters:
- [INPUTS]
Sets import member vars [OUTPUTS]
Returns:
TRUE/FALSE for success/error

Implements PaletteFilter.

Definition at line 1810 of file coplfilr.cpp.

01811 {
01812     // No setup required
01813     return TRUE;
01814 }


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