26#include "iclass_local_proto.h"
31 struct Range rast_range;
70 G_warning(
"Unable to create category raster condition file <%s>.",
81 G_warning(
_(
"Unable to write header into category raster condition "
88 sizeof(
unsigned char));
99 _(
"Unable to write into category raster condition file <%s>."),
180 float ns_res, ew_res;
186 G_warning(
"'get_rows_and_cols_bounds' ns_res does not fit, A->ns_res: "
193 G_warning(
"'get_rows_and_cols_bounds' ew_res does not fit, A->ew_res: "
202 if (regions_intersecion(A, B, &
intersec) == -1)
252 G_warning(
_(
"Unable to open category raster conditions file <%s>."),
276 _(
"Resolutions of patch <%s> and patched file <%s> are not same."),
284 else if (
ret == -1) {
302 _(
"Corrupted category raster conditions file <%s> (fseek failed)"),
334 _(
"Unable to write into category raster conditions file <%s>"),
345 G_warning(
_(
"Corrupted category raster conditions file <%s> "
376static void update_cat_scatt_plts(
struct rast_row *
bands_rows,
392 int *scatts_bands =
scatts->scatts_bands;
426 G_warning(
"Inconsistent data. Value computed for scatter plot "
427 "is out of initialized range.");
524 "Unable to read from category raster condition file."));
531 _(
"Invalid size of category raster conditions file."));
575 "Value computed for scatter plot is out of "
576 "initialized range."));
626 ->scatts_bands[
i_scatt * 2 + 1]] = 1;
649 for (
int i = 0; i < n_a_cats; i++)
653 for (
int i = 0; i < n_a_cats; i++)
738 free_compute_scatts_data(
747 free_compute_scatts_data(
756 free_compute_scatts_data(
769 free_compute_scatts_data(
772 G_warning(
_(
"Unable to read range of raster <%s>"),
792 free_compute_scatts_data(
796 _(
"Unable to open category raster condition file <%s>"),
809 free_compute_scatts_data(
812 G_warning(
_(
"Corrupted category raster conditions file (fseek "
857 unsigned rows,
unsigned cols,
double alpha)
912 for (i = 0; i < 4; i++)
915 for (i = 0; i < 4; i++)
918 for (i = 0; i < 4; i++)
921 for (i = 0; i < 4; i++) {
961 for (i = 1; i <
perimeter.npoints; i += 2) {
965 _(
"prepare_signature: scan line %d has odd number of points."),
976 G_warning(
_(
"signature: perimeter points out of order."));
const char * G_find_raster(char *, const char *)
Find a raster map.
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
void G_free(void *)
Free allocated memory.
void G_warning(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
const char * G_find_raster2(const char *, const char *)
Find a raster map (look but don't touch)
CELL * Rast_allocate_c_buf(void)
Allocate memory for a CELL type raster map.
void Rast_close(int)
Close a raster map.
int Rast_open_old(const char *, const char *)
Open an existing integer raster map (cell)
void Rast_get_c_row(int, CELL *, int)
Get raster row (CELL type)
int Rast_open_new(const char *, RASTER_MAP_TYPE)
Opens a new raster map.
int Rast_read_range(const char *, const char *, struct Range *)
Read raster range (CELL)
char * Rast_allocate_null_buf(void)
Allocates memory for a null buffer.
int Rast_window_cols(void)
Number of columns in active window.
int Rast_window_rows(void)
Number of rows in active window.
void Rast_set_null_value(void *, int, RASTER_MAP_TYPE)
To set one or more raster values to null.
void Rast_put_c_row(int, const CELL *)
Writes the next row for cell file (CELL version)
void Rast_set_window(struct Cell_head *)
Establishes 'window' as the current working window.
void Rast_get_cellhd(const char *, const char *, struct Cell_head *)
Read the raster header.
void Rast_get_null_value_row(int, char *, int)
Read or simulate null value row.
RASTER_MAP_TYPE Rast_get_map_type(int)
Determine raster type from descriptor.
void Vect_destroy_line_struct(struct line_pnts *)
Frees all memory associated with a line_pnts structure, including the structure itself.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_append_point(struct line_pnts *, double, double, double)
Appends one point to the end of a line.
int make_perimeter(struct line_pnts *points, IClass_perimeter *perimeter, struct Cell_head *band_region)
Creates one perimeter from vector area.
int I_apply_colormap(unsigned char *vals, unsigned char *vals_mask, unsigned nvals, unsigned char *colmap, unsigned char *col_vals)
Apply colromap to the raster.
int I_create_cat_rast(struct Cell_head *cat_rast_region, const char *cat_rast)
Create category raster conditions file. The file is used for holding selected areas from mapwindow....
int I_compute_scatts(struct Cell_head *region, struct scCats *scatt_conds, const char **cats_rasts_conds, const char **bands, int n_bands, struct scCats *scatts, const char **cats_rasts)
Compute scatter plots data.
int I_merge_arrays(unsigned char *merged_arr, unsigned char *overlay_arr, unsigned rows, unsigned cols, double alpha)
Merge arrays according to opacity. Every pixel in array must be represented by 4 values (RGBA).
int I_rasterize(double *polygon, int pol_n_pts, unsigned char val, struct Cell_head *rast_region, unsigned char *rast)
Wrapper for using of iclass perimeter rasterization by scatter plot. Warning: calls Rast_set_window.
int I_insert_patch_to_cat_rast(const char *patch_rast, struct Cell_head *cat_rast_region, const char *cat_rast)
Insert raster map patch into pgm file.
2D/3D raster map header (used also for region)
double ew_res
Resolution - east to west cell size for 2D data.
double north
Extent coordinates (north)
double east
Extent coordinates (east)
double ns_res
Resolution - north to south cell size for 2D data.
int rows
Number of rows for 2D data.
int cols
Number of columns for 2D data.
double south
Extent coordinates (south)
double west
Extent coordinates (west)
Feature geometry info - coordinates.
double * y
Array of Y coordinates.
struct scScatts ** cats_arr