contrib/mul/vil3d/vil3d_property.h File Reference


Detailed Description

There is no class or function called vil3d_property.

The image class vil3d_image_resource has the method :

   bool get_property(char const *label, void *property_value = 0) const;
which allow format extensions to be added without cluttering the interface to vil_image_resource. The idea is that properties can be identified by a "label" (some name or other textual description) through which clients can obtain or manipulate extra properties.

A false return value means that the underlying image does not understand the given property or that the given data was invalid. A true return value means it does understand the property and has used the supplied data according to the relevant protocol. Passing a null pointer as the second argument can be useful for protocols for manipulating boolean properties (i.e. when there is no data to be passed).

To make this work in practice, it is necessary to avoid name clashes and to make sure everyone agrees on the meaning of the property data. That is the purpose of this file. The set of labels is a namespace in the general sense of the word. We only have one namespace, so try not to clutter it. All property labels described in this file should begin with "vil3d_property_" and that chunk of the namespace is reserved.

An example

 float vs[3];
 vcl_cout << "Volume of image is ";
 if (image.get_property(vil3d_property_voxel_size, &voxel_size))
   vcl_cout << vs[0]*vs[1]*vs[2]*im.ni()*im.nj()*im.nk() << vcl_endl;
 else
   vcl_cout << "unknown\n";

Author:
Ian Scott - Copied from fsm's design in vil.

Definition in file vil3d_property.h.

Go to the source code of this file.


Generated on Mon Nov 23 05:15:08 2009 for contrib/mul/vil3d by  doxygen 1.5.1