00001 // This is core/vil1/vil1_property.h 00002 #ifndef vil1_property_h_ 00003 #define vil1_property_h_ 00004 //: 00005 // \file 00006 // 00007 // There is no class called vil1_property. 00008 // 00009 // The image class vil1_image has the methods : 00010 // \code 00011 // bool get_property(char const *tag, void *property_value = 0) const; 00012 // bool set_property(char const *tag, void const *property_value = 0) 00013 // \endcode 00014 // which allow format extensions to be added without cluttering the 00015 // interface to vil1_image. The idea is that properties can be 00016 // identified by a "tag" (some name or other textual description) 00017 // through which clients can obtain or manipulate extra properties. 00018 // 00019 // A false return value means that the underlying image does not 00020 // understand the given property or that the given data was invalid. 00021 // A true return value means it does understand the property and has 00022 // used the supplied data according to the relevant protocol. 00023 // Passing a null pointer as the second argument can be useful for 00024 // protocols for manipulating boolean properties (i.e. when there is 00025 // no data to be passed). 00026 // 00027 // To make this work in practice, it is necessary to avoid name clashes 00028 // and to make sure everyone agrees on the meaning of the property data. 00029 // That is the purpose of this file. The set of tags is a namespace in 00030 // the general sense of the word. We only have one namespace, so try 00031 // not to clutter it. All property tags described in this file should 00032 // begin with "vil1_property_" and that chunk of the namespace is reserved. 00033 // 00034 // packing of rgb(a) colours in the data produced by get_section(). 00035 // tags: 00036 // - "vil1_property_r_packing" 00037 // - "vil1_property_g_packing" 00038 // - "vil1_property_b_packing" 00039 // - "vil1_property_a_packing" 00040 // type: three ints 00041 // 00042 // If supported, the returned values describe the index of the 00043 // red/green/blue/alpha part of the pixel in plane p, row i, column j 00044 // of the whole image. E.g. to fill a 256x256 3-plane memory image from 00045 // a 256x256 disk image which supports r,g,b packing: 00046 // \code 00047 // char buf[3][256][256] 00048 // char bif[3*256*256]; 00049 // image.get_section(bif, 0, 0, 256, 256); 00050 // int a[3]; 00051 // char const *tag[] = { 00052 // "vil1_property_r_packing", 00053 // "vil1_property_g_packing", 00054 // "vil1_property_b_packing" 00055 // }; 00056 // for (int p=0; p<3; ++p) { 00057 // image.get_property(, a); 00058 // for (int i=0; i<256; ++i) 00059 // for (int j=0; j<256; ++j) 00060 // buf[p][i][j] = bif[ a[0]*p + a[1]*i + a[2]*j ]; 00061 // } 00062 // \endcode 00063 // preferred direction for access. 00064 // tags: 00065 // - "vil1_property_preferred_x_direction" 00066 // - "vil1_property_preferred_y_direction" 00067 // type: int 00068 // If supported, the returned property value is 00069 // - "-1" if the preferred direction is decreasing. 00070 // - " 0" if there is no preferred direction. 00071 // - "+1" if the preferred direction is increasing. 00072 // 00073 // \author fsm 00074 00075 //: Indicate whether this is an in-memory image or an on-disk image 00076 #define vil1_property_memory "memory" 00077 00078 //: Indicate whether the first image row is the top or the bottom of the image 00079 #define vil1_property_top_row_first "top row first" 00080 00081 //: Indicate whether the first pixel in an image row is at left or at right 00082 #define vil1_property_left_first "left first" 00083 00084 //: Indicate that the colour cell order is B,G,R instead of the default R,G,B 00085 #define vil1_property_component_order_is_BGR "component order is B,G,R" 00086 00087 #endif // vil1_property_h_
1.5.1