Lines Matching defs:scn

1369   struct st_scanning *scn;
1375 scn = dev->scanning;
1377 if (scn->imagebuffer == NULL)
1389 scn->bfsize =
1390 (scn->arrange_hres ==
1391 TRUE) ? scn->arrange_sensor_evenodd_dist : 0;
1392 scn->bfsize = (scn->bfsize + (mydistance * 2) + 1) * line_size;
1395 scn->bfsize = line_size * 2;
1399 (((scn->bfsize / line_size) * bytesperline) >
1400 scn->bfsize) ? (scn->bfsize / line_size) *
1401 bytesperline : scn->bfsize;
1403 scn->imagebuffer = (SANE_Byte *) malloc (space * sizeof (SANE_Byte));
1404 if (scn->imagebuffer == NULL)
1407 scn->imagepointer = scn->imagebuffer;
1409 if (Read_Block (dev, scn->bfsize, scn->imagebuffer, transferred) != OK)
1412 scn->arrange_orderchannel = FALSE;
1413 scn->channel_size = (scan2.depth == 8) ? 1 : 2;
1421 if (scn->arrange_hres == FALSE)
1425 scn->arrange_orderchannel = TRUE;
1427 if (scn->arrange_orderchannel == TRUE)
1428 scn->desp[c] =
1430 (scn->channel_size * c);
1432 scn->desp[c] = scn->channel_size * c;
1438 scn->desp[c] =
1440 (scn->channel_size * c);
1442 if (scn->arrange_hres == TRUE)
1444 scn->desp1[c] = scn->desp[c];
1445 scn->desp2[c] =
1446 ((scn->channel_size * 3) + scn->desp[c]) +
1447 (scn->arrange_sensor_evenodd_dist * line_size);
1455 if (scn->arrange_hres == TRUE)
1457 scn->pColour2[c] = scn->imagebuffer + scn->desp2[c];
1458 scn->pColour1[c] = scn->imagebuffer + scn->desp1[c];
1461 scn->pColour[c] = scn->imagebuffer + scn->desp[c];
1469 if (scn->arrange_orderchannel == FALSE)
1471 if (scn->arrange_hres == TRUE)
1472 Triplet_Colour_HRes (scn->pColour1[CL_RED],
1473 scn->pColour1[CL_GREEN],
1474 scn->pColour1[CL_BLUE],
1475 scn->pColour2[CL_RED],
1476 scn->pColour2[CL_GREEN],
1477 scn->pColour2[CL_BLUE], buffer,
1478 line_size / (scn->channel_size * 3));
1480 Triplet_Colour_LRes (line_size / (scn->channel_size * 3), buffer,
1481 scn->pColour[CL_RED], scn->pColour[CL_GREEN],
1482 scn->pColour[CL_BLUE]);
1485 Triplet_Colour_Order (dev, scn->pColour[CL_RED],
1486 scn->pColour[CL_GREEN], scn->pColour[CL_BLUE],
1487 buffer, line_size / (scn->channel_size * 3));
1489 scn->arrange_size -= bytesperline;
1490 if (scn->arrange_size < 0)
1498 if ((scn->arrange_size | v15bc) == 0)
1502 if (Read_Block (dev, line_size, scn->imagepointer, transferred) ==
1509 if (scn->arrange_hres == TRUE)
1512 scn->desp2[c] = (scn->desp2[c] + line_size) % scn->bfsize;
1513 scn->desp1[c] = (scn->desp1[c] + line_size) % scn->bfsize;
1515 scn->pColour2[c] = scn->imagebuffer + scn->desp2[c];
1516 scn->pColour1[c] = scn->imagebuffer + scn->desp1[c];
1521 scn->desp[c] = (scn->desp[c] + line_size) % scn->bfsize;
1522 scn->pColour[c] = scn->imagebuffer + scn->desp[c];
1527 scn->imagepointer += line_size;
1528 if (scn->imagepointer >= (scn->imagebuffer + scn->bfsize))
1529 scn->imagepointer = scn->imagebuffer;
5626 struct st_scanning *scn;
5633 scn = dev->scanning;
5635 if (scn->imagebuffer == NULL)
5637 if ((scn->arrange_hres == TRUE) || (scan2.colormode == CM_LINEART))
5639 scn->bfsize = (scn->arrange_sensor_evenodd_dist + 1) * line_size;
5640 scn->imagebuffer =
5641 (SANE_Byte *) malloc (scn->bfsize * sizeof (SANE_Byte));
5642 if (scn->imagebuffer != NULL)
5644 if (Read_Block (dev, scn->bfsize, scn->imagebuffer, transferred)
5647 scn->channel_size = (scan2.depth == 8) ? 1 : 2;
5648 scn->desp1[CL_RED] = 0;
5649 scn->desp2[CL_RED] =
5650 scn->channel_size +
5651 (scn->arrange_sensor_evenodd_dist * line_size);
5652 scn->pColour2[CL_RED] =
5653 scn->imagebuffer + scn->desp2[CL_RED];
5654 scn->pColour1[CL_RED] =
5655 scn->imagebuffer + scn->desp1[CL_RED];
5667 scn->imagepointer = scn->imagebuffer;
5669 channels_count = line_size / scn->channel_size;
5673 Triplet_Lineart (scn->pColour1[CL_RED], scn->pColour2[CL_RED],
5676 Triplet_Gray (scn->pColour1[CL_RED], scn->pColour2[CL_RED],
5680 scn->arrange_size -= bytesperline;
5685 if ((scn->arrange_size | v15bc) == 0)
5689 rst = Read_Block (dev, line_size, scn->imagepointer, transferred);
5693 if (scn->arrange_hres == TRUE)
5695 scn->desp2[CL_RED] =
5696 (line_size + scn->desp2[CL_RED]) % scn->bfsize;
5697 scn->desp1[CL_RED] =
5698 (line_size + scn->desp1[CL_RED]) % scn->bfsize;
5700 scn->pColour2[CL_RED] = scn->imagebuffer + scn->desp2[CL_RED];
5701 scn->pColour1[CL_RED] = scn->imagebuffer + scn->desp1[CL_RED];
5705 scn->imagepointer += line_size;
5706 if (scn->imagepointer >= (scn->imagebuffer + scn->bfsize))
5707 scn->imagepointer = scn->imagebuffer;
6574 struct st_scanning *scn;
6584 scn = dev->scanning;
6586 if (scn->imagebuffer == NULL)
6597 scn->bfsize =
6598 (scn->arrange_hres ==
6599 TRUE) ? scn->arrange_sensor_evenodd_dist : 0;
6600 scn->bfsize = line_size * (scn->bfsize + (mydistance * 2) + 1);
6603 scn->bfsize = line_size * 2;
6606 scn->imagebuffer =
6607 (SANE_Byte *) malloc (scn->bfsize * sizeof (SANE_Byte));
6608 if (scn->imagebuffer == NULL)
6611 scn->imagepointer = scn->imagebuffer;
6612 if (Read_Block (dev, scn->bfsize, scn->imagebuffer, transferred) ==
6617 scn->arrange_orderchannel = FALSE;
6623 if (scn->arrange_hres == FALSE)
6627 scn->arrange_orderchannel = TRUE;
6629 if (scn->arrange_orderchannel == TRUE)
6630 scn->desp[c] =
6634 scn->desp[c] = channel_size * c;
6640 scn->desp[c] =
6644 if (scn->arrange_hres == TRUE)
6647 scn->desp1[c] = scn->desp[c];
6648 scn->desp2[c] =
6649 ((channel_size * 3) + scn->desp1[c]) +
6650 (scn->arrange_sensor_evenodd_dist * line_size);
6657 if (scn->arrange_hres == TRUE)
6659 scn->pColour2[c] = scn->imagebuffer + scn->desp2[c];
6660 scn->pColour1[c] = scn->imagebuffer + scn->desp1[c];
6663 scn->pColour[c] = scn->imagebuffer + scn->desp[c];
6673 if (scn->arrange_orderchannel == FALSE)
6676 if (scn->arrange_hres == TRUE)
6677 Triplet_Compose_HRes (scn->pColour1[CL_RED],
6678 scn->pColour1[CL_GREEN],
6679 scn->pColour1[CL_BLUE],
6680 scn->pColour2[CL_RED],
6681 scn->pColour2[CL_GREEN],
6682 scn->pColour2[CL_BLUE], mybuffer, mydots);
6684 Triplet_Compose_LRes (scn->pColour[CL_RED],
6685 scn->pColour[CL_GREEN],
6686 scn->pColour[CL_BLUE], mybuffer, mydots);
6689 Triplet_Compose_Order (dev, scn->pColour[CL_RED],
6690 scn->pColour[CL_GREEN], scn->pColour[CL_BLUE],
6695 scn->arrange_size -= bytesperline;
6696 if (scn->arrange_size < 0)
6702 if ((scn->arrange_size | v15bc) == 0)
6707 if (Read_Block (dev, line_size, scn->imagepointer, transferred) ==
6713 if (scn->arrange_hres == TRUE)
6716 scn->desp2[c] = (scn->desp2[c] + line_size) % scn->bfsize;
6717 scn->desp1[c] = (scn->desp1[c] + line_size) % scn->bfsize;
6719 scn->pColour2[c] = scn->imagebuffer + scn->desp2[c];
6720 scn->pColour1[c] = scn->imagebuffer + scn->desp1[c];
6725 scn->desp[c] = (scn->desp[c] + line_size) % scn->bfsize;
6726 scn->pColour[c] = scn->imagebuffer + scn->desp[c];
6731 scn->imagepointer += line_size;
6732 if (scn->imagepointer >= (scn->imagebuffer + scn->bfsize))
6733 scn->imagepointer = scn->imagebuffer;