1 /* 2 Copyright (C) 2018-2021, Dirk Krause 3 SPDX-License-Identifier: BSD-3-Clause 4 */ 5 6 /* 7 WARNING: This file was generated by the dkct program (see 8 http://dktools.sourceforge.net/ for details). 9 Changes you make here will be lost if dkct is run again! 10 You should modify the original source and run dkct on it. 11 Original source: dk4graa.ctr 12 */ 13 14 #ifndef DK4GRAA_H_INCLUDED 15 /** Avoid multiple inclusions. */ 16 #define DK4GRAA_H_INCLUDED 1 17 18 19 /** @file dk4graa.h Graphics output (PS/EPS/PDF/PGF), application support. 20 */ 21 22 23 #ifndef DK4CONF_H_INCLUDED 24 #if DK4_BUILDING_DKTOOLS4 25 #include "dk4conf.h" 26 #else 27 #include <dktools-4/dk4conf.h> 28 #endif 29 #endif 30 31 #ifndef DK4GRA_H_INCLUDED 32 #if DK4_BUILDING_DKTOOLS4 33 #include <libdk4gra/dk4gra.h> 34 #else 35 #include <dktools-4/dk4gra.h> 36 #endif 37 #endif 38 39 #ifndef DK4APP_H_INCLUDED 40 #if DK4_BUILDING_DKTOOLS4 41 #include <libdk4app/dk4app.h> 42 #else 43 #include <dktools-4/dk4app.h> 44 #endif 45 #endif 46 47 48 #ifdef __cplusplus 49 extern "C" { 50 #endif 51 52 /** Open output structure to create a PDF file. 53 @param fn File name for output file, NULL for standard output. 54 @param w Image width in bp. 55 @param h Image height in bp. 56 @param docfl Document flag set. 57 @param app Application structure for diagnostics, may be NULL. 58 @return Valid pointer to new structure on success, NULL on error. 59 */ 60 61 dk4_gra_t * 62 dk4gra_app_open_pdf( 63 const dkChar *fn, 64 size_t w, 65 size_t h, 66 int docfl, 67 dk4_app_t *app 68 ); 69 70 71 /** Open output structure to create a PS or EPS file. 72 @param fn File name for output file, NULL for standard output. 73 @param w Image width in bp. 74 @param h Image height in bp. 75 @param docfl Flag set, or combination of: 76 - DK4_GRA_DOC_FLAG_PS2<br> 77 to produce PS level 2 instead of level 3, 78 - DK4_GRA_DOC_FLAG_EPS<br> 79 to produce EPS instead of PS, 80 - DK4_GRA_DOC_FLAG_PS_DSC<br> 81 to write document structuring comments. 82 @param app Application structure for diagnostics, may be NULL. 83 @return Valid pointer to new structure on success, NULL on error. 84 */ 85 86 dk4_gra_t * 87 dk4gra_app_open_ps( 88 const dkChar *fn, 89 size_t w, 90 size_t h, 91 int docfl, 92 dk4_app_t *app 93 ); 94 95 96 /** Open output structure to create a PGF file. 97 @param fn File name for output file, NULL for standard output. 98 @param w Image width in bp. 99 @param h Image height in bp. 100 @param docfl Document flag set. 101 @param sa Flag: Produce standalone TeX file. 102 @param app Application structure for diagnostics, may be NULL. 103 @return Valid pointer to new structure on success, NULL on error. 104 */ 105 106 dk4_gra_t * 107 dk4gra_app_open_pgf( 108 const dkChar *fn, 109 size_t w, 110 size_t h, 111 int docfl, 112 int sa, 113 dk4_app_t *app 114 ); 115 116 117 /** Write output file and close output structure. 118 @param gra Output structure. 119 @param backptr Address of success variable to reset on errors. 120 @param app Application structure for diagnostics, may be NULL. 121 */ 122 123 void 124 dk4gra_app_write_and_close( 125 dk4_gra_t *gra, 126 int *backptr, 127 dk4_app_t *app 128 ); 129 130 131 /** Write output file and close output structure. 132 @param fout Output file already opened. 133 @param gra Output structure. 134 @param app Application structure for diagnostics, may be NULL. 135 @param backptr Address of success variable to reset on errors. 136 */ 137 void 138 dk4gra_app_write_file_and_close( 139 FILE *fout, 140 dk4_gra_t *gra, 141 int *backptr, 142 dk4_app_t *app 143 ); 144 145 146 /** Set color space conversion context. 147 @param gra Output structure. 148 @param ctx Color space conversion context to copy. 149 @param backptr Application structure for diagnostics, may be NULL. 150 @param app Application structure for diagnostics, may be NULL. 151 */ 152 void 153 dk4gra_app_set_color_conversion( 154 dk4_gra_t *gra, 155 dk4_cs_conv_ctx_t const *ctx, 156 int *backptr, 157 dk4_app_t *app 158 ); 159 160 161 /** Start new page. 162 Default flags are used for the page: 163 - The clip path is set to the image dimensions. 164 - Background is filled white. 165 - For PDF the contents stream is compressed. 166 To start a new page with different setup, use dk4gra_page_with_flags() 167 instead and specify flags. 168 @param gra Output structure. 169 @param backptr Address of success variable to reset on errors. 170 @param app Application structure for diagnostics, may be NULL. 171 */ 172 173 void 174 dk4gra_app_page( 175 dk4_gra_t *gra, 176 int *backptr, 177 dk4_app_t *app 178 ); 179 180 181 /** Start new page with non-default setup. 182 @param gra Output structure. 183 @param flags Or-combined flags: 184 - DK4_GRA_PAGE_FLAG_NO_CLIP<br> 185 to avoid setting the clip path at start of page, 186 - DK4_GRA_PAGE_FLAG_NO_BG<br> 187 to avoid white background filling, 188 - DK4_GRA_PAGE_FLAG_NOT_COMPRESSED<br> 189 to avoid compression of page content stream in PDF. 190 @param backptr Address of success variable to reset on errors. 191 @param app Application structure for diagnostics, may be NULL. 192 */ 193 194 void 195 dk4gra_app_page_with_flags( 196 dk4_gra_t *gra, 197 int flags, 198 int *backptr, 199 dk4_app_t *app 200 ); 201 202 203 /** Set flag for simplified gsave/grestore handling. 204 Set this flag, if you use gsave and grestore only when dealing 205 with clip path for pattern filling. 206 @param gra Output structure. 207 @param val New flag value. 208 @param app Application structure for diagnostics, may be NULL. 209 */ 210 void 211 dk4gra_app_set_gs_for_pattern_only( 212 dk4_gra_t *gra, 213 int val, 214 dk4_app_t *app 215 ); 216 217 218 /** Save current graphics state (especially clip path). 219 @param gra Output structure. 220 @param backptr Address of success variable to reset on errors. 221 @param app Application structure for diagnostics, may be NULL. 222 */ 223 224 void 225 dk4gra_app_gsave( 226 dk4_gra_t *gra, 227 int *backptr, 228 dk4_app_t *app 229 ); 230 231 232 /** Restore graphics state (especially clip path). 233 @param gra Output structure. 234 @param backptr Address of success variable to reset on errors. 235 @param app Application structure for diagnostics, may be NULL. 236 */ 237 238 void 239 dk4gra_app_grestore( 240 dk4_gra_t *gra, 241 int *backptr, 242 dk4_app_t *app 243 ); 244 245 246 247 /** Set line width. 248 @param gra Output structure. 249 @param lw Line width in bp. 250 @param backptr Address of success variable to reset on errors. 251 @param app Application structure for diagnostics, may be NULL. 252 */ 253 254 void 255 dk4gra_app_set_line_width( 256 dk4_gra_t *gra, 257 double lw, 258 int *backptr, 259 dk4_app_t *app 260 ); 261 262 263 /** Set line style. 264 @param gra Output structure. 265 @param ls Line style. 266 @param sv Style value (dash length in bp). 267 @param backptr Address of success variable to reset on errors. 268 @param app Application structure for diagnostics, may be NULL. 269 */ 270 271 void 272 dk4gra_app_set_line_style( 273 dk4_gra_t *gra, 274 dk4_gra_ls_t ls, 275 double sv, 276 int *backptr, 277 dk4_app_t *app 278 ); 279 280 281 /** Set line cap. 282 @param gra Output structure. 283 @param lc Line cap type. 284 @param backptr Address of success variable to reset on errors. 285 @param app Application structure for diagnostics, may be NULL. 286 */ 287 288 void 289 dk4gra_app_set_line_cap( 290 dk4_gra_t *gra, 291 dk4_gra_lc_t lc, 292 int *backptr, 293 dk4_app_t *app 294 ); 295 296 297 /** Set line join. 298 @param gra Output structure. 299 @param lj Line join type. 300 @param ml Miter limit, only used if lj is DK4_GRA_LJ_MITERED. 301 @param backptr Address of success variable to reset on errors. 302 @param app Application structure for diagnostics, may be NULL. 303 */ 304 305 void 306 dk4gra_app_set_line_join( 307 dk4_gra_t *gra, 308 dk4_gra_lj_t lj, 309 double ml, 310 int *backptr, 311 dk4_app_t *app 312 ); 313 314 315 /** Set fill color to gray. 316 @param gra Output structure. 317 @param g Gray value in interval 0 to 1. 318 @param backptr Address of success variable to reset on errors. 319 @param app Application structure for diagnostics, may be NULL. 320 */ 321 322 void 323 dk4gra_app_set_fill_gray( 324 dk4_gra_t *gra, 325 double g, 326 int *backptr, 327 dk4_app_t *app 328 ); 329 330 331 /** Set fill color to RGB. 332 @param gra Output structure. 333 @param r Red value in interval 0 to 1. 334 @param g Green value in interval 0 to 1. 335 @param b Blue value in interval 0 to 1. 336 @param backptr Address of success variable to reset on errors. 337 @param app Application structure for diagnostics, may be NULL. 338 */ 339 340 void 341 dk4gra_app_set_fill_rgb( 342 dk4_gra_t *gra, 343 double r, 344 double g, 345 double b, 346 int *backptr, 347 dk4_app_t *app 348 ); 349 350 351 /** Set fill color to CMYK. 352 @param gra Output structure. 353 @param c Cyan value in interval 0 to 1. 354 @param m Magenta value in interval 0 to 1. 355 @param y Yellow value in interval 0 to 1. 356 @param k Black value in interval 0 to 1. 357 @param backptr Address of success variable to reset on errors. 358 @param app Application structure for diagnostics, may be NULL. 359 */ 360 361 void 362 dk4gra_app_set_fill_cmyk( 363 dk4_gra_t *gra, 364 double c, 365 double m, 366 double y, 367 double k, 368 int *backptr, 369 dk4_app_t *app 370 ); 371 372 373 /** Set stroke color to gray. 374 @param gra Output structure. 375 @param g Gray value in interval 0 to 1. 376 @param backptr Address of success variable to reset on errors. 377 @param app Application structure for diagnostics, may be NULL. 378 */ 379 380 void 381 dk4gra_app_set_stroke_gray( 382 dk4_gra_t *gra, 383 double g, 384 int *backptr, 385 dk4_app_t *app 386 ); 387 388 389 /** Set stroke color to RGB. 390 @param gra Output structure. 391 @param r Red value in interval 0 to 1. 392 @param g Green value in interval 0 to 1. 393 @param b Blue value in interval 0 to 1. 394 @param backptr Address of success variable to reset on errors. 395 @param app Application structure for diagnostics, may be NULL. 396 */ 397 398 void 399 dk4gra_app_set_stroke_rgb( 400 dk4_gra_t *gra, 401 double r, 402 double g, 403 double b, 404 int *backptr, 405 dk4_app_t *app 406 ); 407 408 409 /** Set stroke color to CMYK. 410 @param gra Output structure. 411 @param c Cyan value in interval 0 to 1. 412 @param m Magenta value in interval 0 to 1. 413 @param y Yellow value in interval 0 to 1. 414 @param k Black value in interval 0 to 1. 415 @param backptr Address of success variable to reset on errors. 416 @param app Application structure for diagnostics, may be NULL. 417 */ 418 419 void 420 dk4gra_app_set_stroke_cmyk( 421 dk4_gra_t *gra, 422 double c, 423 double m, 424 double y, 425 double k, 426 int *backptr, 427 dk4_app_t *app 428 ); 429 430 431 432 /** Prepare output structure for a fill operation. 433 Use this function before you start to construct a path you plan to fill. 434 @param gra Output structure. 435 @param backptr Address of success variable to reset on errors. 436 @param app Application structure for diagnostics, may be NULL. 437 */ 438 439 void 440 dk4gra_app_prepare_fill( 441 dk4_gra_t *gra, 442 int *backptr, 443 dk4_app_t *app 444 ); 445 446 447 /** Prepare output structure for a stroke operation. 448 Use this function before you start to construct a path you plan to stroke. 449 @param gra Output structure. 450 @param backptr Address of success variable to reset on errors. 451 @param app Application structure for diagnostics, may be NULL. 452 */ 453 454 void 455 dk4gra_app_prepare_stroke( 456 dk4_gra_t *gra, 457 int *backptr, 458 dk4_app_t *app 459 ); 460 461 462 /** Prepare output structure for a combined fill and stroke operation. 463 Use this function before you start to construct a path you plan to 464 fill and stroke. 465 @param gra Output structure. 466 @param backptr Address of success variable to reset on errors. 467 @param app Application structure for diagnostics, may be NULL. 468 */ 469 470 void 471 dk4gra_app_prepare_fill_and_stroke( 472 dk4_gra_t *gra, 473 int *backptr, 474 dk4_app_t *app 475 ); 476 477 478 479 /** Fill current path. 480 Note: Use dk4gra_prepare_fill() before you start to construct a path 481 you plan to fill. 482 The value of the even-odd-rule flag is used to choose either 483 even-odd-rule or nonzero-winding-rule, the dk4gra_set_eorule() function 484 can be used to set the flag. 485 @param gra Output structure. 486 @param backptr Address of success variable to reset on errors. 487 @param app Application structure for diagnostics, may be NULL. 488 */ 489 490 void 491 dk4gra_app_fill( 492 dk4_gra_t *gra, 493 int *backptr, 494 dk4_app_t *app 495 ); 496 497 498 /** Stroke current path. 499 Note: Use dk4gra_app_prepare_stroke() before you start to construct a path 500 you plan to stroke. 501 @param gra Output structure. 502 @param backptr Address of success variable to reset on errors. 503 @param app Application structure for diagnostics, may be NULL. 504 */ 505 506 void 507 dk4gra_app_stroke( 508 dk4_gra_t *gra, 509 int *backptr, 510 dk4_app_t *app 511 ); 512 513 514 /** Fill and stroke current path. 515 Note: Use dk4gra_app_prepare_fill_and_stroke() before you start to construct 516 a path you plan to fill and stroke. 517 The value of the even-odd-rule flag is used to choose either 518 even-odd-rule or nonzero-winding-rule, the dk4gra_app_set_eorule() function 519 can be used to set the flag. 520 @param gra Output structure. 521 @param backptr Address of success variable to reset on errors. 522 @param app Application structure for diagnostics, may be NULL. 523 */ 524 525 void 526 dk4gra_app_fill_and_stroke( 527 dk4_gra_t *gra, 528 int *backptr, 529 dk4_app_t *app 530 ); 531 532 533 /** Use current path for clipping. 534 The value of the even-odd-rule flag is used to choose either 535 even-odd-rule or nonzero-winding-rule, the dk4gra_app_set_eorule() function 536 can be used to set the flag. 537 @param gra Output structure. 538 @param backptr Address of success variable to reset on errors. 539 @param app Application structure for diagnostics, may be NULL. 540 */ 541 542 void 543 dk4gra_app_clip( 544 dk4_gra_t *gra, 545 int *backptr, 546 dk4_app_t *app 547 ); 548 549 550 /** Pattern a region (clipping should be set to the path). 551 @param gra Output structure. 552 @param xl Left y coordinate. 553 @param xr Right x coordinate. 554 @param yb Bottom y coordinate. 555 @param yt Top y coordinate. 556 @param pn Pattern number. 557 @param backptr Address of success variable to reset on errors. 558 @param app Application structure for diagnostics, may be NULL. 559 */ 560 561 void 562 dk4gra_app_pattern( 563 dk4_gra_t *gra, 564 double xl, 565 double xr, 566 double yb, 567 double yt, 568 dk4_gra_pattern_t pn, 569 int *backptr, 570 dk4_app_t *app 571 ); 572 573 574 575 /** Start a new path and move to first point. 576 @param gra Output structure. 577 @param x X coordinate of start point. 578 @param y Y coordinate of start point. 579 @param bbptr Bounding box, may be NULL. 580 @param backptr Address of success variable to reset on errors. 581 @param app Application structure for diagnostics, may be NULL. 582 */ 583 584 void 585 dk4gra_app_newpath_moveto( 586 dk4_gra_t *gra, 587 double x, 588 double y, 589 dk4_bb_t *bbptr, 590 int *backptr, 591 dk4_app_t *app 592 ); 593 594 595 /** Add line from current point to new point to path. 596 @param gra Output structure. 597 @param x X coordinate of new point. 598 @param y Y coordinate of new point. 599 @param bbptr Bounding box, may be NULL. 600 @param backptr Address of success variable to reset on errors. 601 @param app Application structure for diagnostics, may be NULL. 602 */ 603 604 void 605 dk4gra_app_lineto( 606 dk4_gra_t *gra, 607 double x, 608 double y, 609 dk4_bb_t *bbptr, 610 int *backptr, 611 dk4_app_t *app 612 ); 613 614 615 /** Add Bezier curve segment from current point to new point in path. 616 @param gra Output structure. 617 @param xc1 X coordinate of first control point. 618 @param yc1 Y coordinate of first control point. 619 @param xc2 X coordinate of second control point. 620 @param yc2 Y coordinate of second control point. 621 @param x X coordinate of new point. 622 @param y Y coordinate of new point. 623 @param bbptr Bounding box, may be NULL. 624 @param backptr Address of success variable to reset on errors. 625 @param app Application structure for diagnostics, may be NULL. 626 */ 627 628 void 629 dk4gra_app_curveto( 630 dk4_gra_t *gra, 631 double xc1, 632 double yc1, 633 double xc2, 634 double yc2, 635 double x, 636 double y, 637 dk4_bb_t *bbptr, 638 int *backptr, 639 dk4_app_t *app 640 ); 641 642 643 /** Close current path. 644 @param gra Output structure. 645 @param backptr Address of success variable to reset on errors. 646 @param app Application structure for diagnostics, may be NULL. 647 */ 648 649 void 650 dk4gra_app_closepath( 651 dk4_gra_t *gra, 652 int *backptr, 653 dk4_app_t *app 654 ); 655 656 657 /** Create path for a circle. 658 @param gra Output structure. 659 @param xc Center point x coordinate. 660 @param yc Center point y coordinate. 661 @param r Radius. 662 @param bbptr Bounding box, may be NULL. 663 @param backptr Address of success variable to reset on errors. 664 @param app Application structure for diagnostics, may be NULL. 665 */ 666 667 void 668 dk4gra_app_circle( 669 dk4_gra_t *gra, 670 double xc, 671 double yc, 672 double r, 673 dk4_bb_t *bbptr, 674 int *backptr, 675 dk4_app_t *app 676 ); 677 678 679 /** Create path for rectangle parallel to axes, optionally with 680 rounded corners. 681 @param gra Output structure. 682 @param xl Left x coordinate. 683 @param xr Right x coordinate. 684 @param yb Bottom y coordinate. 685 @param yt Top y coordinate. 686 @param r Corner radius, maximum is a half of the smaller side length. 687 Use negative values to avoid rounded corners. 688 @param bbptr Bounding box, may be NULL. 689 @param backptr Address of success variable to reset on errors. 690 @param app Application structure for diagnostics, may be NULL. 691 */ 692 693 void 694 dk4gra_app_rectangle( 695 dk4_gra_t *gra, 696 double xl, 697 double xr, 698 double yb, 699 double yt, 700 double r, 701 dk4_bb_t *bbptr, 702 int *backptr, 703 dk4_app_t *app 704 ); 705 706 707 /** Add path for an arc. 708 @param gra Output structure. 709 @param xc Center point x coordinate. 710 @param yc Center point y coordinate. 711 @param ra Radius. 712 @param start Start angle in degree. 713 @param end End angle in degree. 714 @param cl Flag: Draw closed arc (piece of cake) instead of simple arc. 715 @param bbptr Bounding box, may be NULL. 716 @param backptr Address of success variable to reset on errors. 717 @param app Application structure for diagnostics, may be NULL. 718 */ 719 720 void 721 dk4gra_app_arc( 722 dk4_gra_t *gra, 723 double xc, 724 double yc, 725 double ra, 726 double start, 727 double end, 728 int cl, 729 dk4_bb_t *bbptr, 730 int *backptr, 731 dk4_app_t *app 732 ); 733 734 735 /** Create path for an ellipse. 736 @param gra Output structure. 737 @param xc Center point x coordinate. 738 @param yc Center point y coordinate. 739 @param rx Radius in x direction. 740 @param ry Radius in y direction. 741 @param rot Rotation counterclockwise in degree. 742 @param bbptr Bounding box, may be NULL. 743 @param backptr Address of success variable to reset on errors. 744 @param app Application structure for diagnostics, may be NULL. 745 */ 746 747 void 748 dk4gra_app_ellipse( 749 dk4_gra_t *gra, 750 double xc, 751 double yc, 752 double rx, 753 double ry, 754 double rot, 755 dk4_bb_t *bbptr, 756 int *backptr, 757 dk4_app_t *app 758 ); 759 760 761 /** Add simple (non-special) text to PGF graphics. 762 The text is shown in the current fill color (non-stroking color) 763 unless colspec is used to specify a color. 764 @param gra Output structure, must be initialized for PGF. 765 @param x X coordinate. 766 @param y Y coordinate. 767 @param rot Rotation counterclockwise in degree. 768 @param txt Text to show. 769 @param colspec Color specification, may be NULL to use fill color. 770 @param ie Text encoding, only used for char text. 771 @param ha Horizontal alignment. 772 @param va Vertical alignment. 773 @param fno Font number. 774 @param fsz Font size in pt. 775 @param fex Flag: Use exact font (1) or similar font (0). 776 @param uc2l UC to LaTeX conversion structure. 777 @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined. 778 @param backptr Address of success variable to reset on errors. 779 @param app Application structure for diagnostics, may be NULL. 780 */ 781 782 void 783 dk4gra_app_pgf_simple_text( 784 dk4_gra_t *gra, 785 double x, 786 double y, 787 double rot, 788 const dkChar *txt, 789 const char *colspec, 790 int ie, 791 dk4_text_align_h_t ha, 792 dk4_text_align_v_t va, 793 int fno, 794 double fsz, 795 dk4_gra_tf_t fex, 796 dk4_uc2l_t *uc2l, 797 int flags, 798 int *backptr, 799 dk4_app_t *app 800 ); 801 802 803 /** Add special text to PGF graphics. 804 The text is shown in the current fill color (non-stroking color) 805 unless colspec is used to specify a color. 806 @param gra Output structure, must be initialized for PGF. 807 @param x X coordinate. 808 @param y Y coordinate. 809 @param rot Rotation counterclockwise in degree. 810 @param txt Text to show. 811 @param colspec Color specification, may be NULL. 812 @param ha Horizontal alignment. 813 @param va Vertical alignment. 814 @param fno Font number. 815 @param fsz Font size in pt. 816 @param fex Flag: Use exact font. 817 @param flags Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined. 818 @param backptr Address of success variable to reset on errors. 819 @param app Application structure for diagnostics, may be NULL. 820 */ 821 822 void 823 dk4gra_app_pgf_special_text( 824 dk4_gra_t *gra, 825 double x, 826 double y, 827 double rot, 828 const char *txt, 829 const char *colspec, 830 dk4_text_align_h_t ha, 831 dk4_text_align_v_t va, 832 int fno, 833 double fsz, 834 dk4_gra_tf_t fex, 835 int flags, 836 int *backptr, 837 dk4_app_t *app 838 ); 839 840 841 /** Add bitmap image with coordinate transformations already calculated. 842 @param gra Output structure. 843 @param cotra Array containing coordinate transformations. 844 @param bif Bitmap image file. 845 @param fn Image file name. 846 @param fno Frame number. The frame number given here is used 847 by the PDF output driver only. You must call 848 dk4bif_set_current_frame() on the bitmap image file before calling 849 this function. 850 @param ifl Image flags. 851 @param backptr Address of success variable to reset on errors. 852 @param app Application structure for diagnostics, may be NULL. 853 */ 854 855 void 856 dk4gra_app_bif_cotra_image( 857 dk4_gra_t *gra, 858 double *cotra, 859 dk4_bif_t *bif, 860 const dkChar *fn, 861 size_t fno, 862 int ifl, 863 int *backptr, 864 dk4_app_t *app 865 ); 866 867 868 /** Add bitmap image XFig style. 869 @param gra Output structure. 870 @param xl Left x coordinate. 871 @param xr Right x coordinate. 872 @param yb Bottom y coordinate. 873 @param yt Top y coordinate. 874 @param bif Bitmap image file. 875 @param fn Image file name. 876 @param fno Frame number (0 for first frame). 877 @param pos Image positioning: 878 - 0 not rotated, not flipped, 879 - 1 rotated 90 degree counterclockwise, not flipped, 880 - 2 rotated 180 degree counterclockwise, not flipped, 881 - 3 rotated 270 degree counterclockwise, not flipped, 882 - 4 not rotated, flipped, 883 - 5 rotated 90 degree counterclockwise, flipped, 884 - 6 rotated 180 degree counterclockwise, flipped, 885 - 7 rotated 270 degree counterclockwise, flipped. 886 @param ifl Image flags. 887 @param bbptr Bounding box, may be NULL. 888 @param backptr Address of success variable to reset on errors. 889 @param app Application structure for diagnostics, may be NULL. 890 */ 891 892 void 893 dk4gra_app_bif_fig_image( 894 dk4_gra_t *gra, 895 double xl, 896 double xr, 897 double yb, 898 double yt, 899 dk4_bif_t *bif, 900 const dkChar *fn, 901 size_t fno, 902 int pos, 903 int ifl, 904 dk4_bb_t *bbptr, 905 int *backptr, 906 dk4_app_t *app 907 ); 908 909 910 /** Add bitmap image. 911 @param gra Output structure. 912 @param xl Left x coordinate. 913 @param xr Right x coordinate. 914 @param yb Bottom y coordinate. 915 @param yt Top y coordinate. 916 @param bif Bitmap image file data. 917 @param fn Image file name. 918 @param fno Frame number (0 for first frame). 919 @param ifl Image flags. 920 @param bbptr Bounding box, may be NULL. 921 @param backptr Address of success variable to reset on errors. 922 @param app Application structure for diagnostics, may be NULL. 923 */ 924 925 void 926 dk4gra_app_bif_image( 927 dk4_gra_t *gra, 928 double xl, 929 double xr, 930 double yb, 931 double yt, 932 dk4_bif_t *bif, 933 const dkChar *fn, 934 size_t fno, 935 int ifl, 936 dk4_bb_t *bbptr, 937 int *backptr, 938 dk4_app_t *app 939 ); 940 941 942 /** Add bitmap image. 943 @param gra Output structure. 944 @param xl Left x coordinate. 945 @param xr Right x coordinate. 946 @param yb Bottom y coordinate. 947 @param yt Top y coordinate. 948 @param fn Image file name. 949 @param fno Frame number (0 for first frame). 950 @param ctx Bitmap image conversion context, may be NULL. 951 @param ifl Image flags. 952 @param bbptr Bounding box, may be NULL. 953 @param backptr Address of success variable to reset on errors. 954 @param app Application structure for diagnostics, may be NULL. 955 */ 956 957 void 958 dk4gra_app_image( 959 dk4_gra_t *gra, 960 double xl, 961 double xr, 962 double yb, 963 double yt, 964 const dkChar *fn, 965 size_t fno, 966 dk4_cs_conv_ctx_t *ctx, 967 int ifl, 968 dk4_bb_t *bbptr, 969 int *backptr, 970 dk4_app_t *app 971 ); 972 973 974 /** Add bitmap image XFig style. 975 @param gra Output structure. 976 @param xl Left x coordinate. 977 @param xr Right x coordinate. 978 @param yb Bottom y coordinate. 979 @param yt Top y coordinate. 980 @param fn Image file name. 981 @param fno Frame number (0 for first frame). 982 @param ctx Bitmap image conversion context, may be NULL. 983 @param pos Image positioning: 984 - 0 not rotated, not flipped, 985 - 1 rotated 90 degree counterclockwise, not flipped, 986 - 2 rotated 180 degree counterclockwise, not flipped, 987 - 3 rotated 270 degree counterclockwise, not flipped, 988 - 4 not rotated, flipped, 989 - 5 rotated 90 degree counterclockwise, flipped, 990 - 6 rotated 180 degree counterclockwise, flipped, 991 - 7 rotated 270 degree counterclockwise, flipped. 992 @param ifl Image flags. 993 @param bbptr Bounding box, may be NULL. 994 @param backptr Address of success variable to reset on errors. 995 @param app Application structure for diagnostics, may be NULL. 996 */ 997 998 void 999 dk4gra_app_fig_image( 1000 dk4_gra_t *gra, 1001 double xl, 1002 double xr, 1003 double yb, 1004 double yt, 1005 const dkChar *fn, 1006 size_t fno, 1007 dk4_cs_conv_ctx_t *ctx, 1008 int pos, 1009 int ifl, 1010 dk4_bb_t *bbptr, 1011 int *backptr, 1012 dk4_app_t *app 1013 ); 1014 1015 1016 /** Set the font size for the documentclass line. 1017 @param gra Output structure, must be initialized for PGF. 1018 @param fs Font size in pt. 1019 @param backptr Address of success variable to reset on error. 1020 @param app Application structure for diagnostics, may be NULL. 1021 */ 1022 1023 void 1024 dk4gra_app_pgf_doc_font_size( 1025 dk4_gra_t *gra, 1026 double fs, 1027 int *backptr, 1028 dk4_app_t *app 1029 ); 1030 1031 1032 /** Add a preamble line. 1033 For font setup and package setup the lines added by this function 1034 replace the default contents. 1035 For other setup the lines added by this function are appended 1036 after the default contents. 1037 @param gra Output structure, must be initialized for PGF. 1038 @param line Line text without trailing newline. 1039 @param tp Line type: DK4_GRA_PREAMBLE_FONT, DK4_GRA_PREAMBLE_PACKAGE, 1040 or DK4_GRA_PREAMBLE_OTHER. 1041 @param backptr Address of success variable to reset on error. 1042 @param app Application structure for diagnostics, may be NULL. 1043 */ 1044 1045 void 1046 dk4gra_app_pgf_doc_preamble_line( 1047 dk4_gra_t *gra, 1048 const char *line, 1049 int tp, 1050 int *backptr, 1051 dk4_app_t *app 1052 ); 1053 1054 1055 #ifdef __cplusplus 1056 } 1057 #endif 1058 1059 /* vim: set ai sw=4 ts=4 : */ 1060 1061 #endif 1062