Lines Matching refs:bpl
696 SANE_Int bpl, size_t * lenp, void **idp, SANE_Int bank,
699 *lenp = lines * bpl;
708 return sanei_ab306_rdata (s->fd, planes, buf, lines, bpl);
717 return mustek_scsi_pp_rdata (s->fd, planes, buf, lines, bpl);
737 command[2] = ((lines * bpl) >> 16) & 0xff;
738 command[3] = ((lines * bpl) >> 8) & 0xff;
739 command[4] = ((lines * bpl) >> 0) & 0xff;
2957 scan_size = s->hw->bpl * s->hw->lines / 1024;
3218 get_image_status (Mustek_Scanner * s, SANE_Int * bpl, SANE_Int * lines)
3257 s->hw->bpl = result[1] | (result[2] << 8);
3265 *bpl = (s->hw->bpl * res) / half_res / 3;
3266 *bpl *= 3;
3267 DBG (4, "get_image_status: resolution > x-max; enlarge %d bpl to "
3268 "%d bpl\n", s->hw->bpl, *bpl);
3271 *bpl = s->hw->bpl;
3276 *bpl, *lines, offset);
3282 get_window (Mustek_Scanner * s, SANE_Int * bpl, SANE_Int * lines,
3311 DBG (4, "get_window: calibration bpl=%d, lines=%d\n",
3314 s->hw->bpl = (result[14] << 24) | (result[15] << 16) |
3320 DBG (4, "get_window: scan bpl=%d, lines=%d\n", s->hw->bpl, s->hw->lines);
3323 || (s->hw->bpl == 0) || (s->hw->lines == 0))
3348 *bpl = *pixels = (((s->hw->bpl / 3) * res) / half_res) * 3;
3353 *bpl = *pixels = (((s->hw->bpl / 3) * res) / s->ld.peak_res) * 3;
3362 *bpl = s->hw->bpl * res / half_res;
3366 *bpl = s->hw->bpl;
3370 DBG (4, "get_window: bpl = %d (hardware: %d), lines = %d (hardware: %d)\n",
3371 *bpl, s->hw->bpl, *lines, s->hw->lines);
3400 fix_line_distance_n_2 (Mustek_Scanner * s, SANE_Int num_lines, SANE_Int bpl,
3403 SANE_Byte *out_end, *out_ptr, *raw_end = raw + num_lines * bpl;
3413 MAX_LINE_DIST, bpl);
3414 s->ld.buf[0] = malloc (MAX_LINE_DIST * (long) bpl);
3426 memcpy (out, s->ld.buf[0], num_saved_lines * bpl);
3443 out_ptr = out + line * bpl + c;
3444 out_end = out_ptr + bpl;
3462 memcpy (s->ld.buf[0], out + num_lines * bpl,
3463 num_saved_lines * bpl);
3477 fix_line_distance_n_1 (Mustek_Scanner * s, SANE_Int num_lines, SANE_Int bpl,
3480 SANE_Byte *out_end, *out_ptr, *raw_end = raw + num_lines * bpl;
3493 MAX_LINE_DIST, bpl);
3494 s->ld.buf[0] = malloc (MAX_LINE_DIST * (long) bpl);
3503 DBG (5, "fix_line_distance_n_1: got %d lines, %d bpl\n", num_lines, bpl);
3508 memcpy (out, s->ld.buf[0], num_saved_lines * bpl);
3524 out_ptr = out + line * bpl + c;
3525 out_end = out_ptr + bpl;
3554 memcpy (s->ld.buf[0], out + num_lines * bpl, num_saved_lines * bpl);
3568 fix_line_distance_se (Mustek_Scanner * s, SANE_Int num_lines, SANE_Int bpl,
3571 SANE_Byte *raw_end = raw + num_lines * bpl;
3576 SANE_Int bpc = bpl / 3; /* bytes per color (per line) */
3601 3*bpl bytes. The maximum line distance for 1200 dpi is 32 */
3858 fix_line_distance_pro (Mustek_Scanner * s, SANE_Int num_lines, SANE_Int bpl,
3868 DBG (5, "fix_line_distance_pro: res=%d; halfres=%d; num_lines=%d; bpl=%d\n",
3869 res, half_res, num_lines, bpl);
3883 x_in = x_out * bpl / s->params.bytes_per_line / 2;
3886 in_addr = raw + y * bpl + x_in * 6;
3903 x_in = x_out * bpl / s->params.bytes_per_line / 2;
3905 in_addr = raw + y * bpl + x_in * 6;
3922 for (pixel = 0; pixel < (num_lines * bpl / 2); pixel++)
3929 for (pixel = 0; pixel < (num_lines * bpl / 2); pixel++)
3950 x_in = x_out * bpl / s->params.bytes_per_line;
3952 in_addr = raw + y * bpl + x_in * 3;
3960 memcpy (out, raw, num_lines * bpl);
3968 SANE_Int bpl, SANE_Byte * raw, SANE_Byte * out)
3970 SANE_Byte *out_end, *out_ptr, *raw_end = raw + num_lines * bpl;
3980 DBG (5, "fix_line_distance_normal: %d lines, %d bpl\n", num_lines, bpl);
3998 out_ptr = out + index[color] * bpl + color;
3999 out_end = out_ptr + bpl;
4016 fix_line_distance_block (Mustek_Scanner * s, SANE_Int num_lines, SANE_Int bpl,
4020 SANE_Byte *out_end, *out_ptr, *raw_end = raw + num_lines * bpl;
4026 "bytes\n", MAX_LINE_DIST, bpl);
4027 s->ld.buf[0] = malloc (MAX_LINE_DIST * (long) bpl);
4052 memcpy (out, s->ld.buf[0], num_saved_lines * bpl);
4071 out_ptr = out + line * bpl + c;
4072 out_end = out_ptr + bpl;
4102 "num_lines = %d; bpl = %d\n", num_saved_lines,
4103 num_lines, bpl);
4105 memcpy (s->ld.buf[0], out + num_lines * bpl,
4106 num_saved_lines * bpl);
4132 fix_line_distance_none (Mustek_Scanner * s, SANE_Int num_lines, SANE_Int bpl,
4156 grn_ptr = red_ptr + bpl / 3;
4157 blu_ptr = grn_ptr + bpl / 3;
4158 ptr_end = red_ptr + bpl;
4633 SANE_Byte * data, SANE_Int lines_per_buffer, SANE_Int bpl,
4639 DBG (5, "output_data: data=%p, lpb=%d, bpl=%d, extra=%p\n",
4640 (void *) data, lines_per_buffer, bpl, (void *) extra);
4650 fix_line_distance_pro (s, num_lines, bpl, data, extra);
4653 num_lines = fix_line_distance_se (s, num_lines, bpl, data, extra);
4658 num_lines = fix_line_distance_n_2 (s, num_lines, bpl, data,
4661 num_lines = fix_line_distance_n_1 (s, num_lines, bpl, data,
4668 num_lines = fix_line_distance_block (s, num_lines, bpl, data,
4671 num_lines = fix_line_distance_block (s, num_lines, bpl, data,
4677 fix_line_distance_normal (s, num_lines, bpl, data, extra);
4679 num_lines = fix_line_distance_none (s, num_lines, bpl, data, extra);
4690 for (byte_number = bpl - 3; byte_number >= 0; byte_number -= 3)
4692 fputc (*(extra + line_number * bpl + byte_number), fp);
4693 fputc (*(extra + line_number * bpl + byte_number + 1), fp);
4694 fputc (*(extra + line_number * bpl + byte_number + 2), fp);
4703 DBG (5, "output_data: write %d lpb; %d bpl\n", lines_per_buffer, bpl);
4715 DBG (5, "output_data: enlarge lines from %d bpl to %d bpl\n",
4716 s->hw->bpl, s->params.bytes_per_line);
4730 fputc (*(data + y * bpl + x), fp);
4743 if (*(data + x / 8 + y * bpl) & (1 << (7 - (x % 8))))
4770 ptr_end = ptr + lines_per_buffer * bpl;
4803 for (byte_number = bpl - 1; byte_number >= 0; byte_number--)
4805 fputc (*(data + line_number * bpl + byte_number), fp);
4811 fwrite (data, lines_per_buffer, bpl, fp);
4835 SANE_Int lines_per_buffer, bpl;
4890 bpl = s->hw->bpl;
4893 lines_per_buffer = s->hw->buffer_size / bpl / 2;
4913 DBG (1, "reader_process: bpl (%d) > SCSI buffer size / 2 (%d)\n",
4914 bpl, s->hw->buffer_size / 2);
4919 "%d bytes per buffer\n", lines_per_buffer, bpl,
4920 lines_per_buffer * bpl);
4922 bstat[0].data = malloc (2 * lines_per_buffer * (long) bpl);
4926 lines_per_buffer * (long) bpl);
4929 bstat[1].data = bstat[0].data + lines_per_buffer * (long) bpl;
4942 ptr = bstat[0].data + 2 * lines_per_buffer * (long) bpl - 1;
4979 max_buffers = s->hw->max_block_buffer_size / (lines_per_buffer * bpl);
5016 bstat[buffernumber].lines * bpl,
5043 bstat[buffernumber].lines, bpl, extra);
5083 bstat[buffernumber].lines * bpl, buffer_count);
5086 bstat[buffernumber].lines, bpl,
6219 DBG (4, "sane_get_parameters: lines = %d; ppl = %d; bpl = %d\n",