IR(4) — NEWS-OS Programmer’s Manual
NAME
ir − Image Reader device interface
SYNOPSIS
ir0 at iop addr xxx intr 110 (xxx is depend on machine type)
/dev/ir
#include <newsiop/imagereader.h>
DESCRIPTION
ir provides the interface to control NEWS Image Reader (NWP-534 + NWB-240A/241A/244,
NWP-540 + NWB-242/243). The Image Reader has many intelligent functions and ir makes most of the functions effectively.
("Image Board Library" is available for NWP-540. You can use the proper functions to NWP-540 through this library.)
Operations will be done through the system call of ‘ioctl’ to /dev/ir, and can be used with C language easily.
DATA FORMAT
The data format of the structures are ;
struct ir_window {
intiw_x; /∗ X coordinate ∗/
intiw_y; /∗ Y coordinate ∗/
intiw_dx; /∗ width ∗/
intiw_dy; /∗ height ∗/
};
struct ir_xy {
intiw_x; /∗ magnification of X axis ∗/
/∗ amount of data ∗/
intiw_y; /∗ magnification of Y axis ∗/
/∗ amount of data ∗/
};
struct ir_seg {
intis_in; /∗ mode in segment ∗/
intis_out; /∗ mode out of segment ∗/
};
ir_window is the data format for storing the area data.
ir_xy is the data format for storing the data of amount for the magnification and the image data.
ir_seg is the data format for storing the mode of in/out of the segment.
IOCTL
IRIOCINIT : initialization indication
initialize the image reader. ioctl(fildes,IRIOCINIT);
IRIOCHOME : home position indication
return the optics to home position.
(No action taken for NWP-540.) ioctl(fildes,IRIOCHOME);
IRIOCLAMP : lamp indication
define the lamp ON or OFF.
(No action taken for NWP-540.)
#define LAMP_OFF 0 /∗ light is off ∗/
#define LAMP_ON 1 /∗ light is on ∗/
int lamp;
ioctl(fildes,IRIOCLAMP,&lamp);
IRIOCRESOLUTION
: resolution indication
define the resolution.
(For NWP-540, 400 dpi and 240 dpi are also available.)
#define DPI_300 300 /∗ 300 dpi ∗ /
#define DPI_200 200 /∗ 200 dpi ∗ /
#define DPI_150 150 /∗ 150 dpi ∗ /
#define DPI_75 75 /∗ 75 dpi ∗ /
int resolution;
ioctl(fildes,IRIOCRESOLUTION,&resolution);
IRIOCMIRROR : mirror image indication
set or quit the mirror image mode.
#define NORMAL 0 /∗ normal image ∗/
#define MIRROR 1 /∗ mirror image ∗/
int mirror;
ioctl(fildes,IRIOCMIRROR,&mirror)
IRIOCOUTMODE : output indication
define the output mode (image read mode)
(For NWP-540, "8 x 8 dither for flatbed" pattern is used when pattern 1 or pattern 2 is specified, "4 x 4 dither for flatbed" pattern is used when pattern 3, 4, 5 or 6 is specified, and error if pattern 7 specified.)
#define BINARY 0 /∗ black and white ∗ /
#define DIZER1 1 /∗ dither pattern No.1 ∗ /
#define DIZER2 2 /∗ dither pattern No.2 ∗ /
#define DIZER3 3 /∗ dither pattern No.3 ∗ /
#define DIZER4 4 /∗ dither pattern No.4 ∗ /
#define DIZER5 5 /∗ dither pattern No.5 ∗ /
#define DIZER6 6 /∗ dither pattern No.6 ∗ /
#define DIZER7 7 /∗ dither pattern No.7 ∗ /
#define MULTI 9 /∗ multi ∗ /
int outmode;
ioctl(fildes,IRIOCOUTMODE,&outmode);
IRIOCAREAMODE
: area mode indication
define the output mode in/out of the segment in area mode
#define BINARY 0 /∗ black and white ∗ /
#define DIZER1 1 /∗ dither pattern No.1 ∗ /
#define DIZER2 2 /∗ dither pattern No.2 ∗ /
#define DIZER3 3 /∗ dither pattern No.3 ∗ /
#define DIZER4 4 /∗ dither pattern No.4 ∗ /
#define DIZER5 5 /∗ dither pattern No.5 ∗ /
#define DIZER6 6 /∗ dither pattern No.6 ∗ /
#define DIZER7 7 /∗ dither pattern No.7 ∗ /
#define WHITE 11 /∗ white ∗ /
struct ir_seg seg_outmode;
ioctl(fildes,IRIOCAREAMODE,&seg_outmode)
IRIOCLIGHT : concentration definition
define the concentration of image signal.
int light;
ioctl(fildes,IRIOCLIGHT,&light);
IRIOCNOAE : AE (auto adjust of concentration) indication
define or quit the AE (auto adjust of concentration) mode.
#define AE 0 /∗ AE ON ∗/
#define NO_AE 1 /∗ AE QUIT ∗/
int no_ae;
ioctl(fildes,IRIOCNOAE,&no_ae);
IRIOCREVERSE : nega / posi indication
define the negative or positive mode.
#define POSI 0 /∗ positive mode ∗/
#define NEGA 1 /∗ negative mode ∗/
int reverse;
ioctl(fildes,IRIOCREVERSE,&reverse);
IRIOCAREAREVERSE
: negative/positive indication for area
define the negative or positive mode in area mode
#define POSI 0 /∗ positive ∗/
#define NEGA 1 /∗ negative ∗/
struct ir_seg seg_reverse;
ioctl(fildes,IRIOCAREAREVERSE,&seg_reverse);
IRIOCSCALE : magnification indication
define the magnification to read.
int scale;
ioctl(fildes,IRIOCSCALE,&scale);
IRIOCXYSCALE : self-supporting variable scale indication
define the magnifications for main scanning and sub scanning independently.
struct ir_xy xy scale;
ioctl(fildes,IRIOCXYSCALE,&xy_scale);
IRIOCAREA : area indication
define the area to read.
(Error occurs when illegal size is specified for NWP-540.)
#define WINDOW 0
#define A4 1
#define A5 2
#define B5 3
#define B6 4
#define ENVELOPE 5
#define POSTCARD 6
#define A6 7
#define MINI 10
#define LETTER 11
#define NOT_SPECIFIED 99
int area;
ioctl(fildes,IRIOCAREA,&area);
IRIOCWINDOW : window area indication
define the area to be read by the window.
struct ir_window window;
ioctl(fildes,IRIOCWINDOW,&window);
IRIOCSEGMENT : segment area indication
define the segment area.
struct ir_window segment;
ioctl(fildes,IRIOCSEGMENT,&segment);
IRIOCREAD : scanning indication command
define the execution to read.
int area;
ioctl(fildes,IRIOCREAD,&area);
IRIOCAREAREAD
: area scanning indication command
define to execution the scanning area
int area;
ioctl(fildes,IRIOCAREAREAD,&area);
IRIOCMODE : mode report
request the Report No.0 (mode report).
(For NWP-540, the values of im_motor and im_light are always 0.)
struct ir_mode {
intim_resolution;
intim_mirror;
intim_motor;
intim_light;
struct ir_seg im_reverse;
};
struct ir_mode mode;
ioctl(fildes,IRIOCRMODE,&mode);
IRIOCSTATUS : status report
request the Report No.1 (status report).
(For NWP-540, the value ’3’ is returned at is_operatorcall if paper jam occurred. For other cases, the same value as NWP-534 is returned.)
struct ir_status {
intis_error;
intis_timeout;
intis_operator_call;
intis_service_call;
};
struct ir_status status;
ioctl(fildes,IRIOCRSTATUS,&status);
IRIOCPOSITION : position report from the origin.
request the report No.2 (position report from the origin).
(For NWP-540, the position of the light is returned.)
int position;
ioctl(fildes,IRIOCRPOSITION,&position);
IRIOCRWINDOW : window report
request the report No.3 (window report).
struct ir_window window;
ioctl(fildes,IRIOCRWINDOW,&window);
IRIOCLIGHT : concentration report
request the report No.4 (Concentration report).
struct ir_light {
intil_ae;
intil_light;
};
struct ir_light light;
ioctl(fildes,IRIOCRLIGHT,&light);
IRIOCOUTMODE : output mode report
request the report No.5 (output report).
struct ir_seg outmode;
ioctl(fildes,IRIOCROUTMODE,&outmode);
IRIOCSCALE : magnification report
request the report No.6 (magnification report).
struct ir_xy scale;
ioctl(fildes,IRIOCRSCALE,&scale);
IRIOCDATA : number of forwarding data report
request the report No.8 (number of forwarding data report).
‘amount.iw_x’ is the number of bytes for X axis, and ‘amount.iw_y’ is the number of bytes for Y.
These values may differ between NWP-534 and NWP-540: The application program which supports both types of image reader have to get these values by this ioctl.)
struct ir_xy amount;
ioctl(fildes,IRIOCRDATA,&amount);
IRIOCRSELECT : report selection
decide the contents for mode report and output mode report. (For NWP-540, ’0’ is always returned.)
int select;
ioctl(fildes,IRIOCRSELECT,&select);
FILES
/dev/irimage reader device file
SEE ALSO
Image Reader(NWP-534) Operation Manual
Chapter in "Image Reader" in NEWS-OS Release 4.0 I/O Device Programming Guide, Chapter in "Image Board Library" in NEWS-OS Release 4.0 Programmer’s Guide.
NEWS-OSRelease 4.2.1R