tioga 1.6 → 1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/Tioga_README +35 -10
  2. data/split/Dvector/dvector.c +264 -22
  3. data/split/Dvector/lib/Dvector_extras.rb +30 -2
  4. data/split/Flate/extconf.rb +1 -1
  5. data/split/Function/function.c +112 -2
  6. data/split/Tioga/figures.c +76 -77
  7. data/split/Tioga/figures.h +375 -490
  8. data/split/Tioga/generic.c +254 -0
  9. data/split/Tioga/generic.h +236 -0
  10. data/split/Tioga/init.c +434 -320
  11. data/split/Tioga/lib/Creating_Paths.rb +11 -1
  12. data/split/Tioga/lib/FigMkr.rb +263 -65
  13. data/split/Tioga/lib/Legends.rb +4 -2
  14. data/split/Tioga/lib/Markers.rb +3 -2
  15. data/split/Tioga/lib/Special_Paths.rb +22 -23
  16. data/split/Tioga/lib/TeX_Text.rb +79 -1
  17. data/split/Tioga/lib/TexPreamble.rb +14 -0
  18. data/split/Tioga/lib/Utils.rb +5 -1
  19. data/split/Tioga/pdfs.h +7 -45
  20. data/split/Tioga/{axes.c → shared/axes.c} +210 -197
  21. data/split/Tioga/{makers.c → shared/makers.c} +442 -211
  22. data/split/Tioga/{pdf_font_dicts.c → shared/pdf_font_dicts.c} +0 -0
  23. data/split/Tioga/shared/pdfcolor.c +628 -0
  24. data/split/Tioga/shared/pdfcoords.c +443 -0
  25. data/split/Tioga/{pdffile.c → shared/pdffile.c} +56 -52
  26. data/split/Tioga/{pdfimage.c → shared/pdfimage.c} +103 -211
  27. data/split/Tioga/shared/pdfpath.c +766 -0
  28. data/split/Tioga/{pdftext.c → shared/pdftext.c} +121 -99
  29. data/split/Tioga/shared/texout.c +524 -0
  30. data/split/Tioga/wrappers.c +489 -0
  31. data/split/Tioga/wrappers.h +259 -0
  32. data/split/extconf.rb +4 -0
  33. data/split/mkmf2.rb +12 -1
  34. data/tests/benchmark_dvector_reads.rb +112 -0
  35. data/tests/tc_Dvector.rb +35 -3
  36. data/tests/tc_Function.rb +32 -0
  37. metadata +65 -52
  38. data/split/Tioga/pdfcolor.c +0 -486
  39. data/split/Tioga/pdfcoords.c +0 -523
  40. data/split/Tioga/pdfpath.c +0 -913
  41. data/split/Tioga/texout.c +0 -380
@@ -23,14 +23,11 @@
23
23
  #define __figures_H__
24
24
 
25
25
  #include <namespace.h>
26
-
27
26
  #include <math.h>
28
27
  #include <stdbool.h>
29
28
  #include <ctype.h>
30
- #include "dvector.h"
31
- #include "dtable.h"
32
- #include "ruby.h"
33
- #include "intern.h"
29
+
30
+ #include "generic.h"
34
31
 
35
32
  #include <defs.h>
36
33
 
@@ -114,9 +111,9 @@ typedef struct {
114
111
  bool root_figure;
115
112
  bool in_subplot;
116
113
  double page_left, page_bottom, page_top, page_right, page_width, page_height;
117
- // in output units. READ ONLY from Ruby.
114
+ // in output units. READ ONLY.
118
115
 
119
- /* frame and bounds attributes. READ ONLY from Ruby. */
116
+ /* frame and bounds attributes. READ ONLY. */
120
117
  // frame location as fractions of page width & height.
121
118
  double frame_left, frame_right, frame_top, frame_bottom, frame_width, frame_height;
122
119
  // bounds in figure coords.
@@ -131,8 +128,8 @@ typedef struct {
131
128
 
132
129
  double default_font_size; // in points
133
130
  double default_text_scale;
134
- double default_text_height_dx; // in figure coords. READ ONLY from Ruby. set when change default_text_scale.
135
- double default_text_height_dy; // in figure coords. READ ONLY from Ruby. set when change default_text_scale.
131
+ double default_text_height_dx; // in figure coords. READ ONLY. set when change default_text_scale.
132
+ double default_text_height_dy; // in figure coords. READ ONLY. set when change default_text_scale.
136
133
 
137
134
  double label_left_margin; // as fraction of frame width
138
135
  double label_right_margin; // as fraction of frame width
@@ -149,8 +146,12 @@ typedef struct {
149
146
  /* graphics attributes */
150
147
 
151
148
  /* color attributes */
152
- VALUE stroke_color; // [r, g, b]
153
- VALUE fill_color; // [r, g, b]
149
+ double stroke_color_R;
150
+ double stroke_color_G;
151
+ double stroke_color_B;
152
+ double fill_color_R;
153
+ double fill_color_G;
154
+ double fill_color_B;
154
155
 
155
156
  /* stroke attributes */
156
157
  double default_line_scale; // multipler for line_width
@@ -158,50 +159,52 @@ typedef struct {
158
159
  int line_cap;
159
160
  int line_join;
160
161
  double miter_limit;
161
- VALUE line_type; // [ dashArray dashPhase ] in points
162
162
 
163
163
  /* transparency */
164
164
  double stroke_opacity;
165
165
  double fill_opacity;
166
166
 
167
167
  /* Title */
168
- VALUE title; // text
169
168
  bool title_visible;
170
169
  int title_side;
171
170
  double title_position;
172
171
 
173
172
  double title_scale;
174
- double title_shift; // in char heights, positive for out from edge (or toward larger x or y value)
173
+ double title_shift; // in char heights, positive for out from edge (or toward larger x or y OBJ_PTR)
175
174
  double title_angle;
176
175
  int title_alignment;
177
176
  int title_justification;
178
- VALUE title_color;
177
+ double title_color_R;
178
+ double title_color_G;
179
+ double title_color_B;
179
180
 
180
181
  /* X label */
181
- VALUE xlabel; // text
182
182
  bool xlabel_visible;
183
183
  double xlabel_position; // xlabel side is given by xaxis_loc
184
184
 
185
185
  double xlabel_scale;
186
- double xlabel_shift; // in char heights, positive for out from edge (or toward larger x or y value)
186
+ double xlabel_shift; // in char heights, positive for out from edge (or toward larger x or y OBJ_PTR)
187
187
  double xlabel_angle;
188
188
  int xlabel_side;
189
189
  int xlabel_alignment;
190
190
  int xlabel_justification;
191
- VALUE xlabel_color;
191
+ double xlabel_color_R;
192
+ double xlabel_color_G;
193
+ double xlabel_color_B;
192
194
 
193
195
  /* Y label */
194
- VALUE ylabel; // text
195
196
  bool ylabel_visible;
196
197
  double ylabel_position; // ylabel side is given by yaxis_loc
197
198
 
198
199
  double ylabel_scale;
199
- double ylabel_shift; // in char heights, positive for out from edge (or toward larger x or y value)
200
+ double ylabel_shift; // in char heights, positive for out from edge (or toward larger x or y OBJ_PTR)
200
201
  double ylabel_angle;
201
202
  int ylabel_side;
202
203
  int ylabel_alignment;
203
204
  int ylabel_justification;
204
- VALUE ylabel_color;
205
+ double ylabel_color_R;
206
+ double ylabel_color_G;
207
+ double ylabel_color_B;
205
208
 
206
209
  /* X axis */
207
210
  bool xaxis_visible;
@@ -209,27 +212,26 @@ typedef struct {
209
212
  int xaxis_loc;
210
213
  // line
211
214
  double xaxis_line_width; // for axis line
212
- VALUE xaxis_stroke_color; // for axis line and tick marks
215
+ double xaxis_stroke_color_R; // for axis line and tick marks
216
+ double xaxis_stroke_color_G;
217
+ double xaxis_stroke_color_B;
213
218
  // tick marks
214
219
  double xaxis_major_tick_width; // same units as line_width
215
220
  double xaxis_minor_tick_width; // same units as line_width
216
221
  double xaxis_major_tick_length; // in units of numeric label char heights
217
222
  double xaxis_minor_tick_length; // in units of numeric label char heights
218
223
  bool xaxis_log_values;
219
- bool xaxis_ticks_inside; // inside frame or toward larger x or y value for specific location
220
- bool xaxis_ticks_outside; // inside frame or toward smaller x or y value for specific location
224
+ bool xaxis_ticks_inside; // inside frame or toward larger x or y OBJ_PTR for specific location
225
+ bool xaxis_ticks_outside; // inside frame or toward smaller x or y OBJ_PTR for specific location
221
226
  double xaxis_tick_interval; // set to 0 to use default
222
227
  double xaxis_min_between_major_ticks; // in units of numeric label char heights
223
228
  int xaxis_number_of_minor_intervals; // set to 0 to use default
224
- VALUE xaxis_locations_for_major_ticks; // set to nil to use defaults
225
- VALUE xaxis_locations_for_minor_ticks; // set to nil to use defaults
226
229
  // numeric labels on major ticks
227
230
  bool xaxis_use_fixed_pt;
228
231
  int xaxis_digits_max;
229
- VALUE xaxis_tick_labels; // set to nil to use defaults. else must have a label for each major tick
230
232
  int xaxis_numeric_label_decimal_digits; // set to negative to use default
231
233
  double xaxis_numeric_label_scale;
232
- double xaxis_numeric_label_shift; // in char heights, positive for out from edge (or toward larger x or y value)
234
+ double xaxis_numeric_label_shift; // in char heights, positive for out from edge (or toward larger x or y OBJ_PTR)
233
235
  double xaxis_numeric_label_angle;
234
236
  int xaxis_numeric_label_alignment;
235
237
  int xaxis_numeric_label_justification;
@@ -248,27 +250,26 @@ typedef struct {
248
250
  int yaxis_loc;
249
251
  // line
250
252
  double yaxis_line_width; // for axis line
251
- VALUE yaxis_stroke_color; // for axis line and tick marks
253
+ double yaxis_stroke_color_R; // for axis line and tick marks
254
+ double yaxis_stroke_color_G;
255
+ double yaxis_stroke_color_B;
252
256
  // tick marks
253
257
  double yaxis_major_tick_width; // same units as line_width
254
258
  double yaxis_minor_tick_width; // same units as line_width
255
259
  double yaxis_major_tick_length; // in units of numeric label char heights
256
260
  double yaxis_minor_tick_length; // in units of numeric label char heights
257
261
  bool yaxis_log_values;
258
- bool yaxis_ticks_inside; // inside frame or toward larger x or y value for specific location
259
- bool yaxis_ticks_outside; // inside frame or toward smaller x or y value for specific location
262
+ bool yaxis_ticks_inside; // inside frame or toward larger x or y OBJ_PTR for specific location
263
+ bool yaxis_ticks_outside; // inside frame or toward smaller x or y OBJ_PTR for specific location
260
264
  double yaxis_tick_interval; // set to 0 to use default
261
265
  double yaxis_min_between_major_ticks; // in units of numeric label char heights
262
266
  int yaxis_number_of_minor_intervals; // set to 0 to use default
263
- VALUE yaxis_locations_for_major_ticks; // set to nil to use defaults
264
- VALUE yaxis_locations_for_minor_ticks; // set to nil to use defaults
265
267
  // numeric labels on major ticks
266
268
  bool yaxis_use_fixed_pt;
267
269
  int yaxis_digits_max;
268
- VALUE yaxis_tick_labels; // set to nil to use defaults. else must have a label for each major tick
269
270
  int yaxis_numeric_label_decimal_digits; // set to negative to use default
270
271
  double yaxis_numeric_label_scale;
271
- double yaxis_numeric_label_shift; // in char heights, positive for out from edge (or toward larger x or y value)
272
+ double yaxis_numeric_label_shift; // in char heights, positive for out from edge (or toward larger x or y OBJ_PTR)
272
273
  double yaxis_numeric_label_angle;
273
274
  int yaxis_numeric_label_alignment;
274
275
  int yaxis_numeric_label_justification;
@@ -300,77 +301,370 @@ typedef struct {
300
301
 
301
302
  /* Whether to complain about out non ok numbers in paths */
302
303
  int croak_on_nonok_numbers;
303
-
304
- /* PRIVATE -- not to be included in the Ruby interface */
304
+
305
+ /* PRIVATE -- not to be included in the user interface */
305
306
  double clip_left, clip_right, clip_top, clip_bottom; // in output coords
306
- VALUE fm;
307
307
  } FM;
308
308
 
309
309
  typedef FM Figure_Maker;
310
310
 
311
- extern VALUE cFM; /* class object for FigureMaker */
311
+ extern double bbox_llx, bbox_lly, bbox_urx, bbox_ury;
312
+
312
313
  extern char *data_dir;
313
314
 
314
- extern FM *Get_FM(VALUE fmkr);
315
- extern bool Is_FM(VALUE fmkr);
316
315
 
317
- #define SAVE_STATE FM saved = *p;
318
- #define RESTORE_STATE *p = saved;
316
+ // all routines set *ierr nonzero in case of error.
317
+ // if call a routine that gets ierr as arg, check ierr when it returns.
318
+ // cleanup and return if find ierr != 0.
319
+ // *ierr is set to 0 by wrapper routines before 1st call to "c_" routines.
320
+
319
321
 
320
322
  /*======================================================================*/
323
+ // axes.c
324
+ extern char *Get_String(OBJ_PTR ary, int index, int *ierr);
325
+
326
+ extern void c_show_axis(OBJ_PTR fmkr, FM *p, int location, int *ierr);
327
+ extern void c_show_edge(OBJ_PTR fmkr, FM *p, int location, int *ierr);
328
+ extern void c_no_title(OBJ_PTR fmkr, FM *p, int *ierr);
329
+ extern void c_no_xlabel(OBJ_PTR fmkr, FM *p, int *ierr);
330
+ extern void c_no_ylabel(OBJ_PTR fmkr, FM *p, int *ierr);
331
+ extern void c_no_xaxis(OBJ_PTR fmkr, FM *p, int *ierr);
332
+ extern void c_no_yaxis(OBJ_PTR fmkr, FM *p, int *ierr);
333
+ extern void c_no_left_edge(OBJ_PTR fmkr, FM *p, int *ierr);
334
+ extern void c_no_right_edge(OBJ_PTR fmkr, FM *p, int *ierr);
335
+ extern void c_no_top_edge(OBJ_PTR fmkr, FM *p, int *ierr);
336
+ extern void c_no_bottom_edge(OBJ_PTR fmkr, FM *p, int *ierr);
321
337
 
322
- extern VALUE FM_set_device_pagesize(VALUE fmkr, VALUE width, VALUE height); // size in output coords (decipoints)
323
- extern VALUE FM_set_frame_sides(VALUE fmkr, VALUE left, VALUE right, VALUE top, VALUE bottom); // in page coords [0..1]
338
+ /*======================================================================*/
339
+ // figures.c
340
+ extern FM *Get_FM(OBJ_PTR fmkr, int *ierr);
341
+ void Init_FigureMaker(void);
342
+ extern bool Get_initialized(void);
343
+ extern void Set_initialized(void);
324
344
 
325
- extern VALUE FM_doing_subplot(VALUE fmkr);
326
- extern VALUE FM_doing_subfigure(VALUE fmkr);
345
+ /*======================================================================*/
346
+ // init.c
347
+ extern void Init_IDs(void);
348
+ extern OBJ_PTR Get_fm_data_attr(OBJ_PTR fmkr, int *ierr);
349
+ extern void Initialize_Figure(OBJ_PTR fmkr);
350
+ extern void do_cmd(OBJ_PTR fmkr, OBJ_PTR cmd, int *ierr);
351
+ extern bool Get_bool(OBJ_PTR obj, ID_PTR name_ID, int *ierr);
352
+ extern int Get_int(OBJ_PTR obj, ID_PTR name_ID, int *ierr);
353
+ extern double Get_double(OBJ_PTR obj, ID_PTR name_ID, int *ierr);
354
+ extern char *Get_tex_preview_paper_width(OBJ_PTR fmkr, int *ierr);
355
+ extern char *Get_tex_preview_paper_height(OBJ_PTR fmkr, int *ierr);
356
+ extern char *Get_tex_preview_hoffset(OBJ_PTR fmkr, int *ierr);
357
+ extern char *Get_tex_preview_voffset(OBJ_PTR fmkr, int *ierr);
358
+ extern char *Get_tex_preview_figure_width(OBJ_PTR fmkr, int *ierr);
359
+ extern char *Get_tex_preview_figure_height(OBJ_PTR fmkr, int *ierr);
360
+ extern char *Get_tex_fontsize(OBJ_PTR fmkr, int *ierr);
361
+ extern char *Get_tex_fontfamily(OBJ_PTR fmkr, int *ierr);
362
+ extern char *Get_tex_fontseries(OBJ_PTR fmkr, int *ierr);
363
+ extern char *Get_tex_fontshape(OBJ_PTR fmkr, int *ierr);
364
+ extern char *Get_tex_preview_minwhitespace(OBJ_PTR fmkr, int *ierr);
365
+ extern bool Get_tex_preview_fullpage(OBJ_PTR fmkr, int *ierr);
366
+ extern char *Get_tex_preview_tiogafigure_command(OBJ_PTR fmkr, int *ierr);
367
+ extern char *Get_tex_preview_generated_preamble(OBJ_PTR fmkr, int *ierr);
368
+ extern double Get_tex_xoffset(OBJ_PTR fmkr, int *ierr);
369
+ extern double Get_tex_yoffset(OBJ_PTR fmkr, int *ierr);
370
+ extern char *Get_tex_preview_documentclass(OBJ_PTR fmkr, int *ierr);
371
+ extern char *Get_tex_preamble(OBJ_PTR fmkr, int *ierr);
372
+ extern char *Get_xaxis_numeric_label_tex(OBJ_PTR fmkr, int *ierr);
373
+ extern char *Get_yaxis_numeric_label_tex(OBJ_PTR fmkr, int *ierr);
374
+ extern char *Get_tex_preview_pagestyle(OBJ_PTR fmkr, int *ierr);
375
+ extern char *Get_tex_preview_tiogafigure_command(OBJ_PTR fmkr, int *ierr);
376
+ extern OBJ_PTR Get_line_type(OBJ_PTR fmkr, int *ierr);
377
+ extern void Set_line_type(OBJ_PTR fmkr, OBJ_PTR v, int *ierr);
378
+ extern OBJ_PTR Get_xaxis_tick_labels(OBJ_PTR fmkr, int *ierr);
379
+ extern OBJ_PTR Get_xaxis_locations_for_major_ticks(OBJ_PTR fmkr, int *ierr);
380
+ extern OBJ_PTR Get_xaxis_locations_for_minor_ticks(OBJ_PTR fmkr, int *ierr);
381
+ extern OBJ_PTR Get_yaxis_tick_labels(OBJ_PTR fmkr, int *ierr);
382
+ extern OBJ_PTR Get_yaxis_locations_for_major_ticks(OBJ_PTR fmkr, int *ierr);
383
+ extern OBJ_PTR Get_yaxis_locations_for_minor_ticks(OBJ_PTR fmkr, int *ierr);
384
+
385
+ extern void c_private_init_fm_data(OBJ_PTR fmkr, FM *p, int *ierr);
386
+ extern void c_set_frame_sides(OBJ_PTR fmkr, FM *p,
387
+ double left, double right, double top, double bottom, int *ierr);
388
+ extern void c_set_device_pagesize(OBJ_PTR fmkr, FM *p, double width, double height, int *ierr);
389
+ extern OBJ_PTR c_get_save_filename(OBJ_PTR fmkr, FM *p, OBJ_PTR name, int *ierr);
390
+ extern void c_private_make(OBJ_PTR fmkr, FM *p, OBJ_PTR name, OBJ_PTR cmd, int *ierr);
391
+ extern OBJ_PTR c_private_make_portfolio(OBJ_PTR fmkr, FM *p, OBJ_PTR name, OBJ_PTR fignums, OBJ_PTR fignames, int *ierr);
392
+
393
+ /* The ID of the measures_info instance variable */
394
+ extern ID_PTR measures_info_ID;
327
395
 
328
- extern VALUE FM_no_title(VALUE fmkr);
329
- extern VALUE FM_no_xlabel(VALUE fmkr);
330
- extern VALUE FM_no_ylabel(VALUE fmkr);
331
- extern VALUE FM_no_xaxis(VALUE fmkr);
332
- extern VALUE FM_no_yaxis(VALUE fmkr);
333
- extern VALUE FM_no_left_edge(VALUE fmkr);
334
- extern VALUE FM_no_right_edge(VALUE fmkr);
335
- extern VALUE FM_no_top_edge(VALUE fmkr);
336
- extern VALUE FM_no_bottom_edge(VALUE fmkr);
396
+ /*======================================================================*/
397
+ // makers.c
398
+ extern OBJ_PTR c_private_make_contour(OBJ_PTR fmkr, FM *p,
399
+ OBJ_PTR gaps, // these vectors get the results
400
+ OBJ_PTR xs, OBJ_PTR ys, // data x coordinates and y coordinates
401
+ OBJ_PTR zs, double z_level, // the table of values and the desired contour level
402
+ OBJ_PTR legit, // the table of flags (nonzero means okay)
403
+ int method, // method == 1 means CONREC
404
+ int *ierr);
405
+ extern OBJ_PTR c_private_make_steps(OBJ_PTR fmkr, FM *p, OBJ_PTR Xvec_data, OBJ_PTR Yvec_data,
406
+ double xfirst, double yfirst, double xlast, double ylast, int justification, int *ierr);
407
+ /* adds n_pts_to_add points to Xs and Ys for steps with the given parameters.
408
+ X_data and Y_data are arrays of n values where n_pts_to_add = 2*(n+1)
409
+ (xfirst,yfirst) and (xlast,ylast) are extra data points to fix the first and last steps.
410
+ The X_data plus xfirst and xlast determine the widths of the steps.
411
+ The Y_data plus yfirst and ylast determine the height of the steps.
412
+ The steps occur at locations midway between the given x locations. */
413
+ extern OBJ_PTR c_private_make_spline_interpolated_points(OBJ_PTR fmkr, FM *p,
414
+ OBJ_PTR Xvec, OBJ_PTR Xvec_data, OBJ_PTR Yvec_data,
415
+ OBJ_PTR start_slope, OBJ_PTR end_slope, int *ierr);
337
416
 
338
- extern VALUE FM_private_set_default_font_size(VALUE fmkr, VALUE size); // size in points
417
+ /*======================================================================*/
418
+ // pdfcolor.c
419
+ extern void Free_Functions(void);
420
+ extern void Write_Functions(int *ierr);
421
+ extern void Free_Stroke_Opacities(void);
422
+ extern void Free_Fill_Opacities(void);
423
+ extern void Write_Stroke_Opacity_Objects(void);
424
+ extern void Write_Fill_Opacity_Objects(void);
425
+ extern void Free_Shadings(void);
426
+ extern void Write_Shadings(void);
427
+
428
+ extern void c_stroke_opacity_set(OBJ_PTR fmkr, FM *p, double stroke_opacity, int *ierr);
429
+ extern void c_fill_opacity_set(OBJ_PTR fmkr, FM *p, double fill_opacity, int *ierr);
430
+ extern void c_private_axial_shading(OBJ_PTR fmkr, FM *p,
431
+ double x0, double y0, double x1, double y1,
432
+ OBJ_PTR colormap, bool extend_start, bool extend_end, int *ierr);
433
+ extern void c_private_radial_shading(OBJ_PTR fmkr, FM *p,
434
+ double x0, double y0, double r0,
435
+ double x1, double y1, double r1, OBJ_PTR colormap,
436
+ double a, double b, double c, double d, bool extend_start, bool extend_end, int *ierr);
437
+ extern OBJ_PTR c_private_create_colormap(OBJ_PTR fmkr, FM *p,
438
+ bool rgb, int length, OBJ_PTR Ps, OBJ_PTR C1s, OBJ_PTR C2s, OBJ_PTR C3s, int *ierr);
439
+ extern OBJ_PTR c_get_color_from_colormap(OBJ_PTR fmkr, FM *p, OBJ_PTR color_map, double x, int *ierr);
440
+ extern OBJ_PTR c_convert_to_colormap(OBJ_PTR fmkr, FM* p, OBJ_PTR Rs, OBJ_PTR Gs, OBJ_PTR Bs, int *ierr);
441
+ extern OBJ_PTR c_hls_to_rgb(OBJ_PTR fmkr, FM *p, OBJ_PTR hls_vec, int *ierr);
442
+ extern OBJ_PTR c_rgb_to_hls(OBJ_PTR fmkr, FM *p, OBJ_PTR rgb_vecc_hls_to_rgb, int *ierr);
443
+ extern void c_title_color_set(OBJ_PTR fmkr, FM *p, OBJ_PTR valc_hls_to_rgb, int *ierr);
444
+ extern OBJ_PTR c_title_color_get(OBJ_PTR fmkr, FM *pc_hls_to_rgb, int *ierr); // value is array of [r, g, b] intensities from 0 to 1
445
+ extern void c_xlabel_color_set(OBJ_PTR fmkr, FM *p, OBJ_PTR valc_hls_to_rgb, int *ierr);
446
+ extern OBJ_PTR c_xlabel_color_get(OBJ_PTR fmkr, FM *pc_hls_to_rgb, int *ierr); // value is array of [r, g, b] intensities from 0 to 1
447
+ extern void c_ylabel_color_set(OBJ_PTR fmkr, FM *p, OBJ_PTR valc_hls_to_rgb, int *ierr);
448
+ extern OBJ_PTR c_ylabel_color_get(OBJ_PTR fmkr, FM *pc_hls_to_rgb, int *ierr); // value is array of [r, g, b] intensities from 0 to 1
449
+ extern void c_xaxis_stroke_color_set(OBJ_PTR fmkr, FM *p, OBJ_PTR valc_hls_to_rgb, int *ierr);
450
+ extern OBJ_PTR c_xaxis_stroke_color_get(OBJ_PTR fmkr, FM *pc_hls_to_rgb, int *ierr); // value is array of [r, g, b] intensities from 0 to 1
451
+ extern void c_yaxis_stroke_color_set(OBJ_PTR fmkr, FM *p, OBJ_PTR valc_hls_to_rgb, int *ierr);
452
+ extern OBJ_PTR c_yaxis_stroke_color_get(OBJ_PTR fmkr, FM *pc_hls_to_rgb, int *ierr); // value is array of [r, g, b] intensities from 0 to 1
339
453
 
454
+ /*======================================================================*/
455
+ // pdfcoords.c
456
+ extern void Recalc_Font_Hts(FM *p);
457
+ extern double convert_figure_to_output_x(FM *p, double x);
458
+ extern double convert_figure_to_output_y(FM *p, double y);
459
+ extern double convert_figure_to_output_dy(FM *p, double dy);
460
+ extern double convert_figure_to_output_dx(FM *p, double dx);
461
+ extern double convert_output_to_figure_x(FM *p, double x);
462
+ extern double convert_output_to_figure_y(FM *p, double y);
463
+ extern double convert_output_to_figure_dy(FM *p, double dy);
464
+ extern double convert_output_to_figure_dx(FM *p, double dx);
340
465
 
341
- /* Colors */
466
+ extern void c_set_subframe(OBJ_PTR fmkr, FM *p,
467
+ double left_margin, double right_margin, double top_margin, double bottom_margin, int *ierr);
468
+ extern void c_private_set_default_font_size(OBJ_PTR fmkr, FM *p, double size, int *ierr);
469
+ extern OBJ_PTR c_convert_to_degrees(OBJ_PTR fmkr, FM *p, double dx, double dy, int *ierr); // dx and dy in figure coords
470
+ extern OBJ_PTR c_convert_inches_to_output(OBJ_PTR fmkr, FM *p, double val, int *ierr);
471
+ extern OBJ_PTR c_convert_output_to_inches(OBJ_PTR fmkr, FM *p, double val, int *ierr);
472
+ extern OBJ_PTR c_convert_mm_to_output(OBJ_PTR fmkr, FM *p, double val, int *ierr);
473
+ extern OBJ_PTR c_convert_output_to_mm(OBJ_PTR fmkr, FM *p, double val, int *ierr);
474
+ extern OBJ_PTR c_convert_page_to_output_x(OBJ_PTR fmkr, FM *p, double val, int *ierr);
475
+ extern OBJ_PTR c_convert_page_to_output_y(OBJ_PTR fmkr, FM *p, double val, int *ierr);
476
+ extern OBJ_PTR c_convert_page_to_output_dx(OBJ_PTR fmkr, FM *p, double val, int *ierr);
477
+ extern OBJ_PTR c_convert_page_to_output_dy(OBJ_PTR fmkr, FM *p, double val, int *ierr);
478
+ extern OBJ_PTR c_convert_output_to_page_x(OBJ_PTR fmkr, FM *p, double val, int *ierr);
479
+ extern OBJ_PTR c_convert_output_to_page_y(OBJ_PTR fmkr, FM *p, double val, int *ierr);
480
+ extern OBJ_PTR c_convert_output_to_page_dx(OBJ_PTR fmkr, FM *p, double val, int *ierr);
481
+ extern OBJ_PTR c_convert_output_to_page_dy(OBJ_PTR fmkr, FM *p, double val, int *ierr);
482
+ extern OBJ_PTR c_convert_frame_to_page_x(OBJ_PTR fmkr, FM *p, double val, int *ierr);
483
+ extern OBJ_PTR c_convert_frame_to_page_y(OBJ_PTR fmkr, FM *p, double val, int *ierr);
484
+ extern OBJ_PTR c_convert_frame_to_page_dx(OBJ_PTR fmkr, FM *p, double val, int *ierr);
485
+ extern OBJ_PTR c_convert_frame_to_page_dy(OBJ_PTR fmkr, FM *p, double val, int *ierr);
486
+ extern OBJ_PTR c_convert_page_to_frame_x(OBJ_PTR fmkr, FM *p, double val, int *ierr);
487
+ extern OBJ_PTR c_convert_page_to_frame_y(OBJ_PTR fmkr, FM *p, double val, int *ierr);
488
+ extern OBJ_PTR c_convert_page_to_frame_dx(OBJ_PTR fmkr, FM *p, double val, int *ierr);
489
+ extern OBJ_PTR c_convert_page_to_frame_dy(OBJ_PTR fmkr, FM *p, double val, int *ierr);
490
+ extern OBJ_PTR c_convert_figure_to_frame_x(OBJ_PTR fmkr, FM *p, double val, int *ierr);
491
+ extern OBJ_PTR c_convert_figure_to_frame_y(OBJ_PTR fmkr, FM *p, double val, int *ierr);
492
+ extern OBJ_PTR c_convert_figure_to_frame_dx(OBJ_PTR fmkr, FM *p, double val, int *ierr);
493
+ extern OBJ_PTR c_convert_figure_to_frame_dy(OBJ_PTR fmkr, FM *p, double val, int *ierr);
494
+ extern OBJ_PTR c_convert_frame_to_figure_x(OBJ_PTR fmkr, FM *p, double val, int *ierr);
495
+ extern OBJ_PTR c_convert_frame_to_figure_y(OBJ_PTR fmkr, FM *p, double val, int *ierr);
496
+ extern OBJ_PTR c_convert_frame_to_figure_dx(OBJ_PTR fmkr, FM *p, double val, int *ierr);
497
+ extern OBJ_PTR c_convert_frame_to_figure_dy(OBJ_PTR fmkr, FM *p, double val, int *ierr);
498
+ extern OBJ_PTR c_convert_figure_to_output_x(OBJ_PTR fmkr, FM *p, double val, int *ierr);
499
+ extern OBJ_PTR c_convert_figure_to_output_y(OBJ_PTR fmkr, FM *p, double val, int *ierr);
500
+ extern OBJ_PTR c_convert_figure_to_output_dx(OBJ_PTR fmkr, FM *p, double val, int *ierr);
501
+ extern OBJ_PTR c_convert_figure_to_output_dy(OBJ_PTR fmkr, FM *p, double val, int *ierr);
502
+ extern OBJ_PTR c_convert_output_to_figure_x(OBJ_PTR fmkr, FM *p, double val, int *ierr);
503
+ extern OBJ_PTR c_convert_output_to_figure_y(OBJ_PTR fmkr, FM *p, double val, int *ierr);
504
+ extern OBJ_PTR c_convert_output_to_figure_dx(OBJ_PTR fmkr, FM *p, double val, int *ierr);
505
+ extern OBJ_PTR c_convert_output_to_figure_dy(OBJ_PTR fmkr, FM *p, double val, int *ierr);
506
+ extern void c_doing_subplot(OBJ_PTR fmkr, FM *p, int *ierr);
507
+ extern void c_doing_subfigure(OBJ_PTR fmkr, FM *p, int *ierr);
508
+ extern void c_private_set_bounds(OBJ_PTR fmkr, FM *p,
509
+ double left_boundary, double right_boundary, double top_boundary, double bottom_boundary, int *ierr);
342
510
 
343
- /* in addition to RGB, colors are also often specified in terms of (HUE,LIGHTNESS,SATURATION) */
344
- extern VALUE FM_hls_to_rgb(VALUE fmkr, VALUE hls_vec);
345
- extern VALUE FM_rgb_to_hls(VALUE fmkr, VALUE rgb_vec);
346
- /* hue is given as an angle from 0 to 360 around the color wheel.
347
- 0, 60, 120, 180, 240, and 300 are respectively red, yellow, green, cyan, blue, and magenta. */
348
- /* lightness and saturation are given as numbers from 0 to 1 */
349
- extern void c_hls_to_rgb(double h, double l, double s, double *p_r, double *p_g, double *p_b); // from plplot plctrl.c
350
- extern void c_rgb_to_hls(double r, double g, double b, double *p_h, double *p_l, double *p_s); // from plplot plctrl.c
351
-
352
511
  /*======================================================================*/
512
+ // pdffile.c
513
+ extern void Init_pdf(int *ierr);
514
+ extern void Open_pdf(OBJ_PTR fmkr, FM *p, char *filename, bool quiet_mode, int *ierr);
515
+ extern void Start_Axis_Standard_State(OBJ_PTR fmkr, FM *p, double r, double g, double b, double line_width, int *ierr);
516
+ extern void End_Axis_Standard_State(void);
517
+ extern void Write_gsave(void);
518
+ extern void Write_grestore(void);
519
+ extern void Close_pdf(OBJ_PTR fmkr, FM *p, bool quiet_mode, int *ierr);
520
+ extern void Rename_pdf(char *oldname, char *newname);
353
521
 
354
- /* Miscellaneous */
522
+ extern void c_pdf_gsave(OBJ_PTR fmkr, FM *p, int *ierr);
523
+ extern void c_pdf_grestore(OBJ_PTR fmkr, FM *p, int *ierr);
355
524
 
356
- extern void Init_pdf(void);
357
- extern void Open_pdf(VALUE fmkr, char *filename, bool quiet_mode);
358
- extern void Close_pdf(VALUE fmkr, bool quiet_mode);
359
- extern void Rename_pdf(char *oldname, char *newname);
525
+ /*======================================================================*/
526
+ // pdfimage.c
527
+ extern OBJ_PTR c_private_create_image_data(OBJ_PTR fmkr, FM *p, OBJ_PTR table,
528
+ int first_row, int last_row, int first_column, int last_column,
529
+ double min_val, double max_val, int max_code, int if_below_range, int if_above_range, int *ierr);
530
+ extern OBJ_PTR c_private_create_monochrome_image_data(OBJ_PTR fmkr, FM *p, OBJ_PTR table,
531
+ int first_row, int last_row, int first_column, int last_column,
532
+ double boundary, bool reversed, int *ierr);
533
+ extern void c_private_show_jpg(OBJ_PTR fmkr, FM *p, char *filename,
534
+ int width, int height, OBJ_PTR image_destination, int mask_obj_num, int *ierr);
535
+ extern OBJ_PTR c_private_show_image(OBJ_PTR fmkr, FM *p, int image_type, double llx, double lly, double lrx, double lry,
536
+ double ulx, double uly, bool interpolate, bool reversed, int w, int h, unsigned char* data, long len,
537
+ OBJ_PTR mask_min, OBJ_PTR mask_max, OBJ_PTR hival, OBJ_PTR lookup_data, int mask_obj_num, int *ierr);
360
538
 
361
- extern void Init_tex(void);
362
- extern void Open_tex(VALUE fmkr, char *filename, bool quiet_mode);
363
- extern void Close_tex(VALUE fmkr, bool quiet_mode);
364
- extern void Rename_tex(char *oldname, char *newname);
539
+ /*======================================================================*/
540
+ // pdfpath.c
541
+ extern void Unpack_RGB(OBJ_PTR rgb, double *rp, double *gp, double *bp, int *ierr);
542
+ extern void update_bbox(FM *p, double x, double y);
365
543
 
366
- extern void Create_wrapper(VALUE fmkr, char *filename, bool quiet_mode);
544
+ extern void c_stroke_color_set_RGB(OBJ_PTR fmkr, FM *p, double r, double g, double b, int *ierr);
545
+ extern void c_stroke_color_set(OBJ_PTR fmkr, FM *p, OBJ_PTR value, int *ierr);
546
+ extern OBJ_PTR c_stroke_color_get(OBJ_PTR fmkr, FM *p, int *ierr);
547
+ extern void c_fill_color_set_RGB(OBJ_PTR fmkr, FM *p, double r, double g, double b, int *ierr);
548
+ extern void c_fill_color_set(OBJ_PTR fmkr, FM *p, OBJ_PTR value, int *ierr);
549
+ extern OBJ_PTR c_fill_color_get(OBJ_PTR fmkr, FM *p, int *ierr);
550
+ extern void c_line_width_set(OBJ_PTR fmkr, FM *p, double line_width, int *ierr);
551
+ extern void c_rescale_lines(OBJ_PTR fmkr, FM *p, double scaling_factor, int *ierr);
552
+ extern void c_line_cap_set(OBJ_PTR fmkr, FM *p, int line_cap, int *ierr);
553
+ extern void c_line_join_set(OBJ_PTR fmkr, FM *p, int line_join, int *ierr);
554
+ extern void c_miter_limit_set(OBJ_PTR fmkr, FM *p, double miter_limit, int *ierr);
555
+ extern void c_line_type_set(OBJ_PTR fmkr, FM *p, OBJ_PTR line_type, int *ierr);
556
+ extern void c_update_bbox(OBJ_PTR fmkr, FM *p, double x, double y, int *ierr);
557
+ extern OBJ_PTR c_bbox_left(OBJ_PTR fmkr, FM *p, int *ierr);
558
+ extern OBJ_PTR c_bbox_right(OBJ_PTR fmkr, FM *p, int *ierr);
559
+ extern OBJ_PTR c_bbox_top(OBJ_PTR fmkr, FM *p, int *ierr);
560
+ extern OBJ_PTR c_bbox_bottom(OBJ_PTR fmkr, FM *p, int *ierr);
561
+ extern void c_move_to_point(OBJ_PTR fmkr, FM *p, double x, double y, int *ierr);
562
+ extern void c_moveto(OBJ_PTR fmkr, FM *p, double x, double y, int *ierr);
563
+ extern void c_append_point_to_path(OBJ_PTR fmkr, FM *p, double x, double y, int *ierr);
564
+ extern void c_lineto(OBJ_PTR fmkr, FM *p, double x, double y, int *ierr);
565
+ extern OBJ_PTR c_bezier_control_points(OBJ_PTR fmkr, FM *p,
566
+ double x0, double y0, double delta_x, double a, double b, double c, int *ierr);
567
+ extern void c_append_curve_to_path(OBJ_PTR fmkr, FM *p, double x1, double y1,
568
+ double x2, double y2, double x3, double y3, int *ierr);
569
+ extern void c_curveto(OBJ_PTR fmkr, FM *p,
570
+ double x1, double y1, double x2, double y2, double x3, double y3, int *ierr);
571
+ extern void c_close_path(OBJ_PTR fmkr, FM *p, int *ierr);
572
+ extern void c_append_arc_to_path(OBJ_PTR fmkr, FM *p,
573
+ double x_start, double y_start, double x_corner, double y_corner,
574
+ double x_end, double y_end, double dx, double dy, int *ierr);
575
+ extern void c_append_arc(OBJ_PTR fmkr, FM *p,
576
+ double x_start, double y_start, double x_corner, double y_corner,
577
+ double x_end, double y_end, double radius, int *ierr);
578
+ extern void c_append_rect_to_path(OBJ_PTR fmkr, FM *p, double x, double y, double width, double height, int *ierr);
579
+ extern void c_append_rect(OBJ_PTR fmkr, FM *p, double x, double y, double width, double height, int *ierr);
580
+ extern void c_append_rounded_rect_to_path(OBJ_PTR fmkr, FM *p,
581
+ double x, double y, double width, double height, double dx, double dy, int *ierr);
582
+ extern void c_append_rounded_rect(OBJ_PTR fmkr, FM *p,
583
+ double x, double y, double width, double height, double radius, int *ierr);
584
+ extern void c_append_oval_to_path(OBJ_PTR fmkr, FM *p, double x, double y, double dx, double dy, double angle, int *ierr);
585
+ extern void c_append_oval(OBJ_PTR fmkr, FM *p, double x, double y, double dx, double dy, double angle, int *ierr);
586
+ extern void c_append_circle_to_path(OBJ_PTR fmkr, FM *p, double x, double y, double dx, int *ierr);
587
+ extern void c_append_points_to_path(OBJ_PTR fmkr, FM *p, OBJ_PTR x_vec, OBJ_PTR y_vec, int *ierr);
588
+ extern void c_private_append_points_with_gaps_to_path(OBJ_PTR fmkr, FM *p,
589
+ OBJ_PTR x_vec, OBJ_PTR y_vec, OBJ_PTR gaps, bool do_close, int *ierr);
590
+ extern void c_stroke(OBJ_PTR fmkr, FM *p, int *ierr);
591
+ extern void c_close_and_stroke(OBJ_PTR fmkr, FM *p, int *ierr);
592
+ extern void c_fill(OBJ_PTR fmkr, FM *p, int *ierr);
593
+ extern void c_discard_path(OBJ_PTR fmkr, FM *p, int *ierr);
594
+ extern void c_eofill(OBJ_PTR fmkr, FM *p, int *ierr);
595
+ extern void c_fill_and_stroke(OBJ_PTR fmkr, FM *p, int *ierr);
596
+ extern void c_eofill_and_stroke(OBJ_PTR fmkr, FM *p, int *ierr);
597
+ extern void c_close_fill_and_stroke(OBJ_PTR fmkr, FM *p, int *ierr);
598
+ extern void c_close_eofill_and_stroke(OBJ_PTR fmkr, FM *p, int *ierr);
599
+ extern void c_clip(OBJ_PTR fmkr, FM *p, int *ierr);
600
+ extern void c_eoclip(OBJ_PTR fmkr, FM *p, int *ierr);
601
+ extern void c_fill_and_clip(OBJ_PTR fmkr, FM *p, int *ierr);
602
+ extern void c_stroke_and_clip(OBJ_PTR fmkr, FM *p, int *ierr);
603
+ extern void c_fill_stroke_and_clip(OBJ_PTR fmkr, FM *p, int *ierr);
604
+ extern void c_stroke_line(OBJ_PTR fmkr, FM *p, double x1, double y1, double x2, double y2, int *ierr);
605
+ extern void c_fill_rect(OBJ_PTR fmkr, FM *p, double x, double y, double width, double height, int *ierr);
606
+ extern void c_stroke_rect(OBJ_PTR fmkr, FM *p, double x, double y, double width, double height, int *ierr);
607
+ extern void c_fill_and_stroke_rect(OBJ_PTR fmkr, FM *p, double x, double y, double width, double height, int *ierr);
608
+ extern void c_clip_rect(OBJ_PTR fmkr, FM *p, double x, double y, double width, double height, int *ierr);
609
+ extern void c_clip_dev_rect(OBJ_PTR fmkr, FM *p, double x, double y, double width, double height, int *ierr);
610
+ extern void c_clip_oval(OBJ_PTR fmkr, FM *p, double x, double y, double dx, double dy, double angle, int *ierr);
611
+ extern void c_fill_oval(OBJ_PTR fmkr, FM *p, double x, double y, double dx, double dy, double angle, int *ierr);
612
+ extern void c_stroke_oval(OBJ_PTR fmkr, FM *p, double x, double y, double dx, double dy, double angle, int *ierr);
613
+ extern void c_fill_and_stroke_oval(OBJ_PTR fmkr, FM *p, double x, double y, double dx, double dy, double angle, int *ierr);
614
+ extern void c_clip_rounded_rect(OBJ_PTR fmkr, FM *p, double x, double y, double width, double height, double dx, double dy, int *ierr);
615
+ extern void c_fill_rounded_rect(OBJ_PTR fmkr, FM *p, double x, double y, double width, double height, double dx, double dy, int *ierr);
616
+ extern void c_stroke_rounded_rect(OBJ_PTR fmkr, FM *p,
617
+ double x, double y, double width, double height, double dx, double dy, int *ierr);
618
+ extern void c_fill_and_stroke_rounded_rect(OBJ_PTR fmkr, FM *p,
619
+ double x, double y, double width, double height, double dx, double dy, int *ierr);
620
+ extern void c_clip_circle(OBJ_PTR fmkr, FM *p, double x, double y, double dx, int *ierr);
621
+ extern void c_fill_circle(OBJ_PTR fmkr, FM *p, double x, double y, double dx, int *ierr);
622
+ extern void c_stroke_circle(OBJ_PTR fmkr, FM *p, double x, double y, double dx, int *ierr);
623
+ extern void c_fill_and_stroke_circle(OBJ_PTR fmkr, FM *p, double x, double y, double dx, int *ierr);
624
+ extern void c_append_frame(OBJ_PTR fmkr, FM *p, bool clip, int *ierr);
625
+ extern void c_append_frame_to_path(OBJ_PTR fmkr, FM *p, int *ierr);
626
+ extern void c_fill_frame(OBJ_PTR fmkr, FM *p, int *ierr);
627
+ extern void c_stroke_frame(OBJ_PTR fmkr, FM *p, int *ierr);
628
+ extern void c_fill_and_stroke_frame(OBJ_PTR fmkr, FM *p, int *ierr);
629
+ extern void c_clip_to_frame(OBJ_PTR fmkr, FM *p, int *ierr);
367
630
 
368
- extern void Recalc_Font_Hts(FM *p);
631
+ /*======================================================================*/
632
+ // pdftext.c
633
+ extern void Init_Font_Dictionary(void);
634
+ extern bool Used_Any_Fonts(void);
635
+ extern void Clear_Fonts_In_Use_Flags(void);
636
+ extern void Write_Font_Dictionaries(void);
637
+ extern void Write_Font_Descriptors(void);
638
+ extern void Write_Font_Widths(void);
639
+
640
+ extern OBJ_PTR c_register_font(OBJ_PTR fmkr, FM *p, char *font_name, int *ierr);
641
+ extern OBJ_PTR c_marker_string_info(OBJ_PTR fmkr, FM *p, int fnt, unsigned char *text, double scale, int *ierr);
642
+ extern void c_private_show_marker(
643
+ OBJ_PTR fmkr, FM *p, int int_args, OBJ_PTR stroke_width, OBJ_PTR string,
644
+ OBJ_PTR x, OBJ_PTR y, OBJ_PTR x_vec, OBJ_PTR y_vec,
645
+ double h_scale, double v_scale, double scale, double it_angle, double ascent_angle, double angle,
646
+ OBJ_PTR fill_color, OBJ_PTR stroke_color, int *ierr);
369
647
 
370
- extern VALUE FM_rescale_text(VALUE fmkr, VALUE scaling);
371
- extern VALUE FM_rescale_lines(VALUE fmkr, VALUE scaling);
648
+ /*======================================================================*/
649
+ // texout.c
650
+ extern void Open_tex(OBJ_PTR fmkr, char *filename, bool quiet_mode, int *ierr);
651
+ extern void Close_tex(OBJ_PTR fmkr, bool quiet_mode, int *ierr);
652
+ extern void Create_wrapper(OBJ_PTR fmkr, char *filename, bool quiet_mode, int *ierr);
653
+ extern void Init_tex(int *ierr);
654
+ extern void Rename_tex(char *oldname, char *newname, int *ierr);
655
+ extern void private_make_portfolio(char *filename, OBJ_PTR fignums, OBJ_PTR fignames, int *ierr);
656
+
657
+ extern void c_rescale_text(OBJ_PTR fmkr, FM *p, double scaling_factor, int *ierr);
658
+ extern void c_show_rotated_text(OBJ_PTR fmkr, FM *p, char *text, int frame_side, double shift, double fraction,
659
+ double scale, double angle, int justification, int alignment, OBJ_PTR measure_name, int *ierr);
660
+ extern void c_show_rotated_label(OBJ_PTR fmkr, FM *p, char *text,
661
+ double xloc, double yloc, double scale, double angle, int justification, int alignment, OBJ_PTR measure_name, int *ierr);
662
+ extern OBJ_PTR c_check_label_clip(OBJ_PTR fmkr, FM *p, double x, double y, int *ierr);
663
+ extern void c_save_measure(OBJ_PTR fmkr, OBJ_PTR measure_name,
664
+ double width, double height, double depth);
372
665
 
373
- extern double bbox_llx, bbox_lly, bbox_urx, bbox_ury;
666
+
667
+ /*======================================================================*/
374
668
 
375
669
  // ENLARGE = the conversion factor from "big points" to output units
376
670
  #define ENLARGE 10.0
@@ -384,55 +678,29 @@ extern double bbox_llx, bbox_lly, bbox_urx, bbox_ury;
384
678
  #define convert_inches_to_output(inches) ((ENLARGE*BIG_POINTS_PER_INCH)*(inches))
385
679
  #define convert_output_to_inches(output) ((output)/(ENLARGE*BIG_POINTS_PER_INCH))
386
680
 
387
- extern VALUE FM_convert_inches_to_output(VALUE fmkr, VALUE value);
388
- extern VALUE FM_convert_output_to_inches(VALUE fmkr, VALUE value);
389
-
390
681
  #define convert_mm_to_output(mm) ((ENLARGE*BIG_POINTS_PER_INCH*INCHES_PER_MM)*(mm))
391
682
  #define convert_output_to_mm(output) ((output)/(ENLARGE*BIG_POINTS_PER_INCH*INCHES_PER_MM))
392
683
 
393
- extern VALUE FM_convert_mm_to_output(VALUE fmkr, VALUE value);
394
- extern VALUE FM_convert_output_to_mm(VALUE fmkr, VALUE value);
395
-
396
684
  #define convert_page_to_output_x(p,x) ((p)->page_left + (x)*(p)->page_width)
397
685
  #define convert_page_to_output_y(p,y) ((p)->page_bottom + (y)*(p)->page_height)
398
686
  #define convert_page_to_output_dx(p,dx) ((dx)*(p)->page_width)
399
687
  #define convert_page_to_output_dy(p,dy) ((dy)*(p)->page_height)
400
688
 
401
- extern VALUE FM_convert_page_to_output_x(VALUE fmkr, VALUE value);
402
- extern VALUE FM_convert_page_to_output_y(VALUE fmkr, VALUE value);
403
- extern VALUE FM_convert_page_to_output_dx(VALUE fmkr, VALUE value);
404
- extern VALUE FM_convert_page_to_output_dy(VALUE fmkr, VALUE value);
405
-
406
689
  #define convert_output_to_page_x(p,x) (((x) - (p)->page_left)/(p)->page_width)
407
690
  #define convert_output_to_page_y(p,y) (((y) - (p)->page_bottom)/(p)->page_height)
408
691
  #define convert_output_to_page_dx(p,dx) ((dx)/(p)->page_width)
409
692
  #define convert_output_to_page_dy(p,dy) ((dy)/(p)->page_height)
410
693
 
411
- extern VALUE FM_convert_output_to_page_x(VALUE fmkr, VALUE value);
412
- extern VALUE FM_convert_output_to_page_y(VALUE fmkr, VALUE value);
413
- extern VALUE FM_convert_output_to_page_dx(VALUE fmkr, VALUE value);
414
- extern VALUE FM_convert_output_to_page_dy(VALUE fmkr, VALUE value);
415
-
416
694
  #define convert_frame_to_page_x(p,x) ((p)->frame_left + (x)*(p)->frame_width)
417
695
  #define convert_frame_to_page_y(p,y) ((p)->frame_bottom + (y)*(p)->frame_height)
418
696
  #define convert_frame_to_page_dx(p,dx) ((dx)*(p)->frame_width)
419
697
  #define convert_frame_to_page_dy(p,dy) ((dy)*(p)->frame_height)
420
698
 
421
- extern VALUE FM_convert_frame_to_page_x(VALUE fmkr, VALUE value);
422
- extern VALUE FM_convert_frame_to_page_y(VALUE fmkr, VALUE value);
423
- extern VALUE FM_convert_frame_to_page_dx(VALUE fmkr, VALUE value);
424
- extern VALUE FM_convert_frame_to_page_dy(VALUE fmkr, VALUE value);
425
-
426
699
  #define convert_page_to_frame_x(p,x) (((x) - (p)->frame_left)/(p)->frame_width)
427
700
  #define convert_page_to_frame_y(p,y) (((y) - (p)->frame_bottom)/(p)->frame_height)
428
701
  #define convert_page_to_frame_dx(p,dx) ((dx)/(p)->frame_width)
429
702
  #define convert_page_to_frame_dy(p,dy) ((dy)/(p)->frame_height)
430
703
 
431
- extern VALUE FM_convert_page_to_frame_x(VALUE fmkr, VALUE value);
432
- extern VALUE FM_convert_page_to_frame_y(VALUE fmkr, VALUE value);
433
- extern VALUE FM_convert_page_to_frame_dx(VALUE fmkr, VALUE value);
434
- extern VALUE FM_convert_page_to_frame_dy(VALUE fmkr, VALUE value);
435
-
436
704
  #define convert_figure_to_frame_x(p,x) (\
437
705
  ((p)->bounds_left > (p)->bounds_right)? (1.0 - ((x)-(p)->bounds_xmin)/(p)->bounds_width) : ((x)-(p)->bounds_xmin)/(p)->bounds_width)
438
706
  #define convert_figure_to_frame_y(p,y) (\
@@ -442,11 +710,6 @@ extern VALUE FM_convert_page_to_frame_dy(VALUE fmkr, VALUE value);
442
710
  #define convert_figure_to_frame_dy(p,dy) (\
443
711
  ((p)->bounds_bottom > (p)->bounds_top)? -(dy)/(p)->bounds_height : (dy)/(p)->bounds_height)
444
712
 
445
- extern VALUE FM_convert_figure_to_frame_x(VALUE fmkr, VALUE value);
446
- extern VALUE FM_convert_figure_to_frame_y(VALUE fmkr, VALUE value);
447
- extern VALUE FM_convert_figure_to_frame_dx(VALUE fmkr, VALUE value);
448
- extern VALUE FM_convert_figure_to_frame_dy(VALUE fmkr, VALUE value);
449
-
450
713
  #define convert_frame_to_figure_x(p,x) (\
451
714
  ((p)->bounds_left > (p)->bounds_right)? ((p)->bounds_left - (x)*(p)->bounds_width): ((p)->bounds_left + (x)*(p)->bounds_width))
452
715
  #define convert_frame_to_figure_y(p,y) (\
@@ -456,352 +719,6 @@ extern VALUE FM_convert_figure_to_frame_dy(VALUE fmkr, VALUE value);
456
719
  #define convert_frame_to_figure_dy(p,dy) (\
457
720
  ((p)->bounds_bottom > (p)->bounds_top)? (-(dy)*(p)->bounds_height): ((dy)*(p)->bounds_height))
458
721
 
459
- extern VALUE FM_convert_frame_to_figure_x(VALUE fmkr, VALUE value);
460
- extern VALUE FM_convert_frame_to_figure_y(VALUE fmkr, VALUE value);
461
- extern VALUE FM_convert_frame_to_figure_dx(VALUE fmkr, VALUE value);
462
- extern VALUE FM_convert_frame_to_figure_dy(VALUE fmkr, VALUE value);
463
-
464
- extern double convert_figure_to_output_x(FM *p, double x);
465
- extern double convert_figure_to_output_y(FM *p, double y);
466
- extern double convert_figure_to_output_dy(FM *p, double dy);
467
- extern double convert_figure_to_output_dx(FM *p, double dx);
468
-
469
- extern VALUE FM_convert_figure_to_output_x(VALUE fmkr, VALUE value);
470
- extern VALUE FM_convert_figure_to_output_y(VALUE fmkr, VALUE value);
471
- extern VALUE FM_convert_figure_to_output_dx(VALUE fmkr, VALUE value);
472
- extern VALUE FM_convert_figure_to_output_dy(VALUE fmkr, VALUE value);
473
-
474
- extern double convert_output_to_figure_x(FM *p, double x);
475
- extern double convert_output_to_figure_y(FM *p, double y);
476
- extern double convert_output_to_figure_dy(FM *p, double dy);
477
- extern double convert_output_to_figure_dx(FM *p, double dx);
478
-
479
- extern VALUE FM_convert_output_to_figure_x(VALUE fmkr, VALUE value);
480
- extern VALUE FM_convert_output_to_figure_y(VALUE fmkr, VALUE value);
481
- extern VALUE FM_convert_output_to_figure_dx(VALUE fmkr, VALUE value);
482
- extern VALUE FM_convert_output_to_figure_dy(VALUE fmkr, VALUE value);
483
-
484
- extern double c_convert_to_degrees(FM *p, double dx, double dy);
485
- extern VALUE FM_convert_to_degrees(VALUE fmkr, VALUE dx, VALUE dy);
486
-
487
- extern void update_bbox(FM *p, double x, double y);
488
-
489
- extern void c_set_bounds(FM *p, double left, double right, double top, double bottom);
490
- extern VALUE FM_private_set_bounds(VALUE fmkr, VALUE left, VALUE right, VALUE top, VALUE bottom); /* in figure coords */
491
-
492
- extern VALUE FM_private_context(VALUE fmkr, VALUE cmd);
493
-
494
- extern void c_set_subframe(FM *p, double left_margin, double right_margin, double top_margin, double bottom_margin);
495
- extern VALUE FM_private_set_subframe(VALUE fmkr, VALUE left_margin, VALUE right_margin, VALUE top_margin, VALUE bottom_margin);
496
-
497
- /* TeX text */
498
-
499
- extern VALUE FM_rescale_text(VALUE fmkr, VALUE scale); // updates char_height_dx and char_height_dy too
500
-
501
- extern VALUE FM_show_rotated_text(VALUE fmkr, VALUE text, VALUE frame_side, VALUE shift,
502
- VALUE fraction, VALUE scale, VALUE angle, VALUE justification, VALUE alignment);
503
-
504
- extern VALUE FM_show_rotated_label(VALUE fmkr, VALUE text,
505
- VALUE xloc, VALUE yloc, VALUE scale, VALUE angle, VALUE justification, VALUE alignment);
506
-
507
- extern VALUE FM_check_label_clip(VALUE fmkr, VALUE xloc, VALUE yloc);
508
-
509
- /* PDF graphics */
510
-
511
- /* graphics attributes */
512
- extern VALUE FM_stroke_color_set(VALUE fmkr, VALUE value);
513
- extern VALUE FM_fill_color_set(VALUE fmkr, VALUE value);
514
- extern VALUE FM_line_width_set(VALUE fmkr, VALUE value);
515
- extern VALUE FM_stroke_scale_set(VALUE fmkr, VALUE value);
516
- extern VALUE FM_line_cap_set(VALUE fmkr, VALUE value);
517
- extern VALUE FM_line_join_set(VALUE fmkr, VALUE value);
518
- extern VALUE FM_miter_limit_set(VALUE fmkr, VALUE value);
519
- extern VALUE FM_line_type_set(VALUE fmkr, VALUE line_type);
520
- extern VALUE FM_stroke_opacity_set(VALUE fmkr, VALUE value);
521
- extern VALUE FM_fill_opacity_set(VALUE fmkr, VALUE value);
522
- extern VALUE FM_marker_horizontal_scaling_set(VALUE fmkr, VALUE value); // as fraction of normal width
523
-
524
- /*
525
- Once start a path, must finish with it before going on to anything else.
526
- So, do sequence of path producer operations followed by a single path consumer operation.
527
- After the path consumer operation finishes, the current path is reset to empty.
528
- Can't mix in other kinds of operations in the middle of this; once start constructing a path,
529
- cannot do any other graphics operations until have finished producing the path and have consumed it.
530
- */
531
-
532
- /* Path Producers */
533
-
534
- /* path parameters are in figure coordinates */
535
- /* are immediately converted to output coordinates; uneffected by later changes in figure coordinate system */
536
-
537
- extern VALUE FM_move_to_point(VALUE fmkr, VALUE x, VALUE y); // x y m
538
- extern VALUE FM_append_point_to_path(VALUE fmkr, VALUE x, VALUE y); // x y l
539
- extern VALUE FM_append_curve_to_path(VALUE fmkr, VALUE x1, VALUE y1, VALUE x2, VALUE y2, VALUE x3, VALUE y3); // x1 y1 x2 y2 x3 y3 c
540
- extern VALUE FM_close_path(VALUE fmkr); // h
541
-
542
- extern VALUE FM_append_points_to_path(VALUE fmkr, VALUE x_vec, VALUE y_vec);
543
- extern VALUE FM_private_append_points_with_gaps_to_path(VALUE fmkr, VALUE x_vec, VALUE y_vec, VALUE gaps, VALUE close_gaps);
544
-
545
- extern VALUE FM_append_arc_to_path(VALUE fmkr, VALUE x_start, VALUE y_start, VALUE x_corner, VALUE y_corner,
546
- VALUE x_end, VALUE y_end, VALUE dx, VALUE dy);
547
- // dx and dy are converted to output coords and smaller is used as radius
548
-
549
- extern VALUE FM_append_rect_to_path(VALUE fmkr, VALUE x, VALUE y, VALUE width, VALUE height); // x y w h re
550
- extern VALUE FM_append_rounded_rect_to_path(VALUE fmkr, VALUE x, VALUE y, VALUE width, VALUE height, VALUE dx, VALUE dy);
551
- // dx and dy are converted to output coords and smaller is used as radius
552
-
553
- extern VALUE FM_append_circle_to_path(VALUE fmkr, VALUE x, VALUE y, VALUE dx);
554
- extern VALUE FM_append_oval_to_path(VALUE fmkr, VALUE x, VALUE y, VALUE dx, VALUE dy, VALUE angle);
555
-
556
- extern VALUE FM_append_frame_to_path(VALUE fmkr);
557
-
558
- extern VALUE FM_update_bbox(VALUE fmkr, VALUE x, VALUE y);
559
-
560
- extern VALUE FM_bbox_left(VALUE fmkr);
561
- extern VALUE FM_bbox_right(VALUE fmkr);
562
- extern VALUE FM_bbox_top(VALUE fmkr);
563
- extern VALUE FM_bbox_bottom(VALUE fmkr);
564
-
565
- /* Path Consumers */
566
-
567
- extern VALUE FM_stroke(VALUE fmkr); // S
568
- extern VALUE FM_close_and_stroke(VALUE fmkr); // s
569
- extern VALUE FM_fill(VALUE fmkr); // f
570
- extern VALUE FM_eofill(VALUE fmkr); // f*
571
- extern VALUE FM_fill_and_stroke(VALUE fmkr); // B
572
- extern VALUE FM_eofill_and_stroke(VALUE fmkr); // B*
573
- extern VALUE FM_close_fill_and_stroke(VALUE fmkr); // b
574
- extern VALUE FM_close_eofill_and_stroke(VALUE fmkr); // b*
575
- extern VALUE FM_clip(VALUE fmkr); // W n
576
- extern VALUE FM_eoclip(VALUE fmkr); // W* n
577
- extern VALUE FM_discard_path(VALUE fmkr); // n
578
-
579
- /* Combination Path Constructing and Using */
580
-
581
- extern VALUE FM_stroke_line(VALUE fmkr, VALUE x1, VALUE y1, VALUE x2, VALUE y2);
582
-
583
- extern VALUE FM_fill_rect(VALUE fmkr, VALUE x, VALUE y, VALUE width, VALUE height);
584
- extern VALUE FM_stroke_rect(VALUE fmkr, VALUE x, VALUE y, VALUE width, VALUE height);
585
- extern VALUE FM_fill_and_stroke_rect(VALUE fmkr, VALUE x, VALUE y, VALUE width, VALUE height);
586
- extern VALUE FM_clip_rect(VALUE fmkr, VALUE x, VALUE y, VALUE width, VALUE height);
587
-
588
- extern VALUE FM_fill_frame(VALUE fmkr);
589
- extern VALUE FM_stroke_frame(VALUE fmkr);
590
- extern VALUE FM_fill_and_stroke_frame(VALUE fmkr);
591
- extern VALUE FM_clip_to_frame(VALUE fmkr);
592
-
593
- extern VALUE FM_fill_oval(VALUE fmkr, VALUE x, VALUE y, VALUE dx, VALUE dy, VALUE angle);
594
- extern VALUE FM_stroke_oval(VALUE fmkr, VALUE x, VALUE y, VALUE dx, VALUE dy, VALUE angle);
595
- extern VALUE FM_fill_and_stroke_oval(VALUE fmkr, VALUE x, VALUE y, VALUE dx, VALUE dy, VALUE angle);
596
- extern VALUE FM_clip_oval(VALUE fmkr, VALUE x, VALUE y, VALUE dx, VALUE dy, VALUE angle);
597
-
598
- extern VALUE FM_fill_circle(VALUE fmkr, VALUE x, VALUE y, VALUE dx);
599
- extern VALUE FM_stroke_circle(VALUE fmkr, VALUE x, VALUE y, VALUE dx);
600
- extern VALUE FM_fill_and_stroke_circle(VALUE fmkr, VALUE x, VALUE y, VALUE dx);
601
- extern VALUE FM_clip_circle(VALUE fmkr, VALUE x, VALUE y, VALUE dx);
602
-
603
- extern VALUE FM_fill_rounded_rect(VALUE fmkr, VALUE x, VALUE y, VALUE width, VALUE height, VALUE dx, VALUE dy);
604
- extern VALUE FM_stroke_rounded_rect(VALUE fmkr, VALUE x, VALUE y, VALUE width, VALUE height, VALUE dx, VALUE dy);
605
- extern VALUE FM_fill_and_stroke_rounded_rect(VALUE fmkr, VALUE x, VALUE y, VALUE width, VALUE height, VALUE dx, VALUE dy);
606
- extern VALUE FM_clip_rounded_rect(VALUE fmkr, VALUE x, VALUE y, VALUE width, VALUE height, VALUE dx, VALUE dy);
607
-
608
- /* Shading */
609
-
610
- extern VALUE FM_private_axial_shading(VALUE fmkr, VALUE x0, VALUE y0,
611
- VALUE x1, VALUE y1, VALUE colormap, VALUE extend_start, VALUE extend_end);
612
- extern VALUE FM_private_radial_shading(VALUE fmkr, VALUE x0, VALUE y0, VALUE r0,
613
- VALUE x1, VALUE y1, VALUE r1, VALUE colormap,
614
- VALUE a, VALUE b, VALUE c, VALUE d,
615
- VALUE extend_start, VALUE extend_end);
616
-
617
- /* Markers */
618
-
619
- // a marker is a [font number, character code]
620
- // markers are filled with the current fill color and/or stroked with the current stroke color
621
- // they are scaled by the current text_scale times the scale parameter passed to the drawing routine
622
- // locations given in figure coords
623
-
624
- extern VALUE FM_register_font(VALUE fmkr, VALUE font_name); // returns font number.
625
-
626
- extern VALUE FM_private_show_marker(VALUE fmkr, VALUE integer_args, VALUE stroke_width, VALUE string,
627
- VALUE x, VALUE y, VALUE x_vec, VALUE y_vec,
628
- VALUE h_scale, VALUE v_scale, VALUE scale, VALUE it_angle, VALUE ascent_angle, VALUE angle,
629
- VALUE fill_color, VALUE stroke_color);
630
-
631
- extern VALUE FM_marker_string_info(VALUE fmkr, VALUE font_number, VALUE string, VALUE scale);
632
- // [ width, llx, lly, urx, ury ] in figure coords
633
-
634
- /* Images */
635
-
636
- extern VALUE FM_private_show_jpg(VALUE fmkr, VALUE filename, VALUE width, VALUE height, VALUE image_destination, VALUE mask_xo_num);
637
- extern VALUE FM_show_jp2(VALUE fmkr, VALUE filename, VALUE width, VALUE height, VALUE image_destination, VALUE mask_xo_num);
638
-
639
- extern VALUE FM_private_show_rgb_image(VALUE fmkr, VALUE llx, VALUE lly, VALUE lrx, VALUE lry, VALUE ulx, VALUE uly,
640
- VALUE interpolate, VALUE w, VALUE h, VALUE data, VALUE mask_xo_num);
641
-
642
- extern VALUE FM_private_show_cmyk_image(VALUE fmkr, VALUE llx, VALUE lly, VALUE lrx, VALUE lry, VALUE ulx, VALUE uly,
643
- VALUE interpolate, VALUE w, VALUE h, VALUE data, VALUE mask_xo_num);
644
-
645
- extern VALUE FM_private_show_grayscale_image(VALUE fmkr, VALUE llx, VALUE lly, VALUE lrx, VALUE lry, VALUE ulx, VALUE uly,
646
- VALUE interpolate, VALUE w, VALUE h, VALUE data, VALUE mask_xo_num);
647
-
648
- extern VALUE FM_private_show_monochrome_image(VALUE fmkr, VALUE llx, VALUE lly, VALUE lrx, VALUE lry, VALUE ulx, VALUE uly,
649
- VALUE interpolate, VALUE reversed, VALUE w, VALUE h, VALUE data, VALUE mask_xo_num);
650
-
651
- extern VALUE FM_private_show_image(VALUE fmkr, VALUE llx, VALUE lly, VALUE lrx, VALUE lry, VALUE ulx, VALUE uly,
652
- VALUE interpolate, VALUE w, VALUE h, VALUE data, VALUE value_mask_min, VALUE value_mask_max,
653
- VALUE hival, VALUE lookup, VALUE mask_xo_num);
654
-
655
- extern VALUE FM_private_create_image_data(VALUE fmkr, VALUE data,
656
- VALUE first_row, VALUE last_row, VALUE first_column, VALUE last_column,
657
- VALUE min_value, VALUE max_value, VALUE max_code, VALUE if_below_range, VALUE if_above_range);
658
-
659
- extern VALUE FM_private_create_monochrome_image_data(VALUE fmkr, VALUE data,
660
- VALUE first_row, VALUE last_row, VALUE first_column, VALUE last_column,
661
- VALUE boundary, VALUE reverse);
662
-
663
- /* Colormaps for Sampled Images */
664
-
665
- extern VALUE FM_private_create_colormap(VALUE fmkr, VALUE rgb_flag,
666
- VALUE length, VALUE Ps, VALUE C1s, VALUE C2s, VALUE C3s);
667
- /*
668
- create mappings from 'position' (0 to 1) to color (in HLS or RGB color spaces)
669
- the length parameter determines the number of entries in the color map (any integer between 2 and 256).
670
- for rgb, the colors are given as (red, green, blue) intensities from 0.0 to 1.0
671
- for hls, the colors are given as (hue, lightness, saturation)
672
- lightness and saturation given as values from 0.0 to 1.0
673
- hue given as degrees (0 to 360) around the color wheel from red->green->blue->red
674
- Ps are the locations in (0 to 1) for the control points -- in increasing order
675
- must have Ps[0] == 0.0 and Ps[num_ps-1] == 1.0
676
- */
677
-
678
- extern VALUE FM_convert_to_colormap(VALUE fmkr, VALUE Rs, VALUE Gs, VALUE Bs);
679
- /* this creates an arbitrary mapping from positions to colors given as (r,g,b) triples */
680
- /* the colormap size is set to the length of the vectors */
681
- /* the Rs, Gs, and Bs are VALUEs from 0 to 1 representing the intensity of the color component */
682
-
683
- extern VALUE FM_get_color_from_colormap(VALUE fmkr, VALUE color_map, VALUE color_position);
684
- /* color_position is from 0 to 1. this returns a vector for the RGB color from the given colormap */
685
-
686
-
687
- /*======================================================================*/
688
-
689
- /* Axes Operations */
690
-
691
- extern VALUE FM_show_axis(VALUE fmkr, VALUE loc);
692
- extern VALUE FM_show_edge(VALUE fmkr, VALUE loc);
693
-
694
- /*======================================================================*/
695
-
696
- /* Line Builders */
697
-
698
- extern VALUE FM_private_make_contour(VALUE fmkr,
699
- VALUE dest_xs, VALUE dest_ys, VALUE gaps, // these Dvectors get the results
700
- VALUE xs, VALUE ys, // data x coordinates and y coordinates
701
- VALUE zs, VALUE z_level, // the Dtable of values and the desired contour level
702
- VALUE legit, // the Dtable of flags (nonzero means okay)
703
- VALUE method // int == 1 means use CONREC
704
- );
705
-
706
- extern VALUE FM_private_make_steps(VALUE fmkr, VALUE Xvec, VALUE Yvec, VALUE Xdata, VALUE Ydata,
707
- VALUE xfirst, VALUE yfirst, VALUE xlast, VALUE ylast);
708
- /* adds n_pts_to_add points to Xs and Ys for steps with the given parameters.
709
- X_data and Y_data are arrays of n values where n_pts_to_add = 2*(n+1)
710
- (xfirst,yfirst) and (xlast,ylast) are extra data points to fix the first and last steps.
711
- The X_data plus xfirst and xlast determine the widths of the steps.
712
- The Y_data plus yfirst and ylast determine the height of the steps.
713
- The steps occur at locations midway between the given x locations. */
714
-
715
- extern VALUE FM_private_make_spline_interpolated_points(VALUE fmkr, VALUE Xvec, VALUE Yvec, VALUE Xdata, VALUE Ydata,
716
- VALUE start_slope, VALUE end_slope);
717
- /* uses Xvec_data and Yvec_data to create a cubic spline interpolant.
718
- once the spline interpolant is created, it is sampled at the n_pts_to_add in Xs.
719
- Xvec entry i is set to the value of the spline at Yvec entry i.
720
- Both the X_data and the Xs should be stored in ascending order.
721
- There is a boundary condition choice to be made for each end concerning the slope.
722
- If clamped is true, the corresponding slope argument value sets the slope.
723
- If clamped is false (known as a "free" or "natural" spline),
724
- the 2nd derivative is set to 0 and the slope is determined by the fit.
725
- In this case, the corresponding slope argument is ignored.
726
- */
727
-
728
- /*======================================================================*/
729
-
730
- /* Some miscellaneous stuff */
731
-
732
- extern void figure_moveto(FM *p, double x, double y); // figure coords
733
- extern void figure_lineto(FM *p, double x, double y); // figure coords
734
- extern void figure_join(FM *p, double x0, double y0, double x1, double y1); // figure coords
735
- extern void figure_join_and_stroke(FM *p, double x0, double y0, double x1, double y1); // figure coords
736
-
737
- extern double Get_double(VALUE obj, ID name_ID); // for instance variables of the obj
738
- extern bool Get_bool(VALUE obj, ID name_ID);
739
- extern int Get_int(VALUE obj, ID name_ID);
740
- #define Get_value(obj, name_ID) rb_ivar_get(obj, name_ID)
741
-
742
-
743
- extern VALUE FM_private_make(VALUE fmkr, VALUE name, VALUE cmd);
744
- extern VALUE FM_get_save_filename(VALUE fmkr, VALUE name);
745
-
746
- extern VALUE FM_private_make_portfolio(VALUE fmkr, VALUE name, VALUE fignums, VALUE fignames);
747
- extern void private_make_portfolio(char *filename, VALUE fignums, VALUE fignames);
748
-
749
- extern void Init_PlotAxis(void);
750
- extern void Initialize_Figure(VALUE fmkr);
751
- extern void c_setup_drawing(FM *p);
752
- extern void Init_IDs(void);
753
- extern void Initialize_Figure(VALUE fmkr);
754
-
755
- extern void c_moveto(FM *p, double x, double y);
756
- extern void c_lineto(FM *p, double x, double y);
757
- extern void c_curveto(FM *p, double x1, double y1, double x2, double y2, double x3, double y3);
758
- extern void c_line_width_set(FM *p, double line_width);
759
- extern void c_line_cap_set(FM *p, int line_cap);
760
- extern void c_line_join_set(FM *p, int line_cap);
761
- extern void c_miter_limit_set(FM *p, double miter_limit);
762
- extern void c_stroke_scale_set(FM *p, double stroke_scale);
763
- extern void c_clip_rect(FM *p, double x, double y, double width, double height); // in output coords
764
-
765
- extern int Blank_String(char *str);
766
- extern char *Get_String(VALUE ary, int index);
767
-
768
- extern void c_show_rotated_text(FM *p, char *text, int frame_side, double shift, double fraction,
769
- double scale, double angle, int justification, int alignment);
770
- extern void c_show_rotated_label(FM *p, char *text,
771
- double xloc, double yloc, double scale, double angle, int justification, int alignment);
772
-
773
- extern void pldtikmin(FM *p, double tick_min, double vmin, double vmax, double *tick, int *nsubt);
774
- extern void draw_box_top_and_bottom(FM *p, char *xopt, double xtick, int nxsub);
775
- extern void draw_box_left_and_right(FM *p, char *yopt, double ytick, int nysub);
776
-
777
- extern VALUE do_cmd(VALUE fmkr, VALUE cmd);
778
-
779
- extern char *Get_tex_preview_documentclass(VALUE fmkr);
780
- extern char *Get_tex_preamble(VALUE fmkr);
781
- extern char *Get_tex_xaxis_numeric_label(VALUE fmkr);
782
- extern char *Get_tex_yaxis_numeric_label(VALUE fmkr);
783
- extern char *Get_tex_preview_pagestyle(VALUE fmkr);
784
- extern double Get_tex_xoffset(VALUE fmkr);
785
- extern double Get_tex_yoffset(VALUE fmkr);
786
-
787
- extern char *Get_tex_preview_paper_width(VALUE fmkr);
788
- extern char *Get_tex_preview_paper_height(VALUE fmkr);
789
- extern char *Get_tex_preview_hoffset(VALUE fmkr);
790
- extern char *Get_tex_preview_voffset(VALUE fmkr);
791
- extern char *Get_tex_preview_figure_width(VALUE fmkr);
792
- extern char *Get_tex_preview_figure_height(VALUE fmkr);
793
- extern char *Get_tex_preview_minwhitespace(VALUE fmkr);
794
- extern bool Get_tex_preview_fullpage(VALUE fmkr);
795
-
796
- extern char *Get_tex_preview_tiogafigure_command(VALUE fmkr);
797
-
798
- extern char *Get_tex_fontsize(VALUE fmkr);
799
- extern char *Get_tex_fontfamily(VALUE fmkr);
800
- extern char *Get_tex_fontseries(VALUE fmkr);
801
- extern char *Get_tex_fontshape(VALUE fmkr);
802
-
803
- extern char *Get_tex_preview_generated_preamble(VALUE fmkr);
804
-
805
722
  #ifndef USE_P
806
723
  #define USE_P p = NULL;
807
724
  #endif
@@ -827,37 +744,5 @@ extern char *Get_tex_preview_generated_preamble(VALUE fmkr);
827
744
  #define SIGN(a) ((a)<0 ? -1 : 1)
828
745
  #endif
829
746
 
830
- #define DBL_ATTR(attr) \
831
- static VALUE FM_##attr##_get(VALUE fmkr) { FM *p = Get_FM(fmkr); return rb_float_new(p->attr); } \
832
- static VALUE FM_##attr##_set(VALUE fmkr, VALUE val) { \
833
- FM *p = Get_FM(fmkr); VALUE v = rb_Float(val); p->attr = NUM2DBL(v); return val; }
834
-
835
- #define INT_ATTR(attr) \
836
- static VALUE FM_##attr##_get(VALUE fmkr) { FM *p = Get_FM(fmkr); return INT2FIX(p->attr); } \
837
- static VALUE FM_##attr##_set(VALUE fmkr, VALUE val) { \
838
- FM *p = Get_FM(fmkr); VALUE v = rb_Integer(val); p->attr = NUM2INT(v); return val; }
839
-
840
- #define VAL_ATTR(attr) \
841
- static VALUE FM_##attr##_get(VALUE fmkr) { FM *p = Get_FM(fmkr); return p->attr; } \
842
- static VALUE FM_##attr##_set(VALUE fmkr, VALUE val) { \
843
- FM *p = Get_FM(fmkr); p->attr = val; return val; }
844
-
845
- #define BOOL_ATTR(attr) \
846
- static VALUE FM_##attr##_get(VALUE fmkr) { FM *p = Get_FM(fmkr); return (p->attr)? Qtrue : Qfalse; } \
847
- static VALUE FM_##attr##_set(VALUE fmkr, VALUE val) { \
848
- FM *p = Get_FM(fmkr); p->attr = (val != Qfalse); return val; }
849
-
850
- #define RO_DBL_ATTR(attr) \
851
- static VALUE FM_##attr##_get(VALUE fmkr) { FM *p = Get_FM(fmkr); return rb_float_new(p->attr); }
852
-
853
- #define RO_INT_ATTR(attr) \
854
- static VALUE FM_##attr##_get(VALUE fmkr) { FM *p = Get_FM(fmkr); return INT2FIX(p->attr); }
855
-
856
- #define RO_VAL_ATTR(attr) \
857
- static VALUE FM_##attr##_get(VALUE fmkr) { FM *p = Get_FM(fmkr); return p->attr; }
858
-
859
- #define RO_BOOL_ATTR(attr) \
860
- static VALUE FM_##attr##_get(VALUE fmkr) { FM *p = Get_FM(fmkr); return (p->attr)? Qtrue : Qfalse; }
861
-
862
747
  #endif /* __figures_H__ */
863
748