/usr/include/leptonica/ccbord.h is in libleptonica-dev 1.70.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | /*====================================================================*
- Copyright (C) 2001 Leptonica. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*====================================================================*/
#ifndef LEPTONICA_CCBORD_H
#define LEPTONICA_CCBORD_H
/*
* ccbord.h
*
* CCBord: represents a single connected component
* CCBorda: an array of CCBord
*/
/* Use in ccbaStepChainsToPixCoords() */
enum {
CCB_LOCAL_COORDS = 1,
CCB_GLOBAL_COORDS = 2
};
/* Use in ccbaGenerateSPGlobalLocs() */
enum {
CCB_SAVE_ALL_PTS = 1,
CCB_SAVE_TURNING_PTS = 2
};
/* CCBord contains:
*
* (1) a minimally-clipped bitmap of the component (pix),
* (2) a boxa consisting of:
* for the primary component:
* (xul, yul) pixel location in global coords
* (w, h) of the bitmap
* for the hole components:
* (x, y) in relative coordinates in primary component
* (w, h) of the hole border (which is 2 pixels
* larger in each direction than the hole itself)
* (3) a pta ('start') of the initial border pixel location for each
* closed curve, all in relative coordinates of the primary
* component. This is given for the primary component,
* followed by the hole components, if any.
* (4) a refcount of the ccbord; used internally when a ccbord
* is accessed from a ccborda (array of ccbord)
* (5) a ptaa for the chain code for the border in relative
* coordinates, where the first pta is the exterior border
* and all other pta are for interior borders (holes)
* (6) a ptaa for the global pixel loc rendition of the border,
* where the first pta is the exterior border and all other
* pta are for interior borders (holes).
* This is derived from the local or step chain code.
* (7) a numaa for the chain code for the border as orientation
* directions between successive border pixels, where
* the first numa is the exterior border and all other
* numa are for interior borders (holes). This is derived
* from the local chain code. The 8 directions are 0 - 7.
* (8) a pta for a single chain for each c.c., comprised of outer
* and hole borders, plus cut paths between them, all in
* local coords.
* (9) a pta for a single chain for each c.c., comprised of outer
* and hole borders, plus cut paths between them, all in
* global coords.
*/
struct CCBord
{
struct Pix *pix; /* component bitmap (min size) */
struct Boxa *boxa; /* regions of each closed curve */
struct Pta *start; /* initial border pixel locations */
l_int32 refcount; /* number of handles; start at 1 */
struct Ptaa *local; /* ptaa of chain pixels (local) */
struct Ptaa *global; /* ptaa of chain pixels (global) */
struct Numaa *step; /* numaa of chain code (step dir) */
struct Pta *splocal; /* pta of single chain (local) */
struct Pta *spglobal; /* pta of single chain (global) */
};
typedef struct CCBord CCBORD;
struct CCBorda
{
struct Pix *pix; /* input pix (may be null) */
l_int32 w; /* width of pix */
l_int32 h; /* height of pix */
l_int32 n; /* number of ccbord in ptr array */
l_int32 nalloc; /* number of ccbord ptrs allocated */
struct CCBord **ccb; /* ccb ptr array */
};
typedef struct CCBorda CCBORDA;
#endif /* LEPTONICA_CCBORD_H */
|