Lines Matching refs:buffer

76 				   unsigned char *buffer);
111 static size_t read_buffer_get_bytes (Read_Buffer * rb, SANE_Byte * buffer,
842 /* free the read buffer */
1031 * do a simple scan with the given registers. data buffer is allocated within
1304 low_is_home_line (Lexmark_Device * dev, unsigned char *buffer)
1307 This function assumes the buffer has a size of 2500 bytes.It is
1308 destructive to the buffer.
1312 Go through the buffer finding low and high values, which are computed by
1316 to 0x00 (black),so that the buffer only contains white (0xFF) or black
1319 Next, we go through the buffer. We use a tolerance of 5 bytes on each end
1320 of the buffer and check a region from bytes 5 to 2495. We start assuming
1357 fwrite (buffer, 2500, 1, trace);
1367 if (*(buffer + i) > max_byte)
1368 max_byte = *(buffer + i);
1369 if (*(buffer + i) < min_byte)
1370 min_byte = *(buffer + i);
1379 if (*(buffer + i) > average)
1380 *(buffer + i) = 0xFF;
1382 *(buffer + i) = 0x00;
1394 if ((region == white) && (*(buffer + i) == 0))
1409 else if ((region == black) && (*(buffer + i) == 0xFF))
1549 /* don't buffer data for this scan */
1655 SANE_Byte *buffer;
1909 /* create buffer for scan data */
1910 buffer = calloc (2500, sizeof (char));
1911 if (buffer == NULL)
1922 low_usb_bulk_read (devnum, buffer, &cmd_size);
1924 /* Reverse order of bytes in words of buffer */
1927 temp_byte = *(buffer + i);
1928 *(buffer + i) = *(buffer + i + 1);
1929 *(buffer + i + 1) = temp_byte;
1933 ret_val = low_is_home_line (dev, buffer);
1938 /* free the buffer */
1939 free (buffer);
1960 To read the scan data we create a buffer space large enough to hold 10
1963 available. The number of lines (or number of buffers in our buffer space)
1977 SANE_Byte *buffer;
2173 /* create buffer to hold up to 10 lines of scan data */
2174 buffer = calloc (10 * 2500, sizeof (char));
2175 if (buffer == NULL)
2228 /* force 1 buffer at a time to improve accuracy, which slow downs search */
2251 status = low_usb_bulk_read (devnum, buffer, &cmd_size);
2256 buffer_start = buffer + (i * 2500);
2257 /* Reverse order of bytes in words of buffer */
2265 fwrite (buffer + (i * 2500), 2500, 1, img);
2278 free (buffer);
2294 free (buffer);
2478 Byte swap the order of the bytes in the buffer.
2480 Go through the buffer finding low and high values, which are computed by
2484 to 0x00 (black),so that the buffer only contains white (0xFF) or black
2487 Next, we go through the buffer a line (88 bytes) at a time for 59 lines
2488 to read the entire buffer. For each byte in a line we check if the
2512 SANE_Byte *buffer;
2758 /* create buffer for scan data */
2759 buffer = calloc (5192, sizeof (char));
2760 if (buffer == NULL)
2771 low_usb_bulk_read (dev->devnum, buffer, &cmd_size);
2777 /* Reverse order of bytes in words of buffer */
2780 temp_byte = *(buffer + i);
2781 *(buffer + i) = *(buffer + i + 1);
2782 *(buffer + i + 1) = temp_byte;
2790 fwrite (buffer, 5192, 1, fdbg);
2798 if (*(buffer + i) > max_byte)
2799 max_byte = *(buffer + i);
2800 if (*(buffer + i) < min_byte)
2801 min_byte = *(buffer + i);
2809 if (*(buffer + i) > weighted_average)
2810 *(buffer + i) = 0xFF;
2812 *(buffer + i) = 0x00;
2820 fwrite (buffer, 5192, 1, fdbg);
2833 if (*(buffer + (j * 88) + i) == 0)
2850 } /* end for buffer */
2852 free (buffer);
4872 /* and 0 bytes in the transfer buffer */
4891 /* Initialize the read buffer */
4938 /* Check if we have a transfer buffer. Create one and fill it if we don't */
4960 /* Create buffer to hold the amount we will request */
4994 DBG (2, " Filled a buffer from the scanner\n");
5005 DBG (5, " buffer size: %lu\n", (u_long) dev->read_buffer->size);
5011 /* If there is space in the read buffer, copy the transfer buffer over */
5056 /* free the transfer buffer */
5065 DBG (5, " buffer size: %lu\n", (u_long) dev->read_buffer->size);
5070 /* Read blocks out of read buffer */
5074 DBG (2, " Copying lines from buffer to data\n");
5080 /* if no more bytes to xfer and read buffer empty we're at the end */
5302 rb->writeptr = rb->data; /* back to beginning of buffer */
5329 rb->writeptr = rb->data; /* back to beginning of buffer */
5385 /* are we at the last line in the read buffer ? */
5387 rb->writeptr = rb->data; /* back to beginning of buffer */
5412 read_buffer_get_bytes (Read_Buffer * rb, SANE_Byte * buffer, size_t rqst_size)
5426 memcpy (buffer, rb->readptr, available_bytes);
5434 memcpy (buffer, rb->readptr, rqst_size);
5442 /* We can read to the end of the buffer and make a recursive call to */
5443 /* read any available lines at the beginning of the buffer */
5447 /* We can read from the read pointer up to the end of the buffer */
5448 memcpy (buffer, rb->readptr, available_bytes);
5453 read_buffer_get_bytes (rb, buffer + available_bytes,
5459 memcpy (buffer, rb->readptr, rqst_size);