GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-6596d49e63
|
Imagery library - wx.iscatt (wx Interactive Scatter Plot Tool) backend. More...
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <grass/gis.h>
#include <grass/vector.h>
#include <grass/raster.h>
#include <grass/imagery.h>
#include <grass/glocale.h>
#include "iclass_local_proto.h"
Go to the source code of this file.
Functions | |
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. The reason why the standard GRASS raster is not used is that for every modification (new area is selected) we would need to create whole new raster. Instead of this scatter plot only modifies affected region in the internal pgm file. More... | |
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. More... | |
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. More... | |
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). More... | |
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. More... | |
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. More... | |
Imagery library - wx.iscatt (wx Interactive Scatter Plot Tool) backend.
Copyright (C) 2013 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file iscatt_core.c.
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.
Implemented for speeding up of scatter plots rendering.
vals | array of values for applying the colormap | |
vals_mask | mask of vals array | |
nvals | number of items of vals_mask and vals array | |
colmap | colour map to be applied | |
[out] | col_vals | output raster with applied color map (length is 4 * nvals (RGBA)) |
Definition at line 891 of file iscatt_core.c.
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.
If category has not defined category raster condition file and no scatter plot exists with condition, default/full scatter plot is computed. Warning: calls Rast_set_window
region | analysis region, beaware that all input data must be prepared for this region (bands (their ranges), cats_rasts_conds rasters...) | |
region | function calls Rast_set_window for this region | |
scatt_conds | pointer to scScatts struct of type SC_SCATT_CONDITIONS, where are stored selected areas (conditions) in scatter plots | |
cats_rasts_conds | paths to category raster conditions files representing selected areas from mapwindow (conditions) in rasters for every category | |
cats_rasts_conds | index in array represents corresponding category id | |
cats_rasts_conds | for manipulation with category raster conditions file see also I_id_scatt_to_bands and I_insert_patch_to_cat_rast | |
bands | names of analyzed bands, order of bands is defined by their id | |
n_bands | number of bands | |
[out] | scatts | pointer to scScatts struct of type SC_SCATT_DATA, where are computed scatter plots stored |
[out] | cats_rasts | array of raster maps names for every category where will be stored all selected pixels |
Definition at line 685 of file iscatt_core.c.
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. The reason why the standard GRASS raster is not used is that for every modification (new area is selected) we would need to create whole new raster. Instead of this scatter plot only modifies affected region in the internal pgm file.
cat_rast_region | region to be file generated for | |
[out] | cat_rast | path where the pgm raster file will be generated |
Definition at line 59 of file iscatt_core.c.
References G_warning().
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.
Warning: calls Rast_set_window
patch_rast | name of raster map |
cat_rast_region | region of category raster file |
cat_rast | path to category raster file |
Definition at line 231 of file iscatt_core.c.
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).
Implemented for speeding up of scatter plots rendering.
merged_arr | array which will be overlayd with overlay_arr |
overlay_arr | array to be merged_arr overlaid with |
rows | number of rows for the both arrays |
cols | number of columns for the both arrays |
alpha | transparency (0-1) of the overlay array for merging |
Definition at line 848 of file iscatt_core.c.
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.
polygon | array of polygon coordinates [x, y, x, y...] | |
pol_n_pts | number of points in the polygon array | |
val | value to be assigned to cells, which belong to plygon | |
rast_region | region of raster | |
[out] | rast | raster to be pologyn rasterized in |
Definition at line 934 of file iscatt_core.c.