Page 8 out of 26 total pages


QbWrapClass


QbWrapClass is a single, high-level class whose methods provide access to QBIC database population and query. To facilitate the integration of QBIC functionality into your applications, the QbWrapClass specifically implements several methods that have the same functionality as the command-line programs QbMkDbs, QbQBE, QbMkThmb, and QbDumpDb.

After you have experimented with these programs and are familiar with the command-line syntax used to execute these programs, you can readily incorporate the QBIC functionality into your application by creating a QbWrapClass object in your application and invoking the appropriate method. For example, the corresponding method for QbMkDbs is QbWrapDBS..

Because there is no command shell in Macintosh, start the qbictcl program, and invoke the function within the qbictcl shell.

The following methods are described in this chapter:

QbicWrapClass method

This is the constructor for the class. This method has overloaded functions.

Syntax

QbicWrapClass( void )

QbicWrapClass( char *catName, char *dirName, char *mode )

Parameters

Input

Output

None

~QbicWrapClass method

This is the destructor for the class.

Syntax

~QbicWrapClass( void )

Parameters

None

DeleteFeatures method

This method deletes a feature class from the object database population or query.

Syntax

int DeleteFeatures (  char *featureName )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

GetFeatureDataImage method

This method computes the feature data for the input image or mask name.

Syntax

int GetFeatureDataImage (char *imgName, char *maskName, QbStringClass 
*str )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

GetFeatureDataKey method

This method retrieves the feature data from the database for the input image key name.

Syntax

int GetFeatureDataKey (char *imgKey, QbStringClass *str )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

GetFeatureDataPicker method

This method retrieves the feature data for the picker image or mask name.

Syntax

int GetFeatureDataPicker(char *imgName, char *maskName, QbStringClass 
*str )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

GetFeatureDataString method

This method computes the feature data for the input string description of the image.

Syntax

int GetFeatureDataString(char *strDes, QbStringClass *str )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

GetParameters method

This method gets the parameter settings for the feature classes. Each feature class has its own parameter setting, either by default or by command line setting. This method retrieves the current settings for each class and puts them into the input QbStringClass object.

Syntax

int GetParameters (  QbStringClass *str )

Parameters

Input

str-Pointer to a QbStringClass object that will hold the parameters for each feature class that has already been added to the object (using the InsertFeatureClass method)

Output

Returns an integer. Successful if 0; otherwise, error.

GetParamForFeature method

This method gets the parameter class for a given feature class. Each feature class has its own parameter setting, either by default or by command line setting. This method retrieves the current parameter class for the class.

Syntax

QbParameterClass *GetParamForFeature(  char *featureName )

Parameters

Input

Output

Returns a pointer to a QbParameterClass object that holds the parameter for the feature. If NULL, there is an error.

InsertFeatures method

This method adds a feature class to the object for either database population or query.

Syntax

int InsertFeatures (  char *featureName )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

ListAllFeatures method

This method lists all feature classes in the current QBIC release

Syntax

char *ListAllFeatures(  void )

Parameters

Input

None.

Output

Returns a pointer to a string which contains all feature class names for the release. If NULL there is an error.

ListCatFeatures method

This method lists all feature classes in the catalog.

Syntax

char *ListCatFeatures(  void )

Parameters

Input

None

Output

Returns a pointer to a string that contains all feature class names for the catalog. If NULL, there is an error.

ListCatRecords method

This method obtains the number of images populated for a particular QBIC feature.

Syntax

int ListCatRecord( char *featureName )

Parameters

Input

Output

Number of keys in the feature table.

QbicWrapClassConnect method

This method connects to the database, and opens the catalog using the default parameters. An overloaded function connects to the database, and opens the catalog using inputs.

Syntax

int QbicWrapClassConnect(  void )

int QbicWrapClassConnect(  char *catName, char *dirName, char *mode )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapDBS method

This method implements the functionality of the command line program QbMkDbs. You can run QbMkDbs without any command-line arguments to display the command line syntax.

Syntax

int QbicWrapDBS( int argc, char **argv, QbStringClass *str=NULL )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapDeleteImage method

This method removes the feature data from the QBIC database with the named key. The InsertFeatures method must have been called for this method to work.

Syntax

int QbicWrapDeleteImage(  char *imgName)

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapDeleteSubImage method

This method removes the feature data from the QBIC database with the named parent and child image keys. The InsertFeatures method must have been called for this method to work.

Syntax

int QbicWrapInsertImage(  char *imgNames )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapDumpDb method

This method implements the functionality of the command-line program QbDumpDb. You can run QbDumpDb without any command-line argument to display the command-line syntax.

Syntax

int QbicWrapDumpDb( int argc, char **argv, FILE *stream )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapGetKeyWord method

This method retrieves keyword information, which is space-separated keywords stored in the object.

Syntax

char * QbicWrapGetKeyWord( void )

Parameters

Input

None

Output

Pointer to a string that holds the keyword information

QbicWrapInsertImage method

This method populates the QBIC database with the named image. The InsertFeatures method must have been called for this method to work.

Syntax

int QbicWrapInsertImage(  char *imgName)

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapInsertSubImage method

This method populates the QBIC database with the named parent and mask images. The InsertFeatures method must have been called for this method to work.

Syntax

int QbicWrapInsertImage(  char *imgNames )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapQBE method

This method implements the functionality of the command-line program QbQBE. You can run QbQBE without any command-line arguments to display the command line syntax.

Syntax

int QbicWrapQBE( int argc, char **argv, QbStringClass *str=NULL )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapQueryDB method

This method queries the data.

Syntax

int QbicWrapQueryDB(  QbStringClass *str )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapQueryImage method

This method sets up a query specification using an input image and mask.

Syntax

int QbicWrapQueryImage(  char *imgName, char *maskName)

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapQueryKey method

This method sets up a query specification using an input key.

Syntax

int QbicWrapQueryKey(  char *keyName )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapQueryPicker method

This method sets up a query specification using an input image key and image mask as a picker query.

Syntax

int QbicWrapQueryPicker(  char *keyName, char * maskName)

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapQueryString method

This method sets up a query specification using an input image description string.

Syntax

int QbicWrapQueryString(  char *str )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapRandomQueryDB method

This method returns random query keys.

Syntax

int QbicWrapRandomQueryDB(  QbStringClass *str, QbBoolean bool = True 
)

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapSetKeyWord method

This method sets the input keyword information to the object.

Syntax

void QbicWrapSetKeyWord( char *kw )

Parameters

Input

Output

None

QbicWrapSetPad method

When a thumbnail is generated, its default size is 100x100 pixels, which may not be the same aspect ratio as the input image. QBIC fills the extra regions with black pixels. Alternatively, you can generate a thumbnail with the same aspect ratio with 100 as the largest dimension. This method instructs the object on which method to use.

Syntax

void QbicWrapSetPad( QbBoolean pad )

Parameters

Input

Output

None

QbicWrapSetReturnedKeys method

This method sets the number of returned keys in a QBIC query. The default is 20.

Syntax

int QbicWrapSetReturnedKeys( int nhits )

Parameters

Input

Output

An integer for the object's previous value.

QbicWrapSetThumb24Color method

This method instructs the object to generate the thumbnail in true color. The default is to generate the thumbnail using QBIC's color palette.

Syntax

void QbicWrapSetThumb24Color( QbBoolean bool )

Parameters

Input

Output

None

QbicWrapThm method

This method implements the functionality of the command-line program QbMkThmb. You can run QbMkThmb without any command-line arguments to display the command line syntax.

Syntax

int QbicWrapThm( int argc, char **argv, QbStringClass *str=NULL )

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapThumb method

This method generates thumbnails.

Syntax

int QbicWrapThumb( char *inImage, char *outImage)

Parameters

Input

Output

Returns an integer. Successful if 0; otherwise, error.

QbicWrapThumbXY method

This method sets the dimensions of the thumbnail. The default is 100x100 pixels.

Syntax

void QbicWrapThumbXY( int width, int height )

Parameters

Input

Output

None

SetScreenPrint method

This method instructs the object on whether to print output generated in methods, such as QbMkDbs, to the screen or not. The default is "1" (Yes).

Syntax

void SetScreenPrint( int sp )

Parameters

Input

Output

None




Page 8 out of 26 total pages


xzhu@almaden.ibm.com or tedl@almaden.ibm.com
Copyright © 1998, IBM Corporation. All rights reserved.