Angka  0.0.1
A C library focusing on data manipulation and visualization
visual.h
Go to the documentation of this file.
1 
8 #ifndef __VISUAL_H
9 #define __VISUAL_H
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
18 #define VRGB 255
19 
24 
28 typedef struct s_color {
29  int r;
30  int g;
31  int b;
32  double a;
33  double val;
34  int size;
35 } AgxColor;
36 
37 
41 typedef struct s_plot_data {
44 } AgxPlotData;
45 
49 typedef struct s_coord_double {
50  double x;
51  double y;
53 
57 typedef struct s_coord_int {
58  int x;
59  int y;
60 } AgxCoordInt;
61 
65 typedef struct s_canvas {
66  int *p_r_type;
68  int *p_r_radius;
69  int row;
70  int col;
71  int index;
72  int grid;
81  int numOfVec;
82 } AgvCanvas;
83 
87 typedef struct s_figure {
88  int row;
89  int col;
90  int size;
92 } AgvFigure;
93 
97 void agv_color_pallete_set(AgxColor *clr, int index, int r, int g, int b, double a, double val);
98 
104 AgvFigure *agv_figure_new(int row, int col);
105 
109 void agv_figure_delete(AgvFigure **fig);
110 
115 AgvFigure *agv_subplots(int row, int col);
116 
122 AgvCanvas *agv_set_canvas(AgvFigure *fig, int index);
123 
127 void agv_plot(AgvCanvas *can, AgxVector *vecx, AgxVector *vecy);
128 
132 void agv_scatter(AgvCanvas *can, AgxVector *vecx, AgxVector *vecy);
133 
137 void agv_imshow(AgvCanvas *can, AgxMatrix *mat);
138 
144 
148 void agv_xlim(AgvCanvas *can, double min, double max);
149 
153 void agv_ylim(AgvCanvas *can, double min, double max);
154 
159 int agv_show(AgvFigure *fig);
160 
164 void agv_set_color_alpha(AgvCanvas *can, int line, int red, int green, int blue, double alpha);
165 
169 void agv_set_color_alpha_line(AgvCanvas *can, int line, int red, int green, int blue, double alpha);
170 
174 void agv_set_radius(AgvCanvas *can, int line, int radius);
175 
179 void agv_set_linewidth(AgvCanvas *can, int line, int linewidth);
180 
184 void agv_set_grid(AgvCanvas *can, int boolean);
185 
186 #ifdef __cplusplus
187 }
188 #endif
189 
190 #endif
AgxColor * p_r_color
Definition: visual.h:78
enum e_canvas_type AgvCanvasType
canvas numbering for visualization
AgxVector ** p_r_vecy
Definition: visual.h:76
Definition: visual.h:23
void agv_imshow(AgvCanvas *can, AgxMatrix *mat)
imaging the matrix data
int col
Definition: visual.h:70
color struct
Definition: picture.h:15
AgxCoordDouble min
Definition: visual.h:73
int agv_show(AgvFigure *fig)
construct the figure and show it
Definition: visual.h:23
AgxColor * agv_color_pallete_canvas_set_size(AgvCanvas *can, int line, int size)
set the size of color pallete from the existing canvas
Definition: visual.h:23
int row
Definition: visual.h:69
int size
Definition: visual.h:34
void agv_set_color_alpha_line(AgvCanvas *can, int line, int red, int green, int blue, double alpha)
set the color of the boundary of scattering sircle and image
void agv_xlim(AgvCanvas *can, double min, double max)
x limit values of the canvas
int * p_r_type
Definition: visual.h:66
int * p_r_radius
Definition: visual.h:68
Definition: visual.h:23
e_canvas_type
canvas numbering for visualization
Definition: visual.h:23
void agv_plot(AgvCanvas *can, AgxVector *vecx, AgxVector *vecy)
plotting the data on a line
void agv_color_pallete_set(AgxColor *clr, int index, int r, int g, int b, double a, double val)
setting the color pallete of imshow canvas
struct s_plot_data AgxPlotData
plot data struct
int y
Definition: visual.h:59
figure struct
Definition: visual.h:87
AgxVector * vecx
Definition: visual.h:42
int col
Definition: visual.h:89
double r
Definition: picture.h:16
AgxVector ** p_r_vecx
Definition: visual.h:75
void agv_ylim(AgvCanvas *can, double min, double max)
y limit values of the canvas
AgvCanvas * agv_set_canvas(AgvFigure *fig, int index)
select a canvas from the existing figure
AgvFigure * agv_subplots(int row, int col)
Create a figure with subplots definition.
int size
Definition: visual.h:90
int row
Definition: visual.h:88
int r
Definition: visual.h:29
plot data struct
Definition: visual.h:41
AgvCanvas * p_r_canvas
Definition: visual.h:91
creating vector data type in this library
Definition: vector.h:27
int grid
Definition: visual.h:72
int x
Definition: visual.h:58
int numOfVec
Definition: visual.h:81
AgxVector * vecy
Definition: visual.h:43
creating matrix data type in this library
Definition: matrix.h:27
void agv_figure_delete(AgvFigure **fig)
delete a figure
AgxMatrix ** p_r_mat
Definition: visual.h:77
canvas struct
Definition: visual.h:65
double a
Definition: picture.h:19
AgxColor * p_r_color_outside
Definition: visual.h:79
coordinate struct (double)
Definition: visual.h:49
AgxCoordDouble max
Definition: visual.h:74
double y
Definition: visual.h:51
struct s_canvas AgvCanvas
canvas struct
void agv_scatter(AgvCanvas *can, AgxVector *vecx, AgxVector *vecy)
plotting the data on some scattering bullets
double val
Definition: visual.h:33
double b
Definition: picture.h:18
AgxColor ** p_r_color_pallete
Definition: visual.h:80
struct s_figure AgvFigure
figure struct
double g
Definition: picture.h:17
coordinate struct (integer)
Definition: visual.h:57
AgvFigure * agv_figure_new(int row, int col)
create a new figure struct (should use agv_subplots instead)
int b
Definition: visual.h:31
void agv_set_grid(AgvCanvas *can, int boolean)
true if showing grid, default is false
void agv_set_linewidth(AgvCanvas *can, int line, int linewidth)
set the thick of line, the boundary of image and scattering circle
struct s_color AgxColor
color struct
int g
Definition: visual.h:30
double x
Definition: visual.h:50
struct s_coord_int AgxCoordInt
coordinate struct (integer)
struct s_coord_double AgxCoordDouble
coordinate struct (double)
int index
Definition: visual.h:71
void agv_set_radius(AgvCanvas *can, int line, int radius)
set the radius of scattering circle
void agv_set_color_alpha(AgvCanvas *can, int line, int red, int green, int blue, double alpha)
set the color of plotting and scattering, and image (the color fill)
int * p_r_linewidth
Definition: visual.h:67