Changes between Version 5 and Version 6 of FDORfc2
- Timestamp:
- 04/18/07 12:34:18 (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FDORfc2
v5 v6 1 2 1 3 = FDO RFC 2 - Support Raster Min/Max Fetching = 2 4 … … 43 45 /// \return 44 46 /// Returns the number of bits for each pixel. For multi-channel 45 /// data the bits per channel will be this value d evided by the numer of47 /// data the bits per channel will be this value divided by the number of 46 48 /// channels. For example, RGB data has three channels, so if this 47 49 /// method returns twelve, each channel is four bits. … … 63 65 }}} 64 66 65 However, returning only the bits per pixel is not sufficient to quickly and efficiently scale the raster for display in cases where dynamic contrast stretching is appropriate. In cases where st etching is needed (for instance 16bit greyscale images or 4bit images represented as 8bit) it is often the case that the full dynamic range of the data type is not being used. In order to scale the raster to 0-255 for display it is necessary to know what actual range of values is used. For some data types (floating point elevations for instance) there is no obvious range implicit in the data type.67 However, returning only the bits per pixel is not sufficient to quickly and efficiently scale the raster for display in cases where dynamic contrast stretching is appropriate. In cases where stretching is needed (for instance 16bit grey scale images or 4bit images represented as 8bit) it is often the case that the full dynamic range of the data type is not being used. In order to scale the raster to 0-255 for display it is necessary to know what actual range of values is used. For some data types (floating point elevations for instance) there is no obvious range implicit in the data type. 66 68 67 Client application can work out the range by making a first pass reading the whole dataset to scan for a min/max, and then pulling out subareas they are actually interested in and scaling those. But this is very expensive, and discards any opportunity to use pre-existing metadata from the datasource to establish the value min/max range.69 Client applications can work out the range by making a first pass reading the whole dataset to scan for a min/max, and then pulling out sub areas they are actually interested in and scaling those. But this is very expensive, and discards any opportunity to use pre-existing metadata from the data source to establish the value min/max range. 68 70 69 71 This issue was identified by IKonus, a corporate user of the FDO API. … … 71 73 == Proposed Solution == 72 74 73 The FDO !Fdo RasterDataModel class will be extended to export the number of bits used per pixel.75 The FDO !FdoIRaster interface will be extended to export the min and max values supported by the raster. 74 76 75 77 {{{ 76 78 /// \brief 77 /// The FdoRasterDataModelspecifies the data type and organization79 /// The !FdoIRaster specifies the data type and organization 78 80 /// of raster data retrieved and stored. Using this class and the image 79 81 /// extents in width and length, the binary format of the image data returned 80 /// by and accepted by the FdoI StreamReader class can be interpreted.81 class Fdo RasterDataModel: public FdoIDisposable82 /// by and accepted by the FdoIoStreamReader class can be interpreted. 83 class FdoIRaster : public FdoIDisposable 82 84 { 85 public: 83 86 ... 84 87 FdoDouble m_min; … … 90 93 ... 91 94 /// \brief 92 /// Get the raster min/max.95 /// Get the raster band’s min/max values. 93 96 /// 94 97 /// Returns min/max raster values suitable to use for linearly scaling this … … 99 102 /// If the force parameter is true, this call may result in a substantial 100 103 /// delay while the provider scans the image to compute appropriate min/max 101 /// values. 104 /// values. If force is false then the provider is expected to do only 102 105 /// minimal work to produce a value, or to fail. 103 106 /// … … 108 111 /// values will scan the whole image. If approx_ok is true then 109 112 /// computation of min/max by the provider may be accelerated by using 110 /// overview images ,or a sampling of the full image as deemed appropriate113 /// overview images or a sampling of the full image as deemed appropriate 111 114 /// by the provider as long as the result is likely to still be suitable 112 115 /// for scaling the image. 113 116 /// 114 /// \param min the returned minimum 115 /// \param max the returned maximum 116 /// \param force true if computation should be forced even if it is expensive 117 /// \param approx_ok true if an approximate min/max is acceptable, or false if an exact value is required 117 /// \remarks 118 /// The min and max values will change depending on the current band set 119 /// through the SetCurrentBand method. By default, the current band is set 120 /// to the first band. 121 /// 122 /// \param min 123 /// Output. The returned minimum 124 /// 125 /// \param max 126 /// Output. The returned maximum 127 /// 128 /// \param force 129 /// Input. True if computation should be forced even if it is expensive 130 /// 131 /// \param approx_ok 132 /// Input. True if an approximate min/max is acceptable, 133 /// or false if an exact value is required 134 /// 118 135 /// \return 119 136 /// true if min/max have been set with appropriate values, or false if not. 120 137 /// 121 FDO_API virtual bool GetMinMax( FdoDouble &min, FdoDouble &max, 122 bool force, bool approx_ok ); 138 FDO_API virtual bool GetMinMaxValues( FdoDouble &min, 139 FdoDouble &max, 140 bool force, 141 bool approx_ok ); 123 142 124 143 /// \brief 125 /// Set the raster min/max.144 /// Sets the raster band’s min/max values. 126 145 /// 127 /// \param min the minimum raster value 128 /// \param max the maximum raster value 146 /// \remarks 147 /// The min and max values will change depending on the current band set 148 /// through the SetCurrentBand method. By default, the current band is set 149 /// to the first band. 150 /// 151 /// This value should not be called by client applications. 152 /// 153 /// \param min 154 /// Input. The minimum raster value 155 /// 156 /// \param max 157 /// Inout. The maximum raster value 129 158 /// 130 159 /// \remarks … … 132 161 /// within the provider and would not normally be called by client 133 162 /// applications. 134 FDO_API virtual void SetMinMax( FdoDouble min, FdoDouble max ); 163 /// 164 FDO_API virtual void SetMinMaxValues( FdoDouble min, 165 FdoDouble max ); 135 166 ... 136 167 };