Leptonica
1.54
|
#include "allheaders.h"
Функции | |
PIXTILING * | pixTilingCreate (PIX *pixs, l_int32 nx, l_int32 ny, l_int32 w, l_int32 h, l_int32 xoverlap, l_int32 yoverlap) |
void | pixTilingDestroy (PIXTILING **ppt) |
l_int32 | pixTilingGetCount (PIXTILING *pt, l_int32 *pnx, l_int32 *pny) |
l_int32 | pixTilingGetSize (PIXTILING *pt, l_int32 *pw, l_int32 *ph) |
PIX * | pixTilingGetTile (PIXTILING *pt, l_int32 i, l_int32 j) |
l_int32 | pixTilingNoStripOnPaint (PIXTILING *pt) |
l_int32 | pixTilingPaintTile (PIX *pixd, l_int32 i, l_int32 j, PIX *pixs, PIXTILING *pt) |
PIXTILING* pixTilingCreate | ( | PIX * | pixs, |
l_int32 | nx, | ||
l_int32 | ny, | ||
l_int32 | w, | ||
l_int32 | h, | ||
l_int32 | xoverlap, | ||
l_int32 | yoverlap | ||
) |
Input: pixs (pix to be tiled; any depth; colormap OK) nx (number of tiles across image) ny (number of tiles down image) w (desired width of each tile) h (desired height of each tile) xoverlap (overlap into neighboring tiles on each side) yoverlap (overlap into neighboring tiles above and below) Return: pixtiling, or null on error
Notes: (1) We put a clone of pixs in the PixTiling. (2) The input to pixTilingCreate() for horizontal tiling can be either the number of tiles across the image or the approximate width of the tiles. If the latter, the actual width will be determined by making all tiles but the last of equal width, and making the last as close to the others as possible. The same consideration is applied independently to the vertical tiling. To specify tile width, set nx = 0; to specify the number of tiles horizontally across the image, set w = 0. (3) If pixs is to be tiled in one-dimensional strips, use ny = 1 for vertical strips and nx = 1 for horizontal strips. (4) The overlap must not be larger than the width or height of the leftmost or topmost tile(s).
void pixTilingDestroy | ( | PIXTILING ** | ppt | ) |
Input: &pt (<will be="" set="" to="" null="" before="" returning>="">) Return: void
l_int32 pixTilingGetCount | ( | PIXTILING * | pt, |
l_int32 * | pnx, | ||
l_int32 * | pny | ||
) |
Input: pt (pixtiling) &nx (<optional return>=""> nx; can be null) &ny (<optional return>=""> ny; can be null) Return: 0 if OK, 1 on error
l_int32 pixTilingGetSize | ( | PIXTILING * | pt, |
l_int32 * | pw, | ||
l_int32 * | ph | ||
) |
Input: pt (pixtiling) &w (<optional return>=""> tile width; can be null) &h (<optional return>=""> tile height; can be null) Return: 0 if OK, 1 on error
PIX* pixTilingGetTile | ( | PIXTILING * | pt, |
l_int32 | i, | ||
l_int32 | j | ||
) |
Input: pt (pixtiling) i (tile row index) j (tile column index) Return: pixd (tile with appropriate boundary (overlap) pixels added), or null on error
l_int32 pixTilingNoStripOnPaint | ( | PIXTILING * | pt | ) |
Input: pt (pixtiling) Return: 0 if OK, 1 on error
Notes: (1) The default for paint is to strip out the overlap pixels that are added by pixTilingGetTile(). However, some operations will generate an image with these pixels stripped off. This tells the paint operation not to strip the added boundary pixels when painting.
Input: pixd (dest: paint tile onto this, without overlap) i (tile row index) j (tile column index) pixs (source: tile to be painted from) pt (pixtiling struct) Return: 0 if OK, 1 on error