vil_property.h
Go to the documentation of this file.
1 // This is core/vil/vil_property.h
2 #ifndef vil_property_h_
3 #define vil_property_h_
4 //:
5 // \file
6 //
7 // There is no class or function called vil_property.
8 //
9 // The image class vil_image_resource has the method :
10 // \code
11 // bool get_property(char const *tag, void *property_value = 0) const;
12 // \endcode
13 // which allow format extensions to be added without cluttering the
14 // interface to vil_image_resource. The idea is that properties can be
15 // identified by a "tag" (some name or other textual description)
16 // through which clients can obtain or manipulate extra properties.
17 //
18 // A false return value means that the underlying image does not
19 // understand the given property or that the given data was invalid.
20 // A true return value means it does understand the property and has
21 // used the supplied data according to the relevant protocol.
22 // Passing a null pointer as the second argument can be useful for
23 // protocols for manipulating boolean properties (i.e. when there is
24 // no data to be passed).
25 //
26 // To make this work in practice, it is necessary to avoid name clashes
27 // and to make sure everyone agrees on the meaning of the property data.
28 // That is the purpose of this file. The set of tags is a namespace in
29 // the general sense of the word. We only have one namespace, so try
30 // not to clutter it. All property tags described in this file should
31 // begin with "vil_property_" and that chunk of the namespace is reserved.
32 //
33 // \author fsm
34 
35 //: Indicate whether this is an in-memory image or an on-disk image
36 // By default an image is not in-memory, and since this is a boolean property
37 // the return value of get_property(), which is "false" by default, will be
38 // correct. Only in-memory images must implement this property, and return
39 // "true".
40 #define vil_property_memory "memory"
41 
42 //: Indicate that you can't call put_view on this image.
43 // By default an image is not read-only, and since this is a boolean property
44 // the return value of get_property(), which is "false" by default, will be
45 // correct. Only images which do not allow put_view must implement this
46 // property, and return "true".
47 #define vil_property_read_only "read-only"
48 
49 //: Pixel width in metres.
50 // Strictly this is the pixel spacing, and not some function of
51 // the sensor's spatial sampling kernel.
52 // Type is float[2].
53 #define vil_property_pixel_size "pixel_size"
54 
55 //: Original image origin in pixels.
56 // Measured right from left edge, and down from top - i.e. in i and j directions
57 // Type is float[2].
58 #define vil_property_offset "offset"
59 
60 //: The quantisation depth of pixel components.
61 // This is the maximum information per pixel component. (Bear in mind that particular image
62 // may not even be using all of it.) e.g. an image with true vil_rgb<vxl_byte> style
63 // pixels would return 8. If a file image has this property implemented, and purports to
64 // supply an unsigned-type you can assume that it will give you pixels valued between
65 // 0 and 2^quantisation_depth - 1.
66 // Type is unsigned int.
67 #define vil_property_quantisation_depth "quantisation_depth"
68 
69 //: For unblocked images, the following properties are not implemented.
70 // It is assumed that all blocks are the same size and padded with zeros if
71 // necessary. Thus, n_block_i = (ni() + size_block_i - 1)/size_block_i and
72 // n_block_j = (nj() + size_block_j - 1)/size_block_j. Both properties must
73 // be implemented for blocked images. Type is unsigned int.
74 
75 //: Block size in columns
76 #define vil_property_size_block_i "size_block_i"
77 
78 //: Block size in rows
79 #define vil_property_size_block_j "size_block_j"
80 
81 //: true if image resource is a pyramid image
82 #define vil_property_pyramid "pyramid"
83 
84 
85 #endif // vil_property_h_