4 Vertical Mirror alogorithm
9 #include "core/GP_Debug.h"
10 #include "core/GP_GetPutPixel.h"
11 #include "GP_Rotate.h"
13 %% for ps in pixelsizes
14 int GP_FilterRotate90_Raw_{{ ps.suffix }}(const GP_Context *src, GP_Context *dst,
15 GP_ProgressCallback *callback)
19 GP_DEBUG(1, "Rotating image by 90 %ux%u", src->w, src->h);
21 for (x = 0; x < src->w; x++) {
22 for (y = 0; y < src->h; y++) {
23 uint32_t yr = src->h - y - 1;
24 GP_PutPixel_Raw_{{ ps.suffix }}(dst, yr, x, GP_GetPixel_Raw_{{ ps.suffix }}(src, x, y));
27 if (GP_ProgressCallbackReport(callback, x, src->w, src->h))
31 GP_ProgressCallbackDone(callback);
37 int GP_FilterRotate90_Raw(const GP_Context *src, GP_Context *dst,
38 GP_ProgressCallback *callback)
40 GP_FN_RET_PER_BPP_CONTEXT(GP_FilterRotate90_Raw, src, src, dst, callback);
44 %% for ps in pixelsizes
45 int GP_FilterRotate270_Raw_{{ ps.suffix }}(const GP_Context *src, GP_Context *dst,
46 GP_ProgressCallback *callback)
50 GP_DEBUG(1, "Rotating image by 270 %ux%u", src->w, src->h);
52 for (x = 0; x < src->w; x++) {
53 for (y = 0; y < src->h; y++) {
54 uint32_t xr = src->w - x - 1;
55 GP_PutPixel_Raw_{{ ps.suffix }}(dst, y, xr, GP_GetPixel_Raw_{{ ps.suffix }}(src, x, y));
58 if (GP_ProgressCallbackReport(callback, x, src->w, src->h))
62 GP_ProgressCallbackDone(callback);
68 int GP_FilterRotate270_Raw(const GP_Context *src, GP_Context *dst,
69 GP_ProgressCallback *callback)
71 GP_FN_RET_PER_BPP_CONTEXT(GP_FilterRotate270_Raw, src, src, dst, callback);