home *** CD-ROM | disk | FTP | other *** search
- #include "jpegdeco.h"
-
- using namespace std ;
-
- JpegDecoder::JpegDecoder (istream &strm)
- {
- input_stream = &strm ;
- bit_position = 0 ;
- return ;
- }
- UBYTE1 JpegDecoder::ReadByte ()
- {
- UBYTE1 data ;
- input_stream->read ((char *) &data, 1) ;
- return data ;
- }
- int JpegDecoder::NextBit ()
- {
- if (bit_position == 0)
- {
- bit_buffer = ReadByte () ;
- bit_position = 8 ;
- }
- -- bit_position ;
- return (bit_buffer >> bit_position) & 1 ;
- }
-
-