IBSDEMO(1) — NEWS-OS Programmer’s Manual
NAME
ibsdemo − Demo programs for bitonal image library
SYNOPSIS
/usr/sony/demo/NWB243/bin/ibsdemo [ −i [ time ]] [ −w [ time ]] [ −t ] [ −e ]
/usr/sony/demo/NWB243/bin/simpledemo.ibs
/usr/sony/demo/NWB243/bin/imagedemo.ibs
DESCRIPTION
ibsdemo is a demo program for the libibs.a bitonal image library. It is capable of compression/decompression (G3, G4), enlargement/reduction, editing and file reading/writing of bitonal images. Once X Window System is successfully opened, images can be displayed on the screen.
−t The time required for certain commands to execute is measured and displayed.
−w ibsdemo waits for the next command with the window open and without waiting for the mouse click indicating the end of the image display. Time specifies the interval until the next input in seconds.
−i Specifies the timeout interval for waiting for keyboard input in seconds. If time is omitted or the −i option is not specified, a default timeout interval of 60 seconds is used. When the time has expired, a timeout message is output and, if the −w option has been specified, the window is closed. No timeout is generated if ‘0’ is specified.
−e Messages are displayed in English. Under the Shift-JIS environment, ibsdemo displays messages in Japanese if the −e option is omitted. Otherwise, messages are output in English (ASCII codes).
OPERATION EXAMPLE
The examples which follow illustrate the procedure for displaying the compressed image data supplied with NEWS-OS.
Startup
% cd /usr/sony/demo/NWB243/bin
% ibsdemo After starting X Window System and the xterm terminal emulator, enter the xterm command. The main menu appears and ibsdemo waits for you to enter a number.
Image decompression
Menu No. ? 8
file name ? ../data/data.1 Select number 8 “Load & Expansion” and enter the filename for the sample data.
Displaying
Menu No. ? 4 When 4 “Shrink & Display” is selected, a window is opened and the uncompressed image (400 dpi) is displayed in it, shrunk both vertically and horizontally. Clicking anywhere inside this window with the mouse ends the image display.
Displaying
Menu No. ? 5 When 5 “Display zoomed data” is selected, a portion of the image is enlarged to match the size of the window and displayed. First a window opens and the whole image is displayed in reduced form inside it. You then specify the portion (rectangle) of it you wish to view. Position the mouse cursor on the upper left corner of the rectangle area and click the mouse button. Repeat the same for the lower right corner. The image in the specified area is zoomed and displayed. Clicking anywhere inside the window with the mouse ends the image display.
Termination
Select the appropriate menu number: 99 When number 99 “Exit” is selected, the demo program ends.
BASIC OPERATION
You enter three types of information to control the program: numbers, filenames and the letters y and n.
At the main menu and at the image processing example and image editing submenus, 0 selects menu display and 99 selects exit for the menu.
To close a window which is displaying an image, move the mouse cursor inside the window and click the mouse button. (If the −w option has been specified, this operation is not required.)
When selecting a rectangle area on a displayed image, specify two points on a diagonal line by clicking the mouse button. The window closes.
COMMAND SCRIPTS
The following command scripts are included with the program.
simpledemo.ibs
This script displays compressed image data supplied with NEWS-OS. Invoke this command under X Window System.
imagedemo.ibs
This script displays compressed image data supplied with NEWS-OS and performs some image processing such as rotation, mirror-image reversal, rectangle transfer and filter processing. Invoke this command under X Window System.
DATA STRUCTURES
This section describes the formats of the files used in the demo program.
Compressed image
The following 16-byte header is stored at the beginning of the file, and is followed by compressed image data.
struct {
unsigned int length; /∗ length of compressed data (bytes) ∗/
unsigned int width; /∗ width of decompressed image (dots) ∗/
unsigned int height; /∗ height of decompressed image (dots) ∗/
unsigned int dpi; /∗ resolution (dpi) ∗/
} header;
Uncompressed image
The format for uncompressed images is the same as one used in scn command with the −format scn option.
The following 8-byte header is stored at the beginning of the file, and is followed by image data.
struct {
unsigned short dpi; /∗ resolution (dpi) ∗/
unsigned short width; /∗ width of image (dots) ∗/
unsigned short height; /∗ height of image (dots) ∗/
unsigned short bpd; /∗ bits per pixel ∗/
} header;
FILES
/usr/sony/demo/NWB243/bin/ibsdemo demo program
/usr/sony/demo/NWB243/data/data.? demo data
/usr/sony/demo/NWB243/src/∗ source code for demo program
SEE ALSO
ibdemo(1), libibs(3X)
“NEWS-OS Release 4.1 Manual set PROGRAMMERS’ GUIDE / Bitonal Image Library”
“NEWS-OS Release 4.0 Manual Set USERS’ GUIDE / Image Board Demo Program”
BUGS
If the following command line is used to start the program, whole display may be covered by the resulting window.
/usr/sony/demo/NWB243/bin/ibdemo −w −i 0
There may be cases where certain window manager settings result in a situation where it is impossible to input data from the keyboard. To avoid them, always specify a timeout value when using the −w option.
This program duplicates some of the functions of the ibdemo demo program for the NWB-242/243 image board using image board library simulation for the bitonal image library. For this reason the menus normally used to operate an image reader and laser printer appear unchanged.
Also, in the source code an area corresponding to the NWB-242 image board is allocated within the process, and image board library functions are written by defining them in the ibs.c source file. In a future update, memory usage ought to be reduced by making use of the divided processing capabilities of the bitonal image library.
NEWS-OSRelease 4.1C