comparison mupdf-source/thirdparty/leptonica/src/array.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_ARRAY_H
28 #define LEPTONICA_ARRAY_H
29
30 /*!
31 * \file array.h
32 *
33 * <pre>
34 * This file has typedefs for the following array structs:
35 * struct Numa array of floats
36 * struct Numaa
37 * struct L_Dna array of doubles
38 * struct L_Dnaa
39 * struct L_Dnahash
40 * struct Sarray array of C-strings
41 * struct L_Bytea array of bytes
42 *
43 * It contains definitions for:
44 * Numa interpolation flags
45 * Numa border flags
46 * Numa data type conversion to string
47 *
48 * Here are the non-image-related arrays in leptonica:
49 * * Numa, L_Dna, L_Ptra, Sarray:
50 * These have most of the typical operations of vectors, such as add,
51 * insert, remove and replace.
52 * * Numaa, L_Dnaa, L_Ptraa:
53 * These are arrays of float, double and generic pointer arrays.
54 * * L_Bytea:
55 * This is an array of bytes, analogous to a C++ string.
56 * * L_Dnahash:
57 * This is a simple hashing for integers, used in the jbig2 classifier.
58 * </pre>
59 */
60
61
62 /*------------------------------------------------------------------------*
63 * Array Structs *
64 *------------------------------------------------------------------------*/
65 /*! Number array: an array of floats */
66 typedef struct Numa NUMA;
67
68 /*! Array of number arrays */
69 typedef struct Numaa NUMAA;
70
71 /*! Double number array: an array of doubles */
72 typedef struct L_Dna L_DNA;
73
74 /*! Array of double number arrays */
75 typedef struct L_Dnaa L_DNAA;
76
77 /*! Array of double number arrays, used as a simple hash */
78 typedef struct L_DnaHash L_DNAHASH;
79
80 /*! String array: an array of C strings */
81 typedef struct Sarray SARRAY;
82
83 /*! Byte array (analogous to C++ "string") */
84 typedef struct L_Bytea L_BYTEA;
85
86
87 /*------------------------------------------------------------------------*
88 * Array flags *
89 *------------------------------------------------------------------------*/
90 /*! Numa Interpolation */
91 enum {
92 L_LINEAR_INTERP = 1, /*!< linear */
93 L_QUADRATIC_INTERP = 2 /*!< quadratic */
94 };
95
96 /*! Numa Border Adding */
97 enum {
98 L_CONTINUED_BORDER = 1, /*!< extended with same value */
99 L_SLOPE_BORDER = 2, /*!< extended with constant normal derivative */
100 L_MIRRORED_BORDER = 3 /*!< mirrored */
101 };
102
103 /*! Numa Data Conversion */
104 enum {
105 L_INTEGER_VALUE = 1, /*!< convert to integer */
106 L_FLOAT_VALUE = 2 /*!< convert to float */
107 };
108
109 #endif /* LEPTONICA_ARRAY_H */