static int send_scan_param (pixma_t * s) { mp730_t *mp = (mp730_t *) s->subdriver; uint8_t *data; data = pixma_newcmd (&mp->cb, cmd_scan_param, 0x2e, 0); pixma_set_be16 (s->param->xdpi | 0x1000, data + 0x04); pixma_set_be16 (s->param->ydpi | 0x1000, data + 0x06); pixma_set_be32 (s->param->x, data + 0x08); pixma_set_be32 (s->param->y, data + 0x0c); pixma_set_be32 (mp->raw_width, data + 0x10); pixma_set_be32 (s->param->h, data + 0x14); if (s->param->channels == 1) { if (s->param->depth == 1) data[0x18] = 0x01; else data[0x18] = 0x04; } else data[0x18] = 0x08; data[0x19] = s->param->channels * s->param->depth; /* bits per pixel, for lineart should be 0x01 */ data[0x1e] = (s->param->depth == 1) ? 0x80 : 0x00; /* modify for lineart: 0x80 NEW */ data[0x1f] = (s->param->depth == 1) ? 0x80 : 0x7f; /* modify for lineart: 0x80 */ data[0x20] = (s->param->depth == 1) ? 0x01 : 0xff; /* modify for lineart: 0x01 */ data[0x23] = 0x81; return pixma_exec (s, &mp->cb); }
static int send_scan_param (pixma_t * s) { iclass_t *mf = (iclass_t *) s->subdriver; uint8_t *data; data = pixma_newcmd (&mf->cb, cmd_scan_param, 0x2e, 0); pixma_set_be16 (s->param->xdpi | 0x1000, data + 0x04); pixma_set_be16 (s->param->ydpi | 0x1000, data + 0x06); pixma_set_be32 (s->param->x, data + 0x08); pixma_set_be32 (s->param->y, data + 0x0c); pixma_set_be32 (mf->raw_width, data + 0x10); pixma_set_be32 (s->param->h, data + 0x14); data[0x18] = (s->param->channels == 1) ? 0x04 : 0x08; data[0x19] = s->param->channels * s->param->depth; /* bits per pixel */ data[0x1f] = 0x7f; data[0x20] = 0xff; data[0x23] = 0x81; switch (s->cfg->pid) { case MF4200_PID: case MF4600_PID: case MF6500_PID: case D480_PID: case D420_PID: case MF4360_PID: case MF4100_PID: return iclass_exec (s, &mf->cb, 0); break; default: return pixma_exec (s, &mf->cb); } }
static int send_scan_param (pixma_t * s) { mp750_t *mp = (mp750_t *) s->subdriver; uint8_t *data; data = pixma_newcmd (&mp->cb, cmd_scan_param, 0x2e, 0); pixma_set_be16 (s->param->xdpi | 0x8000, data + 0x04); pixma_set_be16 (s->param->ydpi | 0x8000, data + 0x06); pixma_set_be32 (s->param->x, data + 0x08); pixma_set_be32 (s->param->y, data + 0x0c); pixma_set_be32 (mp->raw_width, data + 0x10); pixma_set_be32 (mp->raw_height, data + 0x14); data[0x18] = 8; /* 8 = color, 4 = grayscale(?) */ /* GH: No, there is no grayscale for CCD devices, Windows shows same */ data[0x19] = s->param->depth * ((is_ccd_grayscale (s)) ? 3 : s->param->channels); /* bits per pixel */ data[0x20] = 0xff; data[0x23] = 0x81; data[0x26] = 0x02; data[0x27] = 0x01; data[0x29] = mp->monochrome ? 0 : 1; return pixma_exec (s, &mp->cb); }