SE_rasbandinfo_set_bin_function |
Sets the bin function for a raster band.
LONG SE_rasbandinfo_set_bin_function ( SE_RASBANDINFO rasterband, SE_BIN_FUNCTION_TYPE type, LONG num_bins, LFLOAT *bin_table);
rasterband | The SE_RASBANDINFO handle |
bin | The bin function type |
num_bins | The number of bins |
bin_table | The bin table |
SE_rasbandinfo_set_bin_function sets the bin function for a raster band.
Setting bin function
followed by a call to SE_rasterband_alter calculates the image's statistics.
The possible bin function types are:
SE_BIN_FUNCTION_NONE
SE_BIN_FUNCTION_AUTO
SE_BIN_FUNCTION_DIRECT
SE_BIN_FUNCTION_LINEAR
SE_BIN_FUNCTION_LOGARITHM
SE_BIN_FUNCTION_EXPLICIT
Set the bin function type to SE_BIN_FUNCTION_NONE, to remove the current bin function.
Setting the bin function type to SE_BIN_FUNCTION_AUTO, allows ArcSDE
to automatically select
the optimum bin function for the pixel type of the image. To use the SE_BIN_FUNCTION_AUTO
bin
function type the number of bins must be set to 0 and the bin table must
be set to NULL. If they
are not, ArcSDE returns an SE_INVALID_PARAM (invalid parameter) error.
If the bin function type is set to SE_BIN_FUNCTION_DIRECT, the number
of bins must be set to 0.
In this case ArcSDE calculates the actual number of bins based on the image's
pixel values.
The bin table is used when the bin function type is set to SE_BIN_FUNCTION_EXPLICIT.
The number of bins must always be one greater than the number of bin
table elements.
The boundaries the lowest bin is bounded by the minimum pixel value and
the first element of
the bin table, while the highest bin is bounded by the last element of
the bin table and the
maximum pixel value.
Unless you are specifically creating band statistics to support an image
analysis program,
you should use the SE_BIN_FUNCTION_AUTO bin function. Do not set the bin
function prior to
call to SE_rasterband_create as this will result in an error, because statistics
can only be
calculated after the image data has been loaded. Therefore, a call to SE_rasterband_alter
must
follow, SE_rasbandinfo_set_bin_function, to calculate the statistics.
After the band statistics have been calculated they can be examined
by calling the following
raster band statistics property functions:
SE_rasbandinfo_get_stats_histogram
SE_rasbandinfo_has_stats
SE_rasbandinfo_get_stats_min
SE_rasbandinfo_get_stats_max
SE_rasbandinfo_get_stats_mean
SE_rasbandinfo_get_stats_stddev
SE_SUCCESS
SE_INVALID_POINTER
SE_OUT_OF_CLMEM
SE_INVALID_PARAM_VALUE