/ocr/ocrservice/jni/hydrogen/include/leptonica/watershed.h

http://eyes-free.googlecode.com/ · C++ Header · 52 lines · 28 code · 4 blank · 20 comment · 0 complexity · afc830921f562ead3d83d40107c17b52 MD5 · raw file

  1. /*====================================================================*
  2. - Copyright (C) 2001 Leptonica. All rights reserved.
  3. - This software is distributed in the hope that it will be
  4. - useful, but with NO WARRANTY OF ANY KIND.
  5. - No author or distributor accepts responsibility to anyone for the
  6. - consequences of using this software, or for whether it serves any
  7. - particular purpose or works at all, unless he or she says so in
  8. - writing. Everyone is granted permission to copy, modify and
  9. - redistribute this source code, for commercial or non-commercial
  10. - purposes, with the following restrictions: (1) the origin of this
  11. - source code must not be misrepresented; (2) modified versions must
  12. - be plainly marked as such; and (3) this notice may not be removed
  13. - or altered from any source or modified source distribution.
  14. *====================================================================*/
  15. #ifndef LEPTONICA_WATERSHED_H
  16. #define LEPTONICA_WATERSHED_H
  17. /*
  18. * watershed.h
  19. *
  20. * Simple data structure to hold watershed data.
  21. * All data here is owned by the L_WShed and must be freed.
  22. */
  23. struct L_WShed
  24. {
  25. struct Pix *pixs; /* clone of input 8 bpp pixs */
  26. struct Pix *pixm; /* clone of input 1 bpp seed (marker) pixm */
  27. l_int32 mindepth; /* minimum depth allowed for a watershed */
  28. struct Pix *pixlab; /* 16 bpp label pix */
  29. struct Pix *pixt; /* scratch pix for computing wshed regions */
  30. void **lines8; /* line ptrs for pixs */
  31. void **linem1; /* line ptrs for pixm */
  32. void **linelab32; /* line ptrs for pixlab */
  33. void **linet1; /* line ptrs for pixt */
  34. struct Pixa *pixad; /* result: 1 bpp pixa of watersheds */
  35. struct Pta *ptas; /* pta of initial seed pixels */
  36. struct Numa *nasi; /* numa of seed indicators; 0 if completed */
  37. struct Numa *nash; /* numa of initial seed heights */
  38. struct Numa *namh; /* numa of initial minima heights */
  39. struct Numa *nalevels; /* result: numa of watershed levels */
  40. l_int32 nseeds; /* number of seeds (markers) */
  41. l_int32 nother; /* number of minima different from seeds */
  42. l_int32 *lut; /* lut for pixel indices */
  43. struct Numa **links; /* back-links into lut, for updates */
  44. l_int32 arraysize; /* size of links array */
  45. l_int32 debug; /* set to 1 for debug output */
  46. };
  47. typedef struct L_WShed L_WSHED;
  48. #endif /* LEPTONICA_WATERSHED_H */