Leptonica 1.54
Файл src/rotateam.c
#include <stdio.h>
#include <string.h>
#include "allheaders.h"

Функции

PIX * pixRotateAM (PIX *pixs, l_float32 angle, l_int32 incolor)
PIX * pixRotateAMColor (PIX *pixs, l_float32 angle, l_uint32 colorval)
PIX * pixRotateAMGray (PIX *pixs, l_float32 angle, l_uint8 grayval)
PIX * pixRotateAMCorner (PIX *pixs, l_float32 angle, l_int32 incolor)
PIX * pixRotateAMColorCorner (PIX *pixs, l_float32 angle, l_uint32 fillval)
PIX * pixRotateAMGrayCorner (PIX *pixs, l_float32 angle, l_uint8 grayval)
PIX * pixRotateAMColorFast (PIX *pixs, l_float32 angle, l_uint32 colorval)

Переменные

static const l_float32 VERY_SMALL_ANGLE = 0.001

Функции

PIX* pixRotateAM ( PIX *  pixs,
l_float32  angle,
l_int32  incolor 
)

pixRotateAM()

Input: pixs (2, 4, 8 bpp gray or colormapped, or 32 bpp RGB) angle (radians; clockwise is positive) incolor (L_BRING_IN_WHITE, L_BRING_IN_BLACK) Return: pixd, or null on error

Notes: (1) Rotates about image center. (2) A positive angle gives a clockwise rotation. (3) Brings in either black or white pixels from the boundary.

PIX* pixRotateAMColor ( PIX *  pixs,
l_float32  angle,
l_uint32  colorval 
)

pixRotateAMColor()

Input: pixs (32 bpp) angle (radians; clockwise is positive) colorval (e.g., 0 to bring in BLACK, 0xffffff00 for WHITE) Return: pixd, or null on error

Notes: (1) Rotates about image center. (2) A positive angle gives a clockwise rotation. (3) Specify the color to be brought in from outside the image.

PIX* pixRotateAMColorCorner ( PIX *  pixs,
l_float32  angle,
l_uint32  fillval 
)

pixRotateAMColorCorner()

Input: pixs angle (radians; clockwise is positive) colorval (e.g., 0 to bring in BLACK, 0xffffff00 for WHITE) Return: pixd, or null on error

Notes: (1) Rotates the image about the UL corner. (2) A positive angle gives a clockwise rotation. (3) Specify the color to be brought in from outside the image.

PIX* pixRotateAMColorFast ( PIX *  pixs,
l_float32  angle,
l_uint32  colorval 
)

pixRotateAMColorFast()

Input: pixs angle (radians; clockwise is positive) colorval (e.g., 0 to bring in BLACK, 0xffffff00 for WHITE) Return: pixd, or null on error

Notes: (1) This rotates a color image about the image center. (2) A positive angle gives a clockwise rotation. (3) It uses area mapping, dividing each pixel into 16 subpixels. (4) It is about 10% to 20% faster than the more accurate linear interpolation function pixRotateAMColor(), which uses 256 subpixels.

*** Warning: implicit assumption about RGB component ordering ***

PIX* pixRotateAMCorner ( PIX *  pixs,
l_float32  angle,
l_int32  incolor 
)

pixRotateAMCorner()

Input: pixs (1, 2, 4, 8 bpp gray or colormapped, or 32 bpp RGB) angle (radians; clockwise is positive) incolor (L_BRING_IN_WHITE, L_BRING_IN_BLACK) Return: pixd, or null on error

Notes: (1) Rotates about the UL corner of the image. (2) A positive angle gives a clockwise rotation. (3) Brings in either black or white pixels from the boundary.

PIX* pixRotateAMGray ( PIX *  pixs,
l_float32  angle,
l_uint8  grayval 
)

pixRotateAMGray()

Input: pixs (8 bpp) angle (radians; clockwise is positive) grayval (0 to bring in BLACK, 255 for WHITE) Return: pixd, or null on error

Notes: (1) Rotates about image center. (2) A positive angle gives a clockwise rotation. (3) Specify the grayvalue to be brought in from outside the image.

PIX* pixRotateAMGrayCorner ( PIX *  pixs,
l_float32  angle,
l_uint8  grayval 
)

pixRotateAMGrayCorner()

Input: pixs angle (radians; clockwise is positive) grayval (0 to bring in BLACK, 255 for WHITE) Return: pixd, or null on error

Notes: (1) Rotates the image about the UL corner. (2) A positive angle gives a clockwise rotation. (3) Specify the grayvalue to be brought in from outside the image.


Переменные

const l_float32 VERY_SMALL_ANGLE = 0.001 [static]