core/vil/vil_property.h
Go to the documentation of this file.
00001 // This is core/vil/vil_property.h
00002 #ifndef vil_property_h_
00003 #define vil_property_h_
00004 //:
00005 // \file
00006 //
00007 // There is no class or function called vil_property.
00008 //
00009 // The image class vil_image_resource has the method :
00010 // \code
00011 //   bool get_property(char const *tag, void *property_value = 0) const;
00012 // \endcode
00013 // which allow format extensions to be added without cluttering the
00014 // interface to vil_image_resource. The idea is that properties can be
00015 // identified by a "tag" (some name or other textual description)
00016 // through which clients can obtain or manipulate extra properties.
00017 //
00018 // A false return value means that the underlying image does not
00019 // understand the given property or that the given data was invalid.
00020 // A true return value means it does understand the property and has
00021 // used the supplied data according to the relevant protocol.
00022 // Passing a null pointer as the second argument can be useful for
00023 // protocols for manipulating boolean properties (i.e. when there is
00024 // no data to be passed).
00025 //
00026 // To make this work in practice, it is necessary to avoid name clashes
00027 // and to make sure everyone agrees on the meaning of the property data.
00028 // That is the purpose of this file. The set of tags is a namespace in
00029 // the general sense of the word. We only have one namespace, so try
00030 // not to clutter it. All property tags described in this file should
00031 // begin with "vil_property_" and that chunk of the namespace is reserved.
00032 //
00033 // \author  fsm
00034 
00035 //: Indicate whether this is an in-memory image or an on-disk image
00036 //  By default an image is not in-memory, and since this is a boolean property
00037 //  the return value of get_property(), which is "false" by default, will be
00038 //  correct.  Only in-memory images must implement this property, and return
00039 //  "true".
00040 #define vil_property_memory "memory"
00041 
00042 //: Indicate that you can't call put_view on this image.
00043 //  By default an image is not read-only, and since this is a boolean property
00044 //  the return value of get_property(), which is "false" by default, will be
00045 //  correct.  Only images which do not allow put_view must implement this
00046 //  property, and return "true".
00047 #define vil_property_read_only "read-only"
00048 
00049 //: Pixel width in metres.
00050 // Strictly this is the pixel spacing, and not some function of
00051 // the sensor's spatial sampling kernel.
00052 // Type is float[2].
00053 #define vil_property_pixel_size "pixel_size"
00054 
00055 //: Original image origin in pixels.
00056 // Measured right from left edge, and down from top - i.e. in i and j directions
00057 // Type is float[2].
00058 #define vil_property_offset "offset"
00059 
00060 //: The quantisation depth of pixel components.
00061 // This is the maximum information per pixel component. (Bear in mind that particular image
00062 // may not even be using all of it.) e.g. an image with true vil_rgb<vxl_byte> style
00063 // pixels would return 8. If a file image has this property implemented, and purports to
00064 // supply an unsigned-type you can assume that it will give you pixels valued between
00065 // 0 and 2^quantisation_depth - 1.
00066 // Type is unsigned int.
00067 #define vil_property_quantisation_depth "quantisation_depth"
00068 
00069 //: For unblocked images, the following properties are not implemented.
00070 //  It is assumed that all blocks are the same size and padded with zeros if
00071 //  necessary. Thus, n_block_i = (ni() + size_block_i - 1)/size_block_i and
00072 //  n_block_j = (nj() + size_block_j - 1)/size_block_j. Both properties must
00073 //  be implemented for blocked images.  Type is unsigned int.
00074 
00075 //: Block size in columns
00076 #define vil_property_size_block_i "size_block_i"
00077 
00078 //: Block size in rows
00079 #define vil_property_size_block_j "size_block_j"
00080 
00081 //: true if image resource is a pyramid image
00082 #define vil_property_pyramid "pyramid"
00083 
00084 
00085 #endif // vil_property_h_