/usr/include/minidjvu/matcher.h is in libminidjvu-dev 0.8.svn.2010.05.06+dfsg-5+b4.
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 | /*
* matcher.h - matching patterns
*/
#ifndef MDJVU_MATCHER_H
#define MDJVU_MATCHER_H
typedef struct MinidjvuMatcherOptions *mdjvu_matcher_options_t;
MDJVU_FUNCTION mdjvu_matcher_options_t mdjvu_matcher_options_create(void);
MDJVU_FUNCTION void mdjvu_set_aggression(mdjvu_matcher_options_t, int level);
/* "matcher methods" (bitmask, not enum) */
#define MDJVU_MATCHER_DEFAULT 0
#define MDJVU_MATCHER_PITH_2 1
#define MDJVU_MATCHER_RAMPAGE 2
/* turn method on (|=) */
MDJVU_FUNCTION void mdjvu_use_matcher_method(mdjvu_matcher_options_t, int method);
MDJVU_FUNCTION void mdjvu_matcher_options_destroy(mdjvu_matcher_options_t);
/* To get an image ready for comparisons, one have to `prepare' it.
* A prepared image is called a `pattern' here.
* A pattern is mostly opaque except that its center may be retrieved.
*/
/* the struct itself is not defined in this header */
typedef struct MinidjvuPattern *mdjvu_pattern_t;
/* Allocate a pattern and calculate all necessary information.
* Memory consumption is byte per pixel + constant (with default matcher).
* The pattern would be independent on the bitmap given.
* (that is, you can destroy the bitmap immediately)
*/
#ifndef NO_MINIDJVU
MDJVU_FUNCTION mdjvu_pattern_t mdjvu_pattern_create(mdjvu_matcher_options_t, mdjvu_bitmap_t);
#endif
/* Same, but create from two-dimensional array.
*/
MDJVU_FUNCTION mdjvu_pattern_t mdjvu_pattern_create_from_array
(mdjvu_matcher_options_t, unsigned char **, int32 w, int32 h);
/* Destroy the pattern. */
MDJVU_FUNCTION void mdjvu_pattern_destroy(mdjvu_pattern_t);
/* get a center (in 1/MDJVU_CENTER_QUANT pixels; defined in the header for image) */
MDJVU_FUNCTION void mdjvu_pattern_get_center(mdjvu_pattern_t, int32 *cx, int32 *cy);
/* Compare patterns.
* Returns
* +1 if images are considered equivalent,
* -1 if they are considered totally different (just to speed up things),
* 0 if unknown, but probably different.
* Exchanging the order of arguments should not change the outcome.
* If you have found that A ~ B and B ~ C,
* then you may assume A ~ C regardless of this function's result.
*
* Options may be NULL.
*/
MDJVU_FUNCTION int mdjvu_match_patterns(mdjvu_pattern_t, mdjvu_pattern_t,
int32 dpi,
mdjvu_matcher_options_t);
/* Auxiliary functions used in pattern matcher (TODO: comment them) */
/* `result' and `pixels' may be the same array */
MDJVU_FUNCTION void mdjvu_soften_pattern(unsigned char **result,
unsigned char **pixels, int32 w, int32 h);
MDJVU_FUNCTION void mdjvu_get_gray_signature(
unsigned char **data, int32 w, int32 h,
unsigned char *result, int32 size);
MDJVU_FUNCTION void mdjvu_get_black_and_white_signature(
unsigned char **data, int32 w, int32 h,
unsigned char *result, int32 size);
#endif /* MDJVU_PATTERNS_H */
|