Lines Matching defs:data

91  * All data in structures is little-endian, so the LSB comes first
105 * All data in structures is little-endian, so start with LSB
116 * All data in structures is little-endian, so the LSB comes first
133 * All data in structures is little-endian, so start with LSB
158 * All data in structures is little-endian, so the MSB comes first.
173 * All data in structures is little-endian, so start with MSB of each short.
223 SANE_Byte data[SLIDE_DATA_SIZE];
228 memset(data, '\0', SLIDE_DATA_SIZE);
229 data[0] = action;
230 data[1] = 0x01;
232 status->pieusb_status = sanei_pieusb_command(device_number, command, data, SLIDE_DATA_SIZE);
245 * @param sense Sense data
255 SANE_Byte data[DATA_SIZE];
263 memset(data, '\0', size);
264 st = sanei_pieusb_command(device_number, command, data, size);
271 /* Decode data received */
272 sense->errorCode = _get_byte (data, 0);
273 sense->segment = _get_byte (data, 1);
274 sense->senseKey = _get_byte (data, 2);
275 _copy_bytes (sense->info, data+3, 4);
276 sense->addLength = _get_byte (data, 7);
277 _copy_bytes (sense->cmdInfo, data+8, 4);
278 sense->senseCode = _get_byte (data, 12);
279 sense->senseQualifier = _get_byte (data, 13);
311 SANE_Byte data[FRAME_SIZE];
316 /* Ask scanner to prepare the scan frame with the given index. Only SCSI_COMMAND_LEN bytes of data. */
318 memset (data, '\0', SCSI_COMMAND_LEN);
319 data[0] = SCSI_SCAN_FRAME | 0x80; /* set bit 7 means prepare read */
320 data[4] = index;
322 st = sanei_pieusb_command (device_number, command, data, SCSI_COMMAND_LEN);
332 memset(data, '\0', size);
333 status->pieusb_status = sanei_pieusb_command (device_number, command, data, size);
335 /* Decode data */
336 frame->index = _get_byte (data, 4);
337 frame->x0 = _get_short (data, 6);
338 frame->y0 = _get_short (data, 8);
339 frame->x1 = _get_short (data, 10);
340 frame->y1 = _get_short (data, 12);
358 SANE_Byte data[CMD_17_SIZE];
363 memset (data, '\0', CMD_17_SIZE);
364 _set_short (SCSI_CMD_17, data, 0);
365 _set_short (2, data, 2);
366 _set_short (value, data, 4);
368 status->pieusb_status = sanei_pieusb_command (device_number, command, data, CMD_17_SIZE);
377 * Read the shading data parameters. This requires two
381 * @param shading Shading data parameters
392 SANE_Byte data[SHADING_SIZE];
397 /* Ask scanner to prepare the scan frame with the given index. Only SCSI_COMMAND_LEN bytes of data. */
399 memset (data, '\0', PREP_READ_SIZE);
400 data[0] = SCSI_CALIBRATION_INFO | 0x80; /* set bit 7 means prepare read */
402 status->pieusb_status = sanei_pieusb_command (device_number, command, data, PREP_READ_SIZE);
410 memset (data, '\0', size);
411 status->pieusb_status = sanei_pieusb_command (device_number, command, data, size);
416 /* Decode data [32 bytes]
427 for (k = 0; k < data[4]; k++) {
428 shading[k].type = _get_byte (data, 8 + data[5]*k);
429 shading[k].sendBits = _get_byte (data, 9 + data[5]*k);
430 shading[k].recieveBits = _get_byte (data, 10 + data[5]*k);
431 shading[k].nLines = _get_byte (data, 11 + data[5]*k);
432 shading[k].pixelsPerLine = _get_short (data, 12 + data[5]*k);
439 * Read scanned data from the scanner memory into a byte array. The lines
443 * If there is scanned data available, it should be read. Waiting too long
452 * @param data
458 sanei_pieusb_cmd_get_scanned_lines(SANE_Int device_number, SANE_Byte* data, SANE_Int lines, SANE_Int size, struct Pieusb_Command_Status *status)
465 memset (data, '\0', size);
467 status->pieusb_status = sanei_pieusb_command (device_number, command, data, size);
486 SANE_Byte data[FRAME_SIZE];
496 /* Code data */
497 memset (data, '\0', size);
498 _set_short (SCSI_SCAN_FRAME, data, 0);
499 _set_short (size-4, data, 2); /* size: one frame, 5 shorts */
500 _set_short (index, data, 4);
501 _set_short (frame->x0, data, 6);
502 _set_short (frame->y0, data, 8);
503 _set_short (frame->x1, data, 10);
504 _set_short (frame->y1, data, 12);
506 status->pieusb_status = sanei_pieusb_command (device_number, command, data, size);
525 SANE_Byte data[EXPOSURE_DATA_SIZE];
533 memset (data, '\0', EXPOSURE_DATA_SIZE);
535 _set_short (SCSI_EXPOSURE, data, 0);
536 _set_short (EXPOSURE_DATA_SIZE-4, data, 2); /* short: RGB, short: value */
537 _set_short (exptime->filter, data, 4); /* 1: neutral, 2: R, 4: G, 8: B */
538 _set_short (exptime->value, data, 6);
539 status->pieusb_status = sanei_pieusb_command (device_number, command, data, EXPOSURE_DATA_SIZE);
562 SANE_Byte data[HIGHLIGHT_SHADOW_SIZE];
570 memset (data, '\0', HIGHLIGHT_SHADOW_SIZE);
572 _set_short (SCSI_HIGHLIGHT_SHADOW, data, 0);
573 _set_short (HIGHLIGHT_SHADOW_SIZE-4, data, 2); /* short: RGB, short: value */
574 _set_short (color->filter, data, 4); /* 1: neutral, 2: R, 4: G, 8: B */
575 _set_short (color->value, data, 6);
576 status->pieusb_status = sanei_pieusb_command (device_number, command, data, HIGHLIGHT_SHADOW_SIZE);
588 * actual scan data.
601 SANE_Byte data[PARAMETER_SIZE];
606 memset (data, '\0', size);
608 status->pieusb_status = sanei_pieusb_command(device_number, command, data, size);
624 /* Decode data received */
625 parameters->width = _get_short(data, 0);
626 parameters->lines = _get_short(data, 2);
627 parameters->bytes = _get_short(data, 4);
628 parameters->filterOffset1 = _get_byte(data, 6);
629 parameters->filterOffset2 = _get_byte(data, 7);
630 parameters->period = _get_int(data, 8); /* unused */
631 parameters->scsiTransferRate = _get_short(data, 12); /* unused */
632 parameters->availableLines = _get_short(data, 14);
654 * @param data Input or output data buffer
655 * @param size Size of the data buffer
664 SANE_Byte data[INQUIRY_SIZE];
670 memset (data, '\0', INQUIRY_SIZE); /* size may be less than INQUIRY_SIZE, so prevent returning noise */
672 status->pieusb_status = sanei_pieusb_command (device_number, command, data, size);
677 /* Decode data received */
678 inq->deviceType = _get_byte(data, 0);
679 inq->additionalLength = _get_byte(data, 4);
680 _copy_bytes((SANE_Byte*)(inq->vendor), data+8, 8); /* Note: not 0-terminated */
681 _copy_bytes((SANE_Byte*)(inq->product), data+16, 16); /* Note: not 0-terminated */
682 _copy_bytes((SANE_Byte*)(inq->productRevision), data+32, 4); /* Note: not 0-terminated */
684 inq->maxResolutionX = _get_short(data, 36);
685 inq->maxResolutionY = _get_short(data, 38);
686 inq->maxScanWidth = _get_short(data, 40);
687 inq->maxScanHeight = _get_short(data, 42);
688 inq->filters = _get_byte(data, 44);
689 inq->colorDepths = _get_byte(data, 45);
690 inq->colorFormat = _get_byte(data, 46);
691 inq->imageFormat = _get_byte(data, 48);
692 inq->scanCapability = _get_byte(data, 49);
693 inq->optionalDevices = _get_byte(data, 50);
694 inq->enhancements = _get_byte(data, 51);
695 inq->gammaBits = _get_byte(data, 52);
696 inq->lastFilter = _get_byte(data, 53);
697 inq->previewScanResolution = _get_short(data, 54);
699 _copy_bytes((SANE_Byte*)(inq->firmwareVersion), data+96, 4); inq->firmwareVersion[4]=0x00;
700 inq->halftones = _get_byte(data, 100);
701 inq->minumumHighlight = _get_byte(data, 101);
702 inq->maximumShadow = _get_byte(data, 102);
703 inq->calibrationEquation = _get_byte(data, 103);
704 inq->maximumExposure = _get_short(data ,104);
705 inq->minimumExposure = _get_short(data ,106);
706 inq->x0 = _get_short(data, 108);
707 inq->y0 = _get_short(data, 110);
708 inq->x1 = _get_short(data, 112);
709 inq->y1 = _get_short(data, 114);
710 inq->model = _get_short(data, 116);
711 _copy_bytes((SANE_Byte*)(inq->production), data+120, 4);
712 _copy_bytes((SANE_Byte*)(inq->timestamp), data+124, 20);
713 _copy_bytes((SANE_Byte*)(inq->signature), data+144, 40);
736 SANE_Byte data[MODE_SIZE];
754 /* Code data */
783 memset (data, '\0', size);
784 _set_byte (size-1, data, 1);
785 _set_short (mode->resolution, data, 2);
786 _set_byte (mode->passes, data, 4);
787 _set_byte (mode->colorDepth, data, 5);
788 _set_byte (mode->colorFormat, data, 6);
789 _set_byte (mode->byteOrder, data, 8);
794 _set_byte (quality, data, 9);
795 _set_byte (mode->halftonePattern, data, 12);
796 _set_byte (mode->lineThreshold, data, 13);
797 _set_byte (0x10, data, 14); /* ? */
799 status->pieusb_status = sanei_pieusb_command (device_number, command, data, size);
806 * the scan, and which allows to relate scan data to shading data. A mask is a
848 SANE_Byte data[MODE_SIZE];
854 memset (data, '\0', size);
856 status->pieusb_status = sanei_pieusb_command(device_number, command, data, size);
861 /* Decode data received */
862 mode->resolution = _get_short (data, 2);
863 mode->passes = _get_byte (data, 4);
864 mode->colorDepth = _get_byte (data, 5);
865 mode->colorFormat = _get_byte (data, 6);
866 mode->byteOrder = _get_byte (data, 8);
867 quality = _get_byte (data, 9);
871 mode->halftonePattern = _get_byte (data, 12);
872 mode->lineThreshold = _get_byte (data, 13);
891 * 1. Calibration phase: make previously collected shading correction data available\n
894 * 4. Scan and output scan data phase\n
910 * In the 'scan and output scan data' phase, the slide is scanned while data is
975 SANE_Byte data[SCAN_HEAD_SIZE];
981 /* Code data */
982 memset (data, '\0', size);
985 data[0] = 2;
992 data[0] = 8;
995 data[0] = 0; /* forward */
996 data[2] = (steps>>8) & 0xFF;
997 data[3] = steps & 0xFF;
1000 data[0] = 1; /* backward */
1001 data[2] = (steps>>8) & 0xFF;
1002 data[3] = steps & 0xFF;
1006 status->pieusb_status = sanei_pieusb_command(device_number, command, data, size);
1013 * data returned are relatively static.\n
1027 SANE_Byte data[GAIN_OFFSET_SIZE];
1035 memset (data, '\0', size);
1036 status->pieusb_status = sanei_pieusb_command(device_number, command, data, size);
1041 /* Decode data received */
1042 _get_shorts (settings->saturationLevel, data+54, 3);
1043 _get_shorts (settings->exposureTime, data+60, 3);
1044 _copy_bytes (val, data+66, 3);
1046 _copy_bytes (val, data+72, 3);
1048 settings->light = _get_byte (data, 75);
1049 settings->exposureTime[3] = _get_short (data, 98);
1050 settings->offset[3] = _get_byte (data, 100);
1051 settings->gain[3] = _get_byte (data, 102);
1070 * 2. For a sccan with calibration phase: before (or during) reading the shading reference data.
1084 SANE_Byte data[GAIN_OFFSET_SIZE];
1100 /* Code data */
1101 memset (data, '\0', size);
1102 _set_shorts (settings->exposureTime, data, 3);
1106 _copy_bytes (data + 6, val, 3);
1110 _copy_bytes (data + 12, val, 3);
1111 _set_byte (settings->light, data, 15);
1112 _set_byte (settings->extraEntries, data, 16);
1113 _set_byte (settings->doubleTimes, data, 17);
1114 _set_short (settings->exposureTime[3], data, 18);
1115 _set_byte (settings->offset[3], data, 20);
1116 _set_byte (settings->gain[3], data, 22);
1154 status->pieusb_status = sanei_pieusb_command(device_number, command, data, size);
1171 SANE_Byte data[GET_STATE_SIZE];
1179 memset (data, '\0', size);
1180 status->pieusb_status = sanei_pieusb_command (device_number, command, data, size);
1184 data[5] = 1;
1187 /* Decode data received */
1188 state->buttonPushed = _get_byte(data, 0);
1189 state->warmingUp = _get_byte(data, 5);
1190 state->scanning = _get_byte(data, 6);
1191 /* state->busy = _get_byte(data, 8); */
1192 DBG (DBG_info_scan, "sanei_pieusb_cmd_read_state(): button %d, warmingUp %d, scanning %d, busy? %d\n", state->buttonPushed, state->warmingUp, state->scanning, _get_byte(data, 8));