00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef EDGBLOB_H
00021 #define EDGBLOB_H
00022
00023 #include "scrollview.h"
00024 #include "varable.h"
00025 #include "img.h"
00026 #include "ocrblock.h"
00027 #include "coutln.h"
00028 #include "crakedge.h"
00029 #include "notdll.h"
00030
00031 #define BUCKETSIZE 16
00032
00033 class OL_BUCKETS
00034 {
00035 public:
00036 OL_BUCKETS(
00037 ICOORD bleft,
00038 ICOORD tright);
00039
00040 ~OL_BUCKETS () {
00041 delete[]buckets;
00042 }
00043 C_OUTLINE_LIST *operator () (
00044 inT16 x,
00045 inT16 y);
00046
00047 C_OUTLINE_LIST *start_scan() {
00048 for (index = 0; buckets[index].empty () && index < bxdim * bydim - 1;
00049 index++);
00050 return &buckets[index];
00051 }
00052
00053 C_OUTLINE_LIST *scan_next() {
00054 for (; buckets[index].empty () && index < bxdim * bydim - 1; index++);
00055 return &buckets[index];
00056 }
00057 inT32 count_children(
00058 C_OUTLINE *outline,
00059 inT32 max_count);
00060 inT32 outline_complexity(
00061 C_OUTLINE *outline,
00062 inT32 max_count,
00063 inT16 depth);
00064 void extract_children(
00065 C_OUTLINE *outline,
00066 C_OUTLINE_IT *it);
00067
00068 private:
00069 C_OUTLINE_LIST * buckets;
00070 inT16 bxdim;
00071 inT16 bydim;
00072 ICOORD bl;
00073 ICOORD tr;
00074 inT32 index;
00075 };
00076
00077 void extract_edges(
00078 #ifndef GRAPHICS_DISABLED
00079 ScrollView* window,
00080 #endif
00081 IMAGE *image,
00082 IMAGE *t_image,
00083 ICOORD page_tr,
00084 BLOCK *block
00085 );
00086 void outlines_to_blobs(
00087 BLOCK *block,
00088 ICOORD bleft,
00089 ICOORD tright,
00090 C_OUTLINE_LIST *outlines);
00091 void fill_buckets(
00092 C_OUTLINE_LIST *outlines,
00093 OL_BUCKETS *buckets
00094 );
00095 void empty_buckets(
00096 BLOCK *block,
00097 OL_BUCKETS *buckets
00098 );
00099 BOOL8 capture_children(
00100 OL_BUCKETS *buckets,
00101 C_BLOB_IT *reject_it,
00102 C_OUTLINE_IT *blob_it
00103 );
00104 #endif