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