/usr/include/minidjvu/base/5image.h is in libminidjvu-dev 0.8.svn.2010.05.06+dfsg-5build1.
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 | /*
* 5image.h - manipulating split images, the main data structure of minidjvu
*/
typedef struct MinidjvuImage *mdjvu_image_t;
/* Create a split image with the given read-only parameters.
* The created image will not contain any blits or bitmaps.
* Resolution is set to default (300 dpi) and may be changed later.
*/
MDJVU_FUNCTION mdjvu_image_t mdjvu_image_create(int32 width, int32 height);
/* Destroy a split image, freeing all its bitmaps and blits. */
MDJVU_FUNCTION void mdjvu_image_destroy(mdjvu_image_t);
/* Get the width of a split image. */
MDJVU_FUNCTION int32 mdjvu_image_get_width(mdjvu_image_t);
/* Get the height of a split image. */
MDJVU_FUNCTION int32 mdjvu_image_get_height(mdjvu_image_t);
/* Free some memory by indication that no additions to the image are planned.
* You still may do any additions after freezing.
* Calling freeze() after every addition is possible, but inefficient.
*/
MDJVU_FUNCTION void mdjvu_image_freeze(mdjvu_image_t);
/* Remove white margins from each bitmap and adjust blits accordingly. */
MDJVU_FUNCTION void mdjvu_image_remove_bitmap_margins(mdjvu_image_t);
/* _______________________________ blits _______________________________ */
/* Get the number of blits in a split image. */
MDJVU_FUNCTION int32 mdjvu_image_get_blit_count(mdjvu_image_t);
MDJVU_FUNCTION int32 mdjvu_image_get_blit_x(mdjvu_image_t, int32 blit_index);
MDJVU_FUNCTION int32 mdjvu_image_get_blit_y(mdjvu_image_t, int32 blit_index);
MDJVU_FUNCTION mdjvu_bitmap_t mdjvu_image_get_blit_bitmap(mdjvu_image_t, int32 blit_index);
MDJVU_FUNCTION void mdjvu_image_set_blit_x(mdjvu_image_t, int32 blit_index, int32 x);
MDJVU_FUNCTION void mdjvu_image_set_blit_y(mdjvu_image_t, int32 blit_index, int32 y);
MDJVU_FUNCTION void mdjvu_image_set_blit_bitmap(mdjvu_image_t, int32 blit_index, mdjvu_bitmap_t);
MDJVU_FUNCTION int32 mdjvu_image_add_blit(mdjvu_image_t, int32 x, int32 y, mdjvu_bitmap_t);
MDJVU_FUNCTION void mdjvu_image_exchange_blits
(mdjvu_image_t, int32, int32);
/* It's a good idea to remove NULL blits (blits with NULL blit bitmap) as soon
* as possible because such jokes are poorly understood by most algorithms.
*/
MDJVU_FUNCTION void mdjvu_image_remove_NULL_blits(mdjvu_image_t);
/* _________________________ bitmaps in an image _______________________ */
/* Get the number of bitmaps in a split image. */
MDJVU_FUNCTION int32 mdjvu_image_get_bitmap_count(mdjvu_image_t);
/* Get a bitmap by index. (index may be from 0 to get_bitmap_count() - 1. */
MDJVU_FUNCTION mdjvu_bitmap_t mdjvu_image_get_bitmap(mdjvu_image_t, int32);
/* Test if the bitmap belongs to this image (uses constant time). */
MDJVU_FUNCTION int mdjvu_image_has_bitmap(mdjvu_image_t image, mdjvu_bitmap_t bitmap);
/* Append a bitmap. */
MDJVU_FUNCTION int32 mdjvu_image_add_bitmap(mdjvu_image_t, mdjvu_bitmap_t);
/* Exchange two bitmaps (bitmap pointers) and all additional info they have.
* Does not change the image look; does not touch blits.
*/
MDJVU_FUNCTION void mdjvu_image_exchange_bitmaps(mdjvu_image_t, int32, int32);
/* Create a new bitmap and add it. */
MDJVU_FUNCTION mdjvu_bitmap_t
mdjvu_image_new_bitmap(mdjvu_image_t, int32 w, int32 h);
MDJVU_FUNCTION void mdjvu_image_delete_bitmap(mdjvu_image_t, mdjvu_bitmap_t);
/*
* Returns 1 if the bitmap indices are set correctly.
* (for using with assert())
*/
MDJVU_FUNCTION int mdjvu_image_check_indices(mdjvu_image_t);
/*
* Don't run this on dictionaries.
* Also, this doesn't detect usage by substitutions,
* so be sure to run mdjvu_adjust() before.
*/
MDJVU_FUNCTION void mdjvu_image_remove_unused_bitmaps(mdjvu_image_t);
/* ______________________ additional info for images ___________________ */
MDJVU_FUNCTION int32 mdjvu_image_get_resolution(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_set_resolution(mdjvu_image_t, int32 dpi);
MDJVU_FUNCTION void mdjvu_image_set_dictionary(mdjvu_image_t, mdjvu_image_t);
MDJVU_FUNCTION mdjvu_image_t mdjvu_image_get_dictionary(mdjvu_image_t);
/* ______________________ additional info for bitmaps __________________ */
/* Prototypes */
MDJVU_FUNCTION int mdjvu_image_has_prototypes
(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_enable_prototypes
(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_disable_prototypes
(mdjvu_image_t);
MDJVU_FUNCTION mdjvu_bitmap_t mdjvu_image_get_prototype
(mdjvu_image_t, mdjvu_bitmap_t);
MDJVU_FUNCTION void mdjvu_image_set_prototype
(mdjvu_image_t, mdjvu_bitmap_t, mdjvu_bitmap_t prototype);
/* Substitutions */
MDJVU_FUNCTION int mdjvu_image_has_substitutions(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_enable_substitutions(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_disable_substitutions(mdjvu_image_t);
MDJVU_FUNCTION mdjvu_bitmap_t
mdjvu_image_get_substitution(mdjvu_image_t, mdjvu_bitmap_t);
MDJVU_FUNCTION void
mdjvu_image_set_substitution(mdjvu_image_t, mdjvu_bitmap_t, mdjvu_bitmap_t);
/* no-substitution flag
* bitmaps having this flag can't have a substitution
* and can't serve as substitution to others.
* This is for small pieces of large picture, which are not to be displaced.
*/
MDJVU_FUNCTION int mdjvu_image_has_not_a_letter_flags(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_enable_not_a_letter_flags(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_disable_not_a_letter_flags(mdjvu_image_t);
MDJVU_FUNCTION int mdjvu_image_get_not_a_letter_flag
(mdjvu_image_t, mdjvu_bitmap_t);
MDJVU_FUNCTION void mdjvu_image_set_not_a_letter_flag
(mdjvu_image_t, mdjvu_bitmap_t, int new_val);
/* suspiciously big flag */
MDJVU_FUNCTION int mdjvu_image_has_suspiciously_big_flags(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_enable_suspiciously_big_flags(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_disable_suspiciously_big_flags(mdjvu_image_t);
MDJVU_FUNCTION int mdjvu_image_get_suspiciously_big_flag
(mdjvu_image_t, mdjvu_bitmap_t);
MDJVU_FUNCTION void mdjvu_image_set_suspiciously_big_flag
(mdjvu_image_t, mdjvu_bitmap_t, int new_val);
/* masses */
MDJVU_FUNCTION int mdjvu_image_has_masses(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_enable_masses(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_disable_masses(mdjvu_image_t);
MDJVU_FUNCTION int32 mdjvu_image_get_mass(mdjvu_image_t, mdjvu_bitmap_t);
/* centers */
/* Centers are stored in 1/MDJVU_CENTER_QUANT of pixels.
* A center is found by pattern matcher.
*/
#define MDJVU_CENTER_QUANT 8
MDJVU_FUNCTION int mdjvu_image_has_centers(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_enable_centers(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_disable_centers(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_get_center(mdjvu_image_t, mdjvu_bitmap_t, int32 *px, int32 *py);
MDJVU_FUNCTION void mdjvu_image_set_center(mdjvu_image_t, mdjvu_bitmap_t, int32 x, int32 y);
/* dictionary index */
MDJVU_FUNCTION int mdjvu_image_has_dictionary_indices(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_enable_dictionary_indices(mdjvu_image_t);
MDJVU_FUNCTION void mdjvu_image_disable_dictionary_indices(mdjvu_image_t);
MDJVU_FUNCTION int32 mdjvu_image_get_dictionary_index(mdjvu_image_t, mdjvu_bitmap_t);
MDJVU_FUNCTION void mdjvu_image_set_dictionary_index(mdjvu_image_t image, mdjvu_bitmap_t b, int32 v);
/* sort bitmaps according to blits */
MDJVU_FUNCTION void mdjvu_image_sort_bitmaps(mdjvu_image_t img);
/* _______________________________ wrapper _____________________________ */
/* DO NOT USE THIS YET */
#ifdef MINIDJVU_WRAPPERS
struct MinidjvuImage
{
inline int32 get_resolution()
{return mdjvu_image_get_resolution(this);}
inline void set_resolution(int32 dpi)
{return mdjvu_image_set_resolution(this, dpi);}
};
#endif
|