16
16
along with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
*/
18
18
19
- #define JPEG_DEBUG
20
19
21
20
#include " JPEGImage.h"
22
21
#include " Logger.h"
@@ -132,7 +131,7 @@ void JPEGImage::loadImageInfo( int seq, int ang ){
132
131
Timer timer;
133
132
timer.start ();
134
133
#endif
135
-
134
+
136
135
// Save first resolution level
137
136
image_widths.clear ();
138
137
image_heights.clear ();
@@ -254,7 +253,7 @@ RawTile JPEGImage::getTile( int seq, int ang, unsigned int res, int layers, unsi
254
253
255
254
unsigned int tw = tile_widths[0 ];
256
255
unsigned int th = tile_heights[0 ];
257
-
256
+
258
257
// Get the width and height for last row and column tiles
259
258
unsigned int rem_x = image_widths[vipsres] % tile_widths[0 ];
260
259
unsigned int rem_y = image_heights[vipsres] % tile_heights[0 ];
@@ -342,7 +341,7 @@ void JPEGImage::process( unsigned int res, int layers, int xoffset, int yoffset,
342
341
// The libjpeg API can perform efficient scaling on the raw DCT co-efficients.
343
342
// The supported scaling ratios are M/8 with all M from 1 to 16. In other words
344
343
// we can shrink to a max of 1/8.
345
- // Note that 1/8 is the 4th resolution level with index=3 (0=1/1, 1=1/2, 2=1/4, 3=1/8)
344
+ // Note that 1/8 is the 4th resolution level with index=3 (0=1/1, 1=1/2, 2=1/4, 3=1/8)
346
345
// So calculate which libjpeg scaling to use and what extra scaling, if any, we also need to
347
346
// apply ourselves.
348
347
unsigned int factor = 1 ; // Downsampling factor - set it to default value
@@ -362,7 +361,7 @@ void JPEGImage::process( unsigned int res, int layers, int xoffset, int yoffset,
362
361
#ifdef JPEG_DEBUG
363
362
logfile << " JPEG :: Using sub-resolution at scale 1/8 with position " << x0 << " x" << y0
364
363
<< " and size " << w0 << " x" << h0 << endl;
365
- #endif
364
+ #endif
366
365
}
367
366
368
367
@@ -375,7 +374,7 @@ void JPEGImage::process( unsigned int res, int layers, int xoffset, int yoffset,
375
374
// Set libjpeg scaling (limited to 1/8)
376
375
cinfo.scale_num = 1 ;
377
376
cinfo.scale_denom = 1 << vipsres;
378
-
377
+
379
378
// Start decompression
380
379
jpeg_start_decompress ( &cinfo );
381
380
@@ -406,7 +405,7 @@ void JPEGImage::process( unsigned int res, int layers, int xoffset, int yoffset,
406
405
// Byte width of the line of pixels we want
407
406
unsigned int tile_stride = w0 * cinfo.output_components ;
408
407
409
-
408
+
410
409
// If we have to perform manual re-scaling, create a temporary buffer large enough for the data
411
410
if ( factor > 1 ){
412
411
buffer = (unsigned char *) malloc ( tile_stride * h0 );
0 commit comments