#include <tcl.h>
#include <tk.h>
#include <sadie.h>
#include "tclsadie.h"
Go to the source code of this file.
Typedefs | |
typedef const struct Line_value_range * | line_value_rangep_t |
An immutable coordinate range. | |
typedef double(* | bar_sizer_t )(double val, line_value_rangep_t range) |
Define a generic graph bar scaling operation. | |
Enumerations | |
enum | plot_pos { TOP_MARGIN = 15, RIGHT_MARGIN = 100, TOP_SPACING = 10, LEFT_SPACING = 61, Y_HEIGHT = 100, AXIS_DEPTH = 1, MINOR_DEPTH = 4, MAJOR_DEPTH = 6, CAPTION_DEPTH = 8, PLOT_HEIGHT = 140, TICK_SPACE = 16, MAJOR_SPACE = 2 } |
Constants for positioning parts of the plotted bar graphs. More... | |
enum | label_index { LBL_XMIN, LBL_XMAX, LBL_YMIN, LBL_YMAX, max_label_index } |
Array slots for axis labels. More... | |
enum | plot_obj_index { ANCHOR, AXISWIDTH, BLACK, BLUE, CREATE, E, FILL, GREEN, LINE, N, RED, TEXT, TEXTOPT, WIDTH, max_obj_index } |
Slots for constants. More... | |
enum | axis_line_template_index { AXL_PATHNAME, AXL_CREATE, AXL_LINE, AXL_X1, AXL_Y1, AXL_X2, AXL_Y2, AXL_WIDTH, AXL_OUTLINEWIDTH, max_axl_index } |
Template slots for a pre-parsed Tcl/Tk axis line command. More... | |
enum | bar_template_index { BAR_PATHNAME, BAR_CREATE, BAR_LINE, BAR_X1, BAR_Y1, BAR_X2, BAR_Y2, BAR_FILL, BAR_COLOR, max_bar_index } |
Template slots for a pre-parsed Tcl/Tk bar graph bar command. More... | |
enum | text_template_index { TXT_PATHNAME, TXT_CREATE, TXT_TEXT, TXT_X, TXT_Y, TXT_ANCHOR, TXT_ANCHORPOS, TXT_FILL, TXT_COLOR, TXT_TEXTOPT, TXT_STRING, max_text_index } |
Template slots for a pre-parsed Tcl/Tk text label command. More... | |
enum | y_preset_index { Y_TOP, Y_BASE, Y_MINOR, Y_MAJOR, Y_CAPTION, max_y_preset_index } |
Slots for pre-set y coordinates. More... | |
enum | x_preset_index { X_BASE, X_MAJOR, X_CAPTION, X_RIGHT, max_x_preset_index } |
Slots for pre-set x coordinates. More... | |
Functions | |
int | tclsadie_plotter (PIXEL *line, uint32_t nbnd, uint32_t npix, const char *minxlbl, const char *maxxlbl, int option, PIXEL gmin, PIXEL gmax, void *data) |
Declare the plotting callback (defined elsewhere) so we can register it. |
The SADIE library function PLOT can use a callback to invoke some arbitrary external plotting operation. Here we define one to meet the requirements of tclSadie: the drawing operations use Tk, and the resulting graphs appear directly within the tclSadie session log.
Definition in file tclSadie_plot.c.
|
Template slots for a pre-parsed Tcl/Tk axis line command.
Definition at line 72 of file tclSadie_plot.c. |
|
Template slots for a pre-parsed Tcl/Tk bar graph bar command.
Definition at line 87 of file tclSadie_plot.c. |
|
Array slots for axis labels.
Definition at line 55 of file tclSadie_plot.c. |
|
Slots for constants.
Definition at line 65 of file tclSadie_plot.c. |
|
Constants for positioning parts of the plotted bar graphs.
Definition at line 38 of file tclSadie_plot.c. |
|
Template slots for a pre-parsed Tcl/Tk text label command.
Definition at line 102 of file tclSadie_plot.c. |
|
Slots for pre-set x coordinates.
Definition at line 130 of file tclSadie_plot.c. |
|
Slots for pre-set y coordinates.
Definition at line 119 of file tclSadie_plot.c. |
|
Declare the plotting callback (defined elsewhere) so we can register it.
Because SADIE knows nothing of the Tcl/Tk specifics of tclSadie's session log (notably the Tk canvas it uses and the current vertical position within this), we first recover the relevant details from the private application-specific data. Then for each band in the image we plot a bar graph, arranging them horizontally within the session log (for large hyperspectral images this may be unwieldy). The first three bands of a multi-band image get plotted in red, green and blue respectively: everything else in black. The bar lengths are scaled according to the option code, one of the values defined in
Definition at line 702 of file tclSadie_plot.c. References BAR_COLOR, DEFAULT_SESSION_LOG_POS_INDEX, GetSadieUintFromObj2(), Tclsadie_app_data::log_refresh, Tclsadie_app_data::main_interp, Line_value_range::max, max_axl_index, max_bar_index, max_label_index, max_text_index, max_x_preset_index, max_y_preset_index, Line_value_range::min, RIGHT_MARGIN, Tclsadie_app_data::sadievar, Tclsadie_app_data::sessionlog_canvas, and TOP_MARGIN. Referenced by tclsadie_app_init(). |