Leptonica 1.85.0
Image processing and image analysis suite
Loading...
Searching...
No Matches
pix_internal.h
Go to the documentation of this file.
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_PIX_INTERNAL_H
28#define LEPTONICA_PIX_INTERNAL_H
29
173/*-------------------------------------------------------------------------*
174 * Basic Pix *
175 *-------------------------------------------------------------------------*/
176 /* The 'special' field is by default 0, but it can hold integers
177 * that direct non-default actions, e.g., in png and jpeg I/O. */
178
180struct Pix
181{
182 l_uint32 w;
183 l_uint32 h;
184 l_uint32 d;
185 l_uint32 spp;
186 l_uint32 wpl;
187 l_atomic refcount;
188 l_int32 xres;
190 l_int32 yres;
192 l_int32 informat;
193 l_int32 special;
194 char *text;
196 l_uint32 *data;
197};
198
201{
202 void *array;
203 l_int32 depth;
204 l_int32 nalloc;
205 l_int32 n;
206};
207
208
214{
215 l_uint8 blue;
216 l_uint8 green;
217 l_uint8 red;
218 l_uint8 alpha;
219};
220
221
222/*-------------------------------------------------------------------------*
223 * Array of pix *
224 *-------------------------------------------------------------------------*/
225 /* Serialization for primary data structures */
226#define PIXAA_VERSION_NUMBER 2
227#define PIXA_VERSION_NUMBER 2
228#define BOXA_VERSION_NUMBER 2
229#define BOXAA_VERSION_NUMBER 3
232struct Pixa
233{
234 l_int32 n;
235 l_int32 nalloc;
236 l_atomic refcount;
237 struct Pix **pix;
238 struct Boxa *boxa;
239};
240
242struct Pixaa
243{
244 l_int32 n;
245 l_int32 nalloc;
246 struct Pixa **pixa;
247 struct Boxa *boxa;
248};
249
250
251/*-------------------------------------------------------------------------*
252 * Basic rectangle and rectangle arrays *
253 *-------------------------------------------------------------------------*/
255struct Box
256{
257 l_int32 x;
258 l_int32 y;
259 l_int32 w;
260 l_int32 h;
261 l_atomic refcount;
262};
263
265struct Boxa
266{
267 l_int32 n;
268 l_int32 nalloc;
269 l_atomic refcount;
270 struct Box **box;
271};
272
274struct Boxaa
275{
276 l_int32 n;
277 l_int32 nalloc;
278 struct Boxa **boxa;
279};
280
281
282/*-------------------------------------------------------------------------*
283 * Array of points *
284 *-------------------------------------------------------------------------*/
285#define PTA_VERSION_NUMBER 1
288struct Pta
289{
290 l_int32 n;
291 l_int32 nalloc;
292 l_atomic refcount;
293 l_float32 *x, *y;
294};
295
296
297/*-------------------------------------------------------------------------*
298 * Array of Pta *
299 *-------------------------------------------------------------------------*/
301struct Ptaa
302{
303 l_int32 n;
304 l_int32 nalloc;
305 struct Pta **pta;
306};
307
308
309/*-------------------------------------------------------------------------*
310 * Pix accumulator container *
311 *-------------------------------------------------------------------------*/
313struct Pixacc
314{
315 l_int32 w;
316 l_int32 h;
317 l_int32 offset;
319 struct Pix *pix;
320};
321
322
323/*-------------------------------------------------------------------------*
324 * Pix tiling *
325 *-------------------------------------------------------------------------*/
328{
329 struct Pix *pix;
330 l_int32 nx;
331 l_int32 ny;
332 l_int32 w;
333 l_int32 h;
334 l_int32 xoverlap;
335 l_int32 yoverlap;
336 l_int32 strip;
337};
338
339
340/*-------------------------------------------------------------------------*
341 * FPix: pix with float array *
342 *-------------------------------------------------------------------------*/
343#define FPIX_VERSION_NUMBER 2
346struct FPix
347{
348 l_int32 w;
349 l_int32 h;
350 l_int32 wpl;
351 l_atomic refcount;
352 l_int32 xres;
354 l_int32 yres;
356 l_float32 *data;
357};
358
360struct FPixa
361{
362 l_int32 n;
363 l_int32 nalloc;
364 l_atomic refcount;
365 struct FPix **fpix;
366};
367
368
369/*-------------------------------------------------------------------------*
370 * DPix: pix with double array *
371 *-------------------------------------------------------------------------*/
372#define DPIX_VERSION_NUMBER 2
375struct DPix
376{
377 l_int32 w;
378 l_int32 h;
379 l_int32 wpl;
380 l_atomic refcount;
381 l_int32 xres;
383 l_int32 yres;
385 l_float64 *data;
386};
387
388
389/*-------------------------------------------------------------------------*
390 * PixComp: compressed pix *
391 *-------------------------------------------------------------------------*/
394{
395 l_int32 w;
396 l_int32 h;
397 l_int32 d;
398 l_int32 xres;
400 l_int32 yres;
402 l_int32 comptype;
404 char *text;
405 l_int32 cmapflag;
406 l_uint8 *data;
407 size_t size;
408};
409
410
411/*-------------------------------------------------------------------------*
412 * PixaComp: array of compressed pix *
413 *-------------------------------------------------------------------------*/
414#define PIXACOMP_VERSION_NUMBER 2
418{
419 l_int32 n;
420 l_int32 nalloc;
421 l_int32 offset;
422 struct PixComp **pixc;
423 struct Boxa *boxa;
424};
425
426#endif /* LEPTONICA_PIX_INTERNAL_H */
l_int32 y
l_int32 x
l_int32 w
l_int32 h
l_atomic refcount
l_int32 nalloc
l_int32 n
l_atomic refcount
struct Box ** box
l_int32 nalloc
struct Boxa ** boxa
l_int32 n
l_int32 h
l_int32 yres
l_float64 * data
l_int32 w
l_int32 xres
l_atomic refcount
l_int32 wpl
l_int32 w
l_atomic refcount
l_int32 wpl
l_int32 xres
l_int32 h
l_float32 * data
l_int32 yres
l_int32 nalloc
struct FPix ** fpix
l_atomic refcount
l_int32 n
l_int32 depth
l_int32 nalloc
l_int32 w
size_t size
l_uint8 * data
l_int32 cmapflag
l_int32 xres
char * text
l_int32 yres
l_int32 d
l_int32 h
l_int32 comptype
l_int32 yoverlap
l_int32 nx
l_int32 w
l_int32 xoverlap
struct Pix * pix
l_int32 h
l_int32 strip
l_int32 ny
l_uint32 d
l_uint32 * data
l_uint32 spp
struct PixColormap * colormap
l_atomic refcount
l_uint32 wpl
l_uint32 w
l_int32 xres
l_uint32 h
l_int32 yres
char * text
l_int32 special
l_int32 informat
l_int32 offset
l_int32 nalloc
l_int32 n
struct PixComp ** pixc
struct Boxa * boxa
struct Pix ** pix
l_atomic refcount
struct Boxa * boxa
l_int32 nalloc
l_int32 n
l_int32 nalloc
l_int32 n
struct Pixa ** pixa
struct Boxa * boxa
l_int32 offset
l_int32 h
l_int32 w
struct Pix * pix
l_atomic refcount
l_int32 nalloc
l_int32 n
l_float32 * y
struct Pta ** pta
l_int32 n
l_int32 nalloc
l_uint8 alpha
l_uint8 green
l_uint8 blue
l_uint8 red