home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / 3DTOSHI2.ZIP / mpgfx / include / gfxcltbl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-10  |  1.5 KB  |  59 lines

  1.  
  2. // gfxcltbl.h
  3. //
  4. // Copyright (c) 1995 by Toshiaki Tsuji, all rights reserved.
  5.  
  6. #ifndef __GFXCLTABLE_H__
  7. #define __GFXCLTABLE_H__
  8.  
  9. #include "stdgfx.h"
  10. #include "gfxpal.h"
  11. #include "gfxerror.h"
  12.  
  13. #define TABLE_MATCH  1
  14. #define TABLE_SHADE  2
  15. #define TABLE_HAZE   3
  16. #define TABLE_BLEND  4
  17.  
  18. typedef LONG (*COLTBLPROC) ( float Percentage );
  19.  
  20. class COLORTABLE : public MYOBJECT
  21.   {
  22.     protected :
  23.       LONG NumLevels;
  24.       LONG NumColors;
  25.       LONG TableType;
  26.       BYTE *Table;
  27.       COLTBLPROC ProcessIndicator;
  28.       RGBPALETTE *Pal;
  29.        
  30.       BOOLEAN Create ( LONG NumL, LONG NumCol );
  31.        
  32.     public :
  33.       COLORTABLE ();
  34.       virtual ~COLORTABLE ();
  35.       
  36.       VOID Destroy ();
  37.       
  38.       LONG GetNumColors () { return NumColors; };
  39.       LONG GetNumLevels () { return NumLevels; };
  40.       BYTE *GetTable () { return Table; };
  41.       LONG GetTableType () { return TableType; };
  42.  
  43.       RGBPALETTE* GetPalette () { return Pal; };
  44.       VOID CopyPalette ( RGBPALETTE *Pal );
  45.             
  46.       BOOLEAN CreateMatchTable ( RGBPALETTE *Pal2 );
  47.       BOOLEAN CreateShadeTable ( LONG NumLevels, LONG Highest, LONG Lowest );
  48.       BOOLEAN CreateHazeTable ( RGBCOLOR TargetColor, LONG NumLevel );
  49.       BOOLEAN CreateBlendTable ( LONG NumLevels, float StartRatio,
  50.                                  float EndRatio );
  51.       BOOLEAN Save ( STRING FileName );
  52.       BOOLEAN Load ( STRING FileName );
  53.  
  54.       VOID SetProcessIndicator ( COLTBLPROC Proc );
  55.   }; // End of COLORTABLE
  56.  
  57. #endif
  58.  
  59.