jpeg.h

Go to the documentation of this file.
00001 
00006 /*
00007  * Copyright (C) 1991-1998, Thomas G. Lane.
00008  * This file is part of the Independent JPEG Group's software.
00009  * For conditions of distribution and use, see the accompanying README file.
00010 */
00011 
00012 #ifndef JPEG_H
00013 #define JPEG_H
00014 
00015 #include <stdio.h>
00016 #include <jpeglib.h>
00017 
00018 #if BITS_IN_JSAMPLE == 8
00019 #define PUTPPMSAMPLE(ptr,v)  *ptr++ = (char) (v)
00020 #define BYTESPERSAMPLE 1
00021 #define PPM_MAXVAL 255
00022 #else
00023 #ifdef PPM_NORAWWORD
00024 #define PUTPPMSAMPLE(ptr,v)  *ptr++ = (char) ((v) >> (BITS_IN_JSAMPLE-8))
00025 #define BYTESPERSAMPLE 1
00026 #define PPM_MAXVAL 255
00027 #else
00028 /* The word-per-sample format always puts the LSB first. */
00029 #define PUTPPMSAMPLE(ptr,v)                     \
00030         { register int val_ = v;                \
00031           *ptr++ = (char) (val_ & 0xFF);        \
00032           *ptr++ = (char) ((val_ >> 8) & 0xFF); \
00033         }
00034 #define BYTESPERSAMPLE 2
00035 #define PPM_MAXVAL ((1<<BITS_IN_JSAMPLE)-1)
00036 #endif
00037 #endif
00038 
00039 void write_JPEG_file (unsigned char* image, int image_width, int image_height, char* filename, int quality);
00040 unsigned char* read_JPEG_file (char * filename, int image_width, int image_height);
00041 
00042 
00043 #endif

Generated on Tue Jan 22 17:07:29 2008 for MUAN by  doxygen 1.4.7