Previous Page | Next Page

Commands Used with the IMGCTRL, IMGOP and PICFILL Functions

QUERYC, QUERYL, and QUERYN



Query information about images
Syntax
Attributes for the QUERYC Command
Attributes for the QUERYL Command
Attributes for the QUERYN Command
Details
Examples
Example 1: Using QUERYC
Example 2: Using QUERYL
Example 3: Using QUERYN

Syntax

rc=IMGOP(task-id, 'QUERYC', attribute, information);
rc=IMGOP(task-id, 'QUERYL', attribute, list-id);
rc=IMGOP(task-id, 'QUERYN', attribute, information);

attribute

is the value to report. Attributes for QUERYC are listed in Attributes for the QUERYC Command. Attributes for QUERYL are listed in Attributes for the QUERYL Command. Attributes for QUERYN are listed in Attributes for the QUERYN Command.

Type: Character

information

contains the information that is returned by QUERYC and QUERYN. QUERYC returns a character value, and QUERYN returns a numeric value.

Type: Character or Numeric

list-id

contains the identifier for the SCL list of information items that are returned by QUERYL. See attribute for details.

Type: List


Attributes for the QUERYC Command

The values for attribute for QUERYC are:

DESCRIPT

returns information about the image size and color map. The information can be up to 45 characters long.

FILENAME

returns the image-path string.

FORMAT

returns the original file format, such as GIF.

TYPE

returns the IMAGE type, which can be 'CMAP', 'GRAY', or 'RGBA'.


Attributes for the QUERYL Command

The values for attribute for QUERYL are:

ACTIVE_LIST

returns an SCL list that contains the identifiers for all active images (images that are being used but that are not necessarily visible).

GLOBAL_INFO

returns a named list that contains the following items:

NUM_ACTIVE

is the number of active images that are used but not necessarily visible.

SELECT

is the identifier of the currently selected image.

WSIZE_WIDTH

is the window width in pixels.

WSIZE_HEIGHT

is the window height in pixels.

SELECT_INFO

returns a named SCL list that contains the numeric values for the currently selected image:

IS_ACTIVE

has a value of 1 if the image is being used and if data is associated with it. If IS_ACTIVE=1, the following items are also returned:

WIDTH

the image width in pixels

HEIGHT

the image height in pixels

DEPTH

the image depth

TYPE

the image type: 'CMAP', 'GRAY', 'RGBA'

IS_VISIBLE

has a value of 1 if the image is being displayed.

XPOSN

is the x position.

YPOSN

is the y position.

NCOLORS

is the number of colors, if TYPE='CMAP' (color mapped)

RDEPTH

is the red depth, if TYPE='RGBA'

GDEPTH

is the green depth, if TYPE='RGBA'

BDEPTH

is the blue depth, if TYPE='RGBA'

ADEPTH

is the alpha depth (degree of transparency), if TYPE='RGBA'

VISIBLE_LIST

returns an SCL list that contains the identifiers for all currently displayed images.


Attributes for the QUERYN Command

The values for attribute for QUERYN are:

ADEPTH

returns the alpha depth (degree of transparency), if TYPE=3 (RGBA).

BDEPTH

returns the blue depth, if TYPE=3 (RGBA).

COLORMAP-LEN

returns the size of the color map.

DEPTH

returns the image depth.

GDEPTH

returns the green depth, if TYPE=3 (RGBA).

HEIGHT

returns the image height in pixels.

IS_BLANK

returns a value that indicates whether the current page is blank:

1

blank

0

not blank (valid for monochrome images only).

NCOLORS

returns the number of colors.

RDEPTH

returns the red depth, if TYPE=3 (RGBA).

SELECT

returns the identifier of the currently selected image.

TYPE

returns the image type:

1

GRAY (gray-scale)

2

CMAP (color mapped)

3

RGBA.

WIDTH

returns the image width in pixels.


Details

The QUERYC, QUERYL, and QUERYN commands return information about all images as well as about the Image window. QUERYC returns the values of character attributes. QUERYL returns the values of attributes that are stored in an SCL list. QUERYN returns the values of numeric attributes. These commands act on the currently selected image.


Examples


Example 1: Using QUERYC

Display the description, filename, format, and type of an image:

rc=imgop(task-id,'READ',
         '/usr/local/images/color/misc/canoe.gif');
rc=imgop(task-id,'QUERYC','DESCRIPT',idescr);
put idescr=;
rc=imgop(task-id,'QUERYC','FILENAME',ifile);
put ifile=;
rc=imgop(task-id,'QUERYC','FORMAT',iformat);
put iformat=;
rc=imgop(task-id,'QUERYC','TYPE',itype);
put itype=;

This program writes the following lines to the LOG window:

IDESCR=640x480 8-bit CMAP, 256 colormap entries
IFILE=/usr/local/images/color/misc/canoe.gif
IFORMAT=GIF
ITYPE=CMAP


Example 2: Using QUERYL


Example 3: Using QUERYN

Display information about the Image window. (Assume that all variables have been initialized before they are used.)

rc=imgop(task-id,'READ',path);
rc=imgop(task-id,'QUERYN','SELECT',select);
rc=imgop(task-id,'QUERYN','HEIGHT',height);
rc=imgop(task-id,'QUERYN','WIDTH',width);
rc=imgop(task-id,'QUERYN','DEPTH',depth);
rc=imgop(task-id,'QUERYN','RDEPTH',rdepth);
rc=imgop(task-id,'QUERYN','GDEPTH',gdepth);
rc=imgop(task-id,'QUERYN','BDEPTH',bdepth);
rc=imgop(task-id,'QUERYN','ADEPTH',adepth);
rc=imgop(task-id,'QUERYN','NCOLORS',ncolors);
rc=imgop(task-id,'QUERYN','TYPE',type);
put select= height= width= depth= rdepth= gdepth=;
put bdepth= adepth= ncolors= type= ;

This program writes the following values to the LOG window:

SELECT=1 HEIGHT=470 WIDTH=625 DEPTH=8 RDEPTH=0
GDEPTH=0 BDEPTH=0 ADEPTH=0 NCOLORS=229 TYPE=2

Previous Page | Next Page | Top of Page