Skip to content

openlab-vn-ua/ImageRotation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageRotation

Fast Image Rotation algorithms

Playground for studying and implementing fast image rotation and scale algoritms (with reasonable complexity).

The code here based on many references.

Usage

These functions uses typed RotatePixel_t for single pixel type (by defaut: 32 bit). You may specify your own pixel type size ROTATEPIXEL_T_BITS (say, you may #define ROTATEPIXEL_T_BITS 16 to use 16 bit wide pixles (values of 8/24/32 supported).

RotateDrawClip

To rotate image and put it to the destination, use:

void RotateDrawClip
(
    RotatePixel_t* pDstBase, int dstW, int dstH, int dstDelta,
    RotatePixel_t* pSrcBase, int srcW, int srcH, int srcDelta,
    float fDstRotCenterX, float fDstRotCenterY,
    float fSrcRotCenterX, float fSrcRotCenterY,
    float fAngle, float fScale
);

Peformance: ~150 MP/s on Intel i7-10700K CPU @ 3.80GHz for RotateDrawClip

RotateDrawFill

To rotate image and fill the whole destination, use:

void RotateDrawFill
(
    RotatePixel_t *pDstBase, int dstW, int dstH, int dstDelta,
    RotatePixel_t *pSrcBase, int srcW, int srcH, int srcDelta,
    float fDstRotCenterX, float fDstRotCenterY,
    float fSrcRotCenterX, float fSrcRotCenterY, 
    float fAngle, float fScale
);

References

The References (and Thanks to!):

Releases

No releases published

Packages

No packages published