Leptonica 1.68
C Image Processing Library

rotatefastalt.c File Reference

Alternative (slightly slower) method for rotating color images, with antialiasing. This is here just for comparison with the better methods in the library. More...

#include <string.h>
#include <math.h>
#include "allheaders.h"

Go to the source code of this file.

Functions

static PIXpixRotateAMColorFast2 (PIX *pixs, l_float32 angle, l_uint8 grayval)
static PIXpixShiftRGB258 (PIX *pixs)
static void rotateAMColorFastLow2 (l_uint32 *datad, l_int32 w, l_int32 h, l_int32 wpld, l_uint32 *datas, l_int32 wpls, l_float32 angle, l_uint8 grayval)
 main (int argc, char **argv)

Variables

static const l_float32 VERY_SMALL_ANGLE = 0.001

Detailed Description

Alternative (slightly slower) method for rotating color images, with antialiasing. This is here just for comparison with the better methods in the library.

Definition in file rotatefastalt.c.


Function Documentation

PIX * pixRotateAMColorFast2 ( PIX pixs,
l_float32  angle,
l_uint8  grayval 
) [static]

pixRotateAMColorFast2()

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

Notes:

  • This rotates a color image about the image center. A positive angle gives a clockwise rotation.
  • It uses area mapping, dividing each pixel into 16 subpixels.
  • It creates a temporary 32-bit color image.
  • It is slightly slower than pixRotateAMColorFast(), which uses less memory because it does not create a temporary image.

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

Definition at line 95 of file rotatefastalt.c.

References ERROR_PTR, L_ABS, NULL, pixClone(), pixCreateTemplate(), pixDestroy(), pixGetData(), pixGetDepth(), pixGetHeight(), pixGetWidth(), pixGetWpl(), pixShiftRGB258(), PROCNAME, rotateAMColorFastLow2(), and VERY_SMALL_ANGLE.

Referenced by main().

PIX * pixShiftRGB258 ( PIX pixs) [static]

pixShiftRGB258()

Makes a new 32 bpp image with the R, G and B components right-shifted by 2, 5 and 8 bits, respectively.

Definition at line 138 of file rotatefastalt.c.

References ERROR_PTR, NULL, pixCreate(), pixGetData(), pixGetDepth(), pixGetHeight(), pixGetWidth(), pixGetWpl(), and PROCNAME.

Referenced by pixRotateAMColorFast2().

void rotateAMColorFastLow2 ( l_uint32 datad,
l_int32  w,
l_int32  h,
l_int32  wpld,
l_uint32 datas,
l_int32  wpls,
l_float32  angle,
l_uint8  grayval 
) [static]

rotateAMColorFastLow2()

Alternative version for fast color rotation

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

Definition at line 184 of file rotatefastalt.c.

Referenced by pixRotateAMColorFast2().

main ( int  argc,
char **  argv 
)

Variable Documentation

const l_float32 VERY_SMALL_ANGLE = 0.001 [static]

Definition at line 34 of file rotatefastalt.c.

Referenced by pixRotateAMColorFast2().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines