home *** CD-ROM | disk | FTP | other *** search
/ Compressed Image File Formats / CompressedImageFileFormatsJohnMiano.iso / pc / Examples / c10 / inc / jpendu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-12-17  |  1.6 KB  |  62 lines

  1. #ifndef __JPENDU_H
  2. #define __JPENDU_H
  3. //
  4. // Copyright (c) 1997,1998 Colosseum Builders, Inc.
  5. // All rights reserved.
  6. //
  7. // Colosseum Builders, Inc. makes no warranty, expressed or implied
  8. // with regards to this software. It is provided as is.
  9. //
  10. // See the README.TXT file that came with this software for restrictions
  11. // on the use and redistribution of this file or send E-mail to
  12. // info@colosseumbuilders.com
  13. //
  14.  
  15. //
  16. //  Title:  JpegEncoderDataUnit class definition
  17. //
  18. //  Author:  John M. Miano  miano@colosseumbuilders.com
  19. //
  20. //  Description:
  21. //
  22. //    This class represents a data unit in the JPEG encoder.
  23. //
  24.  
  25. #include "jpeg.h"
  26. #include "jpencobk.h"
  27. #include "jpenquan.h"
  28.  
  29. class JpegEncoderDataUnit
  30. {
  31. public:
  32.   typedef JPEGSAMPLE DATAUNITVALUE ;
  33.  
  34.   JpegEncoderDataUnit () {} ;
  35.   ~JpegEncoderDataUnit () {} ; //Must not be virtual.
  36.  
  37.   DATAUNITVALUE *operator[] (unsigned int) ;
  38.   DATAUNITVALUE &ZigZagInput (unsigned int) ;
  39.  
  40.   void ForwardDct (JpegEncoderQuantizationTable &,
  41.                    JpegEncoderCoefficientBlock &) ;
  42.  
  43. private:
  44.   JpegEncoderDataUnit (const JpegEncoderDataUnit &) ;
  45.   JpegEncoderDataUnit &operator=(const JpegEncoderDataUnit &) ;
  46.  
  47.   DATAUNITVALUE data [JpegSampleWidth][JpegSampleWidth] ;
  48. } ;
  49.  
  50. inline JpegEncoderDataUnit::DATAUNITVALUE *JpegEncoderDataUnit::operator [](unsigned int ii)
  51. {
  52.   return data [ii] ;
  53. }
  54.  
  55. inline JpegEncoderDataUnit::DATAUNITVALUE &JpegEncoderDataUnit::ZigZagInput (unsigned int ii)
  56. {
  57.   unsigned int order = JpegZigZagInputOrder (ii) ;
  58.   return ((DATAUNITVALUE *) data) [order] ;
  59. }
  60.  
  61. #endif
  62.