Program: gdcm
Module: $RCSfile: gdcmJpeg.cxx,v $
Language: C++
- Date: $Date: 2005/02/02 10:02:18 $
- Version: $Revision: 1.40 $
+ Date: $Date: 2005/02/04 23:30:21 $
+ Version: $Revision: 1.41 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
return true; //???
}
+extern "C" {
+ typedef void(*void_jpeg_common_struct)(jpeg_common_struct*);
+}
//-----------------------------------------------------------------------------
struct my_error_mgr {
// We set up the normal JPEG error routines, then override error_exit.
cinfo.err = jpeg_std_error(&jerr.pub);
- jerr.pub.error_exit = my_error_exit;
+ jerr.pub.error_exit = reinterpret_cast<void_jpeg_common_struct>(my_error_exit);
// Establish the setjmp return context for my_error_exit to use.
if (setjmp(jerr.setjmp_buffer))
/* Expanded data destination object for stdio output */
+extern "C" {
+ typedef int(*int_jpeg_compress_struct)(jpeg_compress_struct*);
+ typedef void(*void_jpeg_compress_struct)(jpeg_compress_struct*);
+}
+
typedef struct {
struct jpeg_destination_mgr pub; /* public fields */
}
dest = (my_dest_ptr) cinfo->dest;
- dest->pub.init_destination = init_destination;
- dest->pub.empty_output_buffer = empty_output_buffer;
- dest->pub.term_destination = term_destination;
+ dest->pub.init_destination = reinterpret_cast<void_jpeg_compress_struct>(init_destination);
+ dest->pub.empty_output_buffer = reinterpret_cast<int_jpeg_compress_struct>(empty_output_buffer);
+ dest->pub.term_destination = reinterpret_cast<void_jpeg_compress_struct>(term_destination);
dest->outfile = outfile;
}
/* Expanded data source object for stdio input */
+extern "C" {
+ typedef int(*int_jpeg_decompress_struct)(jpeg_decompress_struct*);
+ typedef void(*void_jpeg_decompress_struct)(jpeg_decompress_struct*);
+ typedef void(*void_jpeg_decompress_struct_long)(jpeg_decompress_struct*,long);
+}
+
typedef struct {
struct jpeg_source_mgr pub; /* public fields */
}
src = (my_src_ptr) cinfo->src;
- src->pub.init_source = init_source;
- src->pub.fill_input_buffer = fill_input_buffer;
- src->pub.skip_input_data = skip_input_data;
+ src->pub.init_source = reinterpret_cast<void_jpeg_decompress_struct>(init_source);
+ src->pub.fill_input_buffer = reinterpret_cast<int_jpeg_decompress_struct>(fill_input_buffer);
+ src->pub.skip_input_data = reinterpret_cast<void_jpeg_decompress_struct_long>(skip_input_data);
src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
- src->pub.term_source = term_source;
+ src->pub.term_source = reinterpret_cast<void_jpeg_decompress_struct>(term_source);
src->infile = infile;
// Need to setup a new buffer, clean bytes_in_buffer and next_input_byte