comparison mupdf-source/thirdparty/leptonica/src/gplot.h @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 /*====================================================================*
2 - Copyright (C) 2001 Leptonica. All rights reserved.
3 -
4 - Redistribution and use in source and binary forms, with or without
5 - modification, are permitted provided that the following conditions
6 - are met:
7 - 1. Redistributions of source code must retain the above copyright
8 - notice, this list of conditions and the following disclaimer.
9 - 2. Redistributions in binary form must reproduce the above
10 - copyright notice, this list of conditions and the following
11 - disclaimer in the documentation and/or other materials
12 - provided with the distribution.
13 -
14 - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY
18 - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22 - OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23 - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *====================================================================*/
26
27 #ifndef LEPTONICA_GPLOT_H
28 #define LEPTONICA_GPLOT_H
29
30 /*!
31 * \file gplot.h
32 *
33 * <pre>
34 * Data structures and parameters for generating gnuplot files
35 *
36 * We used to support X11 output, but recent versions of gnuplot do not
37 * support the X11 terminal. To get display to your screen, use
38 * GPLOT_PNG output; e.g.,
39 * gplotSimple1(na, GPLOT_PNG, "/tmp/someroot", ...);
40 * l_fileDisplay("/tmp/someroot.png", ...);
41 * </pre>
42 */
43
44 #define GPLOT_VERSION_NUMBER 1
45
46 #define NUM_GPLOT_STYLES 5
47 enum GPLOT_STYLE {
48 GPLOT_LINES = 0,
49 GPLOT_POINTS = 1,
50 GPLOT_IMPULSES = 2,
51 GPLOT_LINESPOINTS = 3,
52 GPLOT_DOTS = 4
53 };
54
55 #define NUM_GPLOT_OUTPUTS 6
56 enum GPLOT_OUTPUT {
57 GPLOT_NONE = 0,
58 GPLOT_PNG = 1,
59 GPLOT_PS = 2,
60 GPLOT_EPS = 3,
61 GPLOT_LATEX = 4,
62 GPLOT_PNM = 5,
63 };
64
65 enum GPLOT_SCALING {
66 GPLOT_LINEAR_SCALE = 0, /*!< default */
67 GPLOT_LOG_SCALE_X = 1,
68 GPLOT_LOG_SCALE_Y = 2,
69 GPLOT_LOG_SCALE_X_Y = 3
70 };
71
72 extern const char *gplotstylenames[]; /*!< used in gnuplot cmd file */
73 extern const char *gplotfileoutputs[]; /*!< used in simple file input */
74
75 /*! Data structure for generating gnuplot files */
76 struct GPlot
77 {
78 char *rootname; /*!< for cmd, data, output */
79 char *cmdname; /*!< command file name */
80 struct Sarray *cmddata; /*!< command file contents */
81 struct Sarray *datanames; /*!< data file names */
82 struct Sarray *plotdata; /*!< plot data (1 string/file) */
83 struct Sarray *plotlabels; /*!< label for each individual plot */
84 struct Numa *plotstyles; /*!< plot style for individual plots */
85 l_int32 nplots; /*!< current number of plots */
86 char *outname; /*!< output file name */
87 l_int32 outformat; /*!< GPLOT_OUTPUT values */
88 l_int32 scaling; /*!< GPLOT_SCALING values */
89 char *title; /*!< optional */
90 char *xlabel; /*!< optional x axis label */
91 char *ylabel; /*!< optional y axis label */
92 };
93 typedef struct GPlot GPLOT;
94
95
96 #endif /* LEPTONICA_GPLOT_H */