comparison src/image.c @ 78788:c077ece08ff6

(our_memory_fill_input_buffer) <buffer>: Move to file scope and rename to omfib_buffer for clarity. (gif_load) <interlace_start, interlace_increment>: Move to file scope.
author Glenn Morris <rgm@gnu.org>
date Fri, 14 Sep 2007 07:44:30 +0000
parents 8090732dfc6d
children abdfd1f5b491
comparison
equal deleted inserted replaced
78787:96a27ec4e6c5 78788:c077ece08ff6
6767 6767
6768 /* Fill input buffer method for JPEG data source manager. Called 6768 /* Fill input buffer method for JPEG data source manager. Called
6769 whenever more data is needed. We read the whole image in one step, 6769 whenever more data is needed. We read the whole image in one step,
6770 so this only adds a fake end of input marker at the end. */ 6770 so this only adds a fake end of input marker at the end. */
6771 6771
6772 static JOCTET omfib_buffer[2];
6773
6772 static boolean 6774 static boolean
6773 our_memory_fill_input_buffer (cinfo) 6775 our_memory_fill_input_buffer (cinfo)
6774 j_decompress_ptr cinfo; 6776 j_decompress_ptr cinfo;
6775 { 6777 {
6776 /* Insert a fake EOI marker. */ 6778 /* Insert a fake EOI marker. */
6777 struct jpeg_source_mgr *src = cinfo->src; 6779 struct jpeg_source_mgr *src = cinfo->src;
6778 static JOCTET buffer[2]; 6780
6779 6781 omfib_buffer[0] = (JOCTET) 0xFF;
6780 buffer[0] = (JOCTET) 0xFF; 6782 omfib_buffer[1] = (JOCTET) JPEG_EOI;
6781 buffer[1] = (JOCTET) JPEG_EOI; 6783
6782 6784 src->next_input_byte = omfib_buffer;
6783 src->next_input_byte = buffer;
6784 src->bytes_in_buffer = 2; 6785 src->bytes_in_buffer = 2;
6785 return 1; 6786 return 1;
6786 } 6787 }
6787 6788
6788 6789
7748 7749
7749 7750
7750 /* Load GIF image IMG for use on frame F. Value is non-zero if 7751 /* Load GIF image IMG for use on frame F. Value is non-zero if
7751 successful. */ 7752 successful. */
7752 7753
7754 static int interlace_start[] = {0, 4, 2, 1};
7755 static int interlace_increment[] = {8, 8, 4, 2};
7756
7753 static int 7757 static int
7754 gif_load (f, img) 7758 gif_load (f, img)
7755 struct frame *f; 7759 struct frame *f;
7756 struct image *img; 7760 struct image *img;
7757 { 7761 {
7918 problems with bytes >= 0x80. */ 7922 problems with bytes >= 0x80. */
7919 raster = (unsigned char *) gif->SavedImages[ino].RasterBits; 7923 raster = (unsigned char *) gif->SavedImages[ino].RasterBits;
7920 7924
7921 if (gif->SavedImages[ino].ImageDesc.Interlace) 7925 if (gif->SavedImages[ino].ImageDesc.Interlace)
7922 { 7926 {
7923 static int interlace_start[] = {0, 4, 2, 1};
7924 static int interlace_increment[] = {8, 8, 4, 2};
7925 int pass; 7927 int pass;
7926 int row = interlace_start[0]; 7928 int row = interlace_start[0];
7927 7929
7928 pass = 0; 7930 pass = 0;
7929 7931