equal
deleted
inserted
replaced
232 self error:'can only read from an external stream'. |
232 self error:'can only read from an external stream'. |
233 ^ self. |
233 ^ self. |
234 ]. |
234 ]. |
235 |
235 |
236 %{ |
236 %{ |
237 errMgrStructSize = __MKSMALLINT(sizeof(struct my_error_mgr)); |
237 errMgrStructSize = __mkSmallInteger(sizeof(struct my_error_mgr)); |
238 decompressStructSize = __MKSMALLINT(sizeof(struct jpeg_decompress_struct)); |
238 decompressStructSize = __mkSmallInteger(sizeof(struct jpeg_decompress_struct)); |
239 %}. |
239 %}. |
240 |
240 |
241 jpeg_error_mgr_struct := ExternalBytes unprotectedNew:errMgrStructSize. |
241 jpeg_error_mgr_struct := ExternalBytes unprotectedNew:errMgrStructSize. |
242 jpeg_decompress_struct := ExternalBytes unprotectedNew:decompressStructSize. |
242 jpeg_decompress_struct := ExternalBytes unprotectedNew:decompressStructSize. |
243 errorOccurred := false. |
243 errorOccurred := false. |
343 (void) jpeg_read_header(cinfoPtr, TRUE); |
343 (void) jpeg_read_header(cinfoPtr, TRUE); |
344 |
344 |
345 /* Calculate output image dimensions so we can allocate space */ |
345 /* Calculate output image dimensions so we can allocate space */ |
346 jpeg_calc_output_dimensions(cinfoPtr); |
346 jpeg_calc_output_dimensions(cinfoPtr); |
347 |
347 |
348 __INST(width) = __MKSMALLINT(cinfoPtr->output_width); |
348 __INST(width) = __mkSmallInteger(cinfoPtr->output_width); |
349 __INST(height) = __MKSMALLINT(cinfoPtr->output_height); |
349 __INST(height) = __mkSmallInteger(cinfoPtr->output_height); |
350 __INST(colorComponents) = __MKSMALLINT(cinfoPtr->output_components); |
350 __INST(colorComponents) = __mkSmallInteger(cinfoPtr->output_components); |
351 |
351 |
352 #if 0 |
352 #if 0 |
353 /* could now set additional values in cinfo |
353 /* could now set additional values in cinfo |
354 * (colormap) |
354 * (colormap) |
355 */ |
355 */ |
394 if (setjmp(jerrPtr->setjmp_buffer)) { |
394 if (setjmp(jerrPtr->setjmp_buffer)) { |
395 /* |
395 /* |
396 * error occurred ... |
396 * error occurred ... |
397 */ |
397 */ |
398 jpeg_destroy_decompress(cinfoPtr); |
398 jpeg_destroy_decompress(cinfoPtr); |
399 RETURN (__MKSMALLINT(-1)); |
399 RETURN (__mkSmallInteger(-1)); |
400 } |
400 } |
401 num_scanlines = jpeg_read_scanlines(cinfoPtr, |
401 num_scanlines = jpeg_read_scanlines(cinfoPtr, |
402 rowPointers, |
402 rowPointers, |
403 1); |
403 1); |
404 RETURN (__MKSMALLINT(num_scanlines)); |
404 RETURN (__mkSmallInteger(num_scanlines)); |
405 } |
405 } |
406 RETURN (__MKSMALLINT(0)); |
406 RETURN (__mkSmallInteger(0)); |
407 } |
407 } |
408 %}. |
408 %}. |
409 self halt:'bad arguments'. |
409 self halt:'bad arguments'. |
410 ! |
410 ! |
411 |
411 |
576 ! ! |
576 ! ! |
577 |
577 |
578 !JPEGReader class methodsFor:'documentation'! |
578 !JPEGReader class methodsFor:'documentation'! |
579 |
579 |
580 version |
580 version |
581 ^ '$Header: /cvs/stx/stx/libview2/JPEGReader.st,v 1.45 2004-04-28 15:46:15 penk Exp $' |
581 ^ '$Header: /cvs/stx/stx/libview2/JPEGReader.st,v 1.46 2005-07-08 19:39:01 cg Exp $' |
582 ! ! |
582 ! ! |
583 |
583 |
584 JPEGReader initialize! |
584 JPEGReader initialize! |