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:
You can see coding examples in Appendix C, "Sample Code" on page 185. Other programs are located in the qbic/QbicApi
directory.
This is the constructor for the class. This method has overloaded functions.
QbicWrapClass( void ) QbicWrapClass( char *catName, char *dirName, char *mode )
This is the destructor for the class.
~QbicWrapClass( void )
This method deletes a feature class from the object database population or query.
int DeleteFeatures ( char *featureName )
Returns an integer. Successful if 0; otherwise, error.
This method computes the feature data for the input image or mask name.
int GetFeatureDataImage (char *imgName, char *maskName, QbStringClass *str )
Returns an integer. Successful if 0; otherwise, error.
This method retrieves the feature data from the database for the input image key name.
int GetFeatureDataKey (char *imgKey, QbStringClass *str )
Returns an integer. Successful if 0; otherwise, error.
This method retrieves the feature data for the picker image or mask name.
int GetFeatureDataPicker(char *imgName, char *maskName, QbStringClass *str )
Returns an integer. Successful if 0; otherwise, error.
This method computes the feature data for the input string description of the image.
int GetFeatureDataString(char *strDes, QbStringClass *str )
Returns an integer. Successful if 0; otherwise, error.
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.
int GetParameters ( QbStringClass *str )
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)
Returns an integer. Successful if 0; otherwise, error.
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.
QbParameterClass *GetParamForFeature( char *featureName )
Returns a pointer to a QbParameterClass object that holds the parameter for the feature. If NULL, there is an error.
This method adds a feature class to the object for either database population or query.
int InsertFeatures ( char *featureName )
Returns an integer. Successful if 0; otherwise, error.
This method lists all feature classes in the current QBIC release
char *ListAllFeatures( void )
Returns a pointer to a string which contains all feature class names for the release. If NULL there is an error.
This method lists all feature classes in the catalog.
char *ListCatFeatures( void )
Returns a pointer to a string that contains all feature class names for the catalog. If NULL, there is an error.
This method obtains the number of images populated for a particular QBIC feature.
int ListCatRecord( char *featureName )
Number of keys in the feature table.
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.
int QbicWrapClassConnect( void ) int QbicWrapClassConnect( char *catName, char *dirName, char *mode )
Returns an integer. Successful if 0; otherwise, error.
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.
int QbicWrapDBS( int argc, char **argv, QbStringClass *str=NULL )
Returns an integer. Successful if 0; otherwise, error.
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.
int QbicWrapDeleteImage( char *imgName)
Returns an integer. Successful if 0; otherwise, error.
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.
int QbicWrapInsertImage( char *imgNames )
imageParent ( maskName1 maskName2 ... )
Returns an integer. Successful if 0; otherwise, error.
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.
int QbicWrapDumpDb( int argc, char **argv, FILE *stream )
Returns an integer. Successful if 0; otherwise, error.
This method retrieves keyword information, which is space-separated keywords stored in the object.
char * QbicWrapGetKeyWord( void )
Pointer to a string that holds the keyword information
This method populates the QBIC database with the named image. The InsertFeatures method must have been called for this method to work.
int QbicWrapInsertImage( char *imgName)
Returns an integer. Successful if 0; otherwise, error.
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.
int QbicWrapInsertImage( char *imgNames )
imageParent ( maskName1 maskName2 ... )
Returns an integer. Successful if 0; otherwise, error.
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.
int QbicWrapQBE( int argc, char **argv, QbStringClass *str=NULL )
Returns an integer. Successful if 0; otherwise, error.
int QbicWrapQueryDB( QbStringClass *str )
Returns an integer. Successful if 0; otherwise, error.
This method sets up a query specification using an input image and mask.
int QbicWrapQueryImage( char *imgName, char *maskName)
Returns an integer. Successful if 0; otherwise, error.
This method sets up a query specification using an input key.
int QbicWrapQueryKey( char *keyName )
Returns an integer. Successful if 0; otherwise, error.
This method sets up a query specification using an input image key and image mask as a picker query.
int QbicWrapQueryPicker( char *keyName, char * maskName)
Returns an integer. Successful if 0; otherwise, error.
This method sets up a query specification using an input image description string.
int QbicWrapQueryString( char *str )
Returns an integer. Successful if 0; otherwise, error.
This method returns random query keys.
int QbicWrapRandomQueryDB( QbStringClass *str, QbBoolean bool = True )
Returns an integer. Successful if 0; otherwise, error.
This method sets the input keyword information to the object.
void QbicWrapSetKeyWord( char *kw )
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.
void QbicWrapSetPad( QbBoolean pad )
This method sets the number of returned keys in a QBIC query. The default is 20.
int QbicWrapSetReturnedKeys( int nhits )
An integer for the object's previous value.
This method instructs the object to generate the thumbnail in true color. The default is to generate the thumbnail using QBIC's color palette.
void QbicWrapSetThumb24Color( QbBoolean bool )
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.
int QbicWrapThm( int argc, char **argv, QbStringClass *str=NULL )
Returns an integer. Successful if 0; otherwise, error.
This method generates thumbnails.
int QbicWrapThumb( char *inImage, char *outImage)
Returns an integer. Successful if 0; otherwise, error.
This method sets the dimensions of the thumbnail. The default is 100x100 pixels.
void QbicWrapThumbXY( int width, int height )
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).
void SetScreenPrint( int sp )