X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmJpeg.cxx;h=86403c62c8fd471a1921b02030c05531ee97746a;hb=aa0fc6ed66dc186bae363418702f402dc3f0ea21;hp=00cf4b0af90e46e5e30db4be414fb7283e3805cd;hpb=867b8ef63054497249cc3a0138107383d60351dc;p=gdcm.git diff --git a/src/gdcmJpeg.cxx b/src/gdcmJpeg.cxx index 00cf4b0a..86403c62 100644 --- a/src/gdcmJpeg.cxx +++ b/src/gdcmJpeg.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmJpeg.cxx,v $ Language: C++ - Date: $Date: 2004/10/18 02:17:07 $ - Version: $Revision: 1.27 $ + Date: $Date: 2004/10/22 03:05:42 $ + Version: $Revision: 1.28 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -85,10 +85,12 @@ of the uncompressed pixel data from which the compressed data is derived */ #include +#include +#include "jdatasrc.cxx" +#include "jdatadst.cxx" namespace gdcm { - /******************** JPEG COMPRESSION SAMPLE INTERFACE *******************/ /* This half of the example shows how to feed data into the JPEG compressor. @@ -136,7 +138,7 @@ namespace gdcm * @return 1 on success, 0 on error */ -bool gdcm_write_JPEG_file (FILE* fp, void* im_buf, +bool gdcm_write_JPEG_file (std::ofstream* fp, void* im_buf, int image_width, int image_height, int quality) { @@ -362,7 +364,7 @@ METHODDEF(void) my_error_exit (j_common_ptr cinfo) { * @return 1 on success, 0 on error */ -bool gdcm_read_JPEG_file ( FILE* fp, void* image_buffer ) +bool gdcm_read_JPEG_file ( std::ifstream* fp, void* image_buffer ) { char* pimage; @@ -503,7 +505,7 @@ bool gdcm_read_JPEG_file ( FILE* fp, void* image_buffer ) */ /* JSAMPLEs per row in output buffer */ - row_stride = cinfo.output_width * cinfo.output_components; + row_stride = cinfo.output_width * cinfo.output_components*2; #ifdef GDCM_JPG_DEBUG printf ("cinfo.output_width %d cinfo.output_components %d row_stride %d\n",