Page 16 out of 26 total pages


QbGenericDataClass


QbGenericDataClass is derived from the QbBaseClass and defines generic data: images, video, text, and audio. This class encapsulates the data between the feature extraction process, the user interface, and external data (image files). This class is fully implemented and gives you a standardized way to pass "query by example" or "query from sampler data" between a client and server. It also provides a standard way of passing domain-specific information between a client and server. This class does nothing to document the format of the domain-specific data. To do this, you need to subclass this class and specify the domain-specific data.

An example of a subclass of this class is the QbGenericImageDataClass class, which contains domain-specific image data.

You pass it to the ComputeFeature method in any class that derives from QbFeatureClass (such as QbColorHistogramFeatureClass), as input for feature computation. A protected member variable, dataSource type, in QbGenericDataClass determines how the ComputeFeature method should proceed in feature extraction.

dataSource is a public enumerated type that takes the following values:

QbGenericDataClass method

This is the constructor for the class.

Syntax

QbGenericDataClass( void )

Parameters

None

~QbGenericDataClass method

This is the destructor for the class.

Syntax

virtual ~QbGenericDataClass( void )

Parameters

None

DataIsSubPartDefinition method

This method sets a flag that indicates that the object contains subpart data.

Syntax

void DataIsSubPartDefinition( void )

Parameters

None

DecodeSubPartDef method

This method decodes a subpart definition from input to initialize the class object.

Syntax

virtual int DecodeSubPartDef( const QbDatumClass &subPartDatum )

Parameters

Input

subPartDatum-A reference to a QbDatumClass object that holds the subpart description to be decoded

Output

An integer value: 0 indicates success; -1 indicates failure

EncodeSubPartDef method

This method encodes the current object's subpart description into the byte string of the input subPartDatum.

Syntax

virtual int EncodeSubPartDef( QbDatumClass &subPartDatum )

Parameters

Input

subPartDatum-A reference to a QbDatumClass object that will hold the byte string of the encoded subpart description.

Output

An integer value: 0 indicates success; -1 indicates failure

FromQueryString method

This method initializes the current object with the date encoded in the byte string of the input QbDatumClass object, datum.

Syntax

virtual int FromQueryString( const QbDatumClass &datum, const char 
*featureClassname )

Parameters

Input

Output

An integer value: 0 indicates success; -1 indicates failure

GetCatalog method

This method returns the catalog name.

Syntax

const char * GetCatalog( void )

Parameters

Input

None

Output

A pointer to a string to hold the catalog name

GetData method

This method returns a reference to a QbDatumClass object packed with feature data.

Syntax

const QbDatumClass & GetData( void )

Parameters

Input

None

Output

A reference to a QbDatumClass object that packs the feature data in its byte string.

GetDerivedClassData method

This method returns a reference to a QbDatumClass object that packs domain-specific data, such as image, text, and audio, into its member byte string.

Syntax

const QbDatumClass & GetDerivedClassData( void )

Parameters

Input

None

Output

A reference to a QbDatumClass object that packs the domain-specific data into its member byte string for feature computation

GetIsQuery method

This method returns True if the object corresponds to query data description. In some feature classes, like QbColorHistogramFeatureClass, the ComputeFeature method might need additional processing on query feature data to increase the speed of the query.

Syntax

Boolean GetIsQuery( void )

Parameters

Input

None

Output

A Boolean value; True if the object corresponds to query data description

GetKey method

This method returns the name of the database key.

Syntax

const char * GetKey( void )

Parameters

Input

None

Output

A pointer to a string that holds the name of the database key

GetSampler method

This method returns the name of the sampler.

Syntax

const char * GetSampler( void )

Parameters

Input

None

Output

A pointer to a string to hold the sampler name

GetTextDescription method

This method returns the text description of the generic data.

Syntax

char * GetTextDescription( void )

Parameters

Input

None

Output

A pointer to a string to hold the text description

GetType method

This method returns the data source type of an object.

Syntax

const dataSource GetType( void )

Parameters

Input

None

Output

An enumerated type of dataSource, described on page 111

isSubPartDefinition method

This method returns a value that represents whether the generic data is in a subpart definition. For an image, for example, you can pass a mask image file with the same size as the original image. The mask file has pixel values of either zero or non-zero. QBIC performs feature computations on pixels of the image where the mask has non-zero pixel values.

Syntax

int isSubPartDefinition( void )

Parameters

Input

None

Output

An integer value: 1 if the generic data is in a subpart description, 0 if not

Itype method

This method returns the interface type defined in the base class.

Syntax

virtual const QbInterfaceType Itype( void )

Parameters

Input

None

Output

GenericDataInterfaceType of QbInterfaceType defined in the QbBaseClass. See page 49.

MakeQueryByExampleObject method

This method defines the object as a query-by-example type for the given key and catalog names. Query by example means that the feature data is already in the database. Therefore, by passing the catalog name and the key, feature data can be extracted from the database.

Syntax

int MakeQueryByExampleObject( const char *CatalogName, const char 
*KeyName )

Parameters

Input

Output

An integer value: 0 indicates success; -1 indicates failure.

MakeQueryByTextObject method

This method defines the object as a query-by-text type. Query-by-text searches through keywords to find records with the same keyword.

Syntax

int MakeQueryByTextObject( const char *text )

Parameters

Input

text-A pointer to a string that holds the text or keyword description

Output

An integer value: 0 indicates success; -1 indicates failure

SetCatalog method

This method deletes the current catalog name, and replaces it with the new one pointed to by catalogArg.

Syntax

int SetCatalog( const char *catalogArg )

Parameters

Input

catalogArg-A pointer to a string that holds the new catalog name

Output

An integer value: 0 indicates success; -1 indicates failure

SetIsQuery method

This method sets the object as a query object if bArg=True. See also "GetIsQuery method" on page  116.

Syntax

Boolean SetIsQuery( Boolean bArg )

Parameters

Input

A Boolean value.

Output

A Boolean value that has the same value returned by a GetIsQuery call before the new value bArg is set.

SetKey method

This method deletes the current key name, and replaces it with the new one pointed to by keyArg.

Syntax

int setKey( const char *keyArg )

Parameters

Input

keyArg-A pointer to a string that holds the key name

Output

An integer value: 0 indicates success; -1 indicates failure

SetSampler method

This method deletes the current sampler name and replaces it with the name pointed to by samplerArg.

Syntax

int SetSampler( const char *samplerArg )

Parameters

Input

samplerArg-A pointer to a string that holds the sampler name

Output

An integer value: 0 indicates success; -1 indicates failure

SetTextDescription method

This method deletes the current text description and replaces it with the given string. The text description is specific to the text query for QBIC.

Syntax

int SetTextDescription ( const char *text )

Parameters

Input

text-A pointer to a string that contains the text description for the query, such as a set of keywords

Output

An integer value: 0 indicates success; -1 indicates failure

SetType method

This method sets the type of data source in QbGenericDataClass.

Syntax

void SetType( const dataSource typeArg )

Parameters

Input

typeArg-An enumerated type of dataSource described on page 111

Output

None

ToQueryString method

This method translates generic and domain-specific information inside the object to a byte string.

Syntax

virtual int ToQueryString( QbDatumClass &datum )

Parameters

Input

datum-A reference to a QbDatumClass object that will hold the byte string of the encoded data

Output

An integer value: 0 indicates success; -1 indicates failure

Type method

This method returns a constant string of the class name.

Syntax

virtual const char * Type( void )

Parameters

Input

None

Output

A constant string, QbGenericDataClass





Page 16 out of 26 total pages


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