This file is indexed.

/usr/include/libhocr/ho_layout.h is in libhocr-dev 0.10.17-2.

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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
/***************************************************************************
 *            ho_layout.h
 *
 *  Fri Aug 12 20:13:33 2005
 *  Copyright  2005-2007  Yaacov Zamir
 *  <kzamir@walla.co.il>
 ****************************************************************************/

/*  
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/** @file ho_layout.h
    @brief libhocr C language header.
    
    libhocr - LIBrary for Hebrew Optical Character Recognition 
*/

#ifndef HO_LAYOUT_H
#define HO_LAYOUT_H 1

#include <ho_bitmap.h>
#include <ho_objmap.h>

/** @struct ho_layout
  @brief libhocr layout struct
*/
typedef struct
{
  /* paragraph settings type */
  char font_spacing_code;
  unsigned char type;
  unsigned char dir;
  int number_of_fonts;
  
  /* black and white text image */
  ho_bitmap *m_page_text;
  ho_bitmap *m_page_blocks_mask;

  /* line text and masks arrays [number of text blocks] */
  int n_blocks;
  ho_bitmap **m_blocks_text;
  ho_bitmap **m_blocks_lines_mask;

  /* words text and masks arrays [number of text blocks][number of lines in
   * block] */
  int *n_lines;
  ho_bitmap ***m_lines_text;
  ho_bitmap ***m_lines_line_mask;
  ho_bitmap ***m_lines_words_mask;

  /* number of words in a line */
  int **n_words;
  ho_bitmap ****m_words_text;
  ho_bitmap ****m_words_line_mask;
  ho_bitmap ****m_words_font_mask;

  int ***n_fonts;

} ho_layout;

/**
 new ho_layout 
 @param m_page_text a pointer to a text bitmap
 @param font_spacing_code -3 tight .. 0 .. 3 spaced
 @param type free text blocks or boxed 
 @param dir true-ltr false-rtl
 @return a newly allocated layout
 */
ho_layout *ho_layout_new (const ho_bitmap * m_page_text,
  const char font_spacing_code, const unsigned char type, const unsigned char dir);

/**
 free a ho_layout
 @param l_page a pointer to a ho_layout 
 @return FALSE
 */
int ho_layout_free (ho_layout * l_page);

/**
 create a text blocks mask and count blocks in n_blocks
 @param l_page a pointer to a ho_layout 
 @return FALSE
 */
int ho_layout_create_block_mask (ho_layout * l_page);

/**
 create a text lines mask and count lines in n_lines[block_index]
 @param l_page a pointer to a ho_layout 
 @param block_index the block_index to work on
 @return FALSE
 */
int ho_layout_create_line_mask (ho_layout * l_page, const int block_index);

/**
 create a text word mask and count words in n_words[block_index][line_index]
 @param l_page a pointer to a ho_layout
 @param block_index the block_index to work on
 @param line_index the line_index to work on
 @return FALSE
 */
int ho_layout_create_word_mask (ho_layout * l_page, const int block_index,
  const int line_index);

/**
 create a text font mask and count fonts in n_fontss[block_index][line_index][word_index]
 @param l_page a pointer to a ho_layout
 @param block_index the block_index to work on
 @param line_index the line_index to work on
 @param word_index the word_index to work on
 @param slicing_threshold the slicing threshold
 @param slicing_width the slicing width
 @param line_leeway the line leeway below and above line
 @return FALSE
 */
int ho_layout_create_font_mask (ho_layout * l_page, const int block_index,
  const int line_index, const int word_index,
  const unsigned char slicing_threshold, const unsigned char slicing_width,
  const unsigned char line_leeway);

/**
 new ho_bitamp of the text in a layout block
 
 @param l_page the ho_layout to use
 @param block_index block index
 @return newly allocated ho_bitmap
 */
ho_bitmap *ho_layout_get_block_text (const ho_layout * l_page, int block_index);

/**
 new ho_bitamp of the text in a layout line
 
 @param l_page the ho_layout to use
 @param block_index block index
 @param line_index line index
 @return newly allocated ho_bitmap
 */
ho_bitmap *ho_layout_get_line_text (const ho_layout * l_page, int block_index,
  int line_index);

/**
 new ho_bitamp of the text in a layout word
 
 @param l_page the ho_layout to use
 @param block_index block index
 @param line_index line index
 @param word_index word index
 @return newly allocated ho_bitmap
 */
ho_bitmap *ho_layout_get_word_text (const ho_layout * l_page, int block_index,
  int line_index, int word_index);

/**
 new ho_bitamp of the text in a layout font
 
 @param l_page the ho_layout to use
 @param block_index block index
 @param line_index line index
 @param word_index word index
 @param font_index font index
 @return newly allocated ho_bitmap
 */
ho_bitmap *ho_layout_get_font_text (const ho_layout * l_page, int block_index,
  int line_index, int word_index, int font_index);

/**
 new ho_bitamp of the line in a layout line
 
 @param l_page the ho_layout to use
 @param block_index block index
 @param line_index line index
 @return newly allocated ho_bitmap
 */
ho_bitmap *ho_layout_get_line_line_mask (const ho_layout * l_page, int block_index,
  int line_index);

/**
 new ho_bitamp of the line in a layout word
 
 @param l_page the ho_layout to use
 @param block_index block index
 @param line_index line index
 @param word_index word index
 @return newly allocated ho_bitmap
 */
ho_bitmap *ho_layout_get_word_line_mask (const ho_layout * l_page, int block_index,
  int line_index, int word_index);

/**
 new ho_bitamp of the line in a layout font
 
 @param l_page the ho_layout to use
 @param block_index block index
 @param line_index line index
 @param word_index word index
 @param font_index font index
 @return newly allocated ho_bitmap
 */
ho_bitmap *ho_layout_get_font_line_mask (const ho_layout * l_page, int block_index,
  int line_index, int word_index, int font_index);

#endif /* HO_LAYOUT_H */