diff options
| author | Syndamia <kamen@syndamia.com> | 2026-03-28 20:33:03 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2026-03-28 20:33:03 +0200 |
| commit | d31239eeeac4ea595b1d1e7063ab5d762809fb02 (patch) | |
| tree | aa0d5f426a2dc439ad863b9e3ec017c5776f528e /AnimationObject.c | |
| parent | 56099072165578b505a6c81e187cf392b9bd5a2e (diff) | |
| download | ppm_graphics-d31239eeeac4ea595b1d1e7063ab5d762809fb02.tar ppm_graphics-d31239eeeac4ea595b1d1e7063ab5d762809fb02.tar.gz ppm_graphics-d31239eeeac4ea595b1d1e7063ab5d762809fb02.zip | |
feat!: Complete rewrite
This new scheme will be much simpler
Diffstat (limited to 'AnimationObject.c')
| -rw-r--r-- | AnimationObject.c | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/AnimationObject.c b/AnimationObject.c deleted file mode 100644 index 63594ce..0000000 --- a/AnimationObject.c +++ /dev/null @@ -1,78 +0,0 @@ -#include "AnimationObject.h" -#include <math.h> -#include <stdlib.h> - -ARGB -AO_CheckerPattern(const Animation* anim, PixelRendererParams a) { - struct AO_CheckerPattern chp = *(struct AO_CheckerPattern*)a.priv; - - a.row /= chp.squareSize; - a.col /= chp.squareSize; - - if ((a.row + a.col) % 2 == 0) { - ARGB_set(&a.pixel, 0xFF000000); - } - else { - ARGB_set(&a.pixel, 0xFFFF00FF); - } - - return a.pixel; -} - -ARGB -AO_Square(const Animation* anim, PixelRendererParams a) { - struct AO_Square* set = (struct AO_Square*)a.priv; - - if (0 <= a.row && a.row <= set->width && 0 <= a.col && a.col <= set->height) { - ARGB_set(&a.pixel, set->color); - } - - return a.pixel; -} - -ARGB -AO_Circle(const Animation* anim, PixelRendererParams a) { - struct AO_Circle* cir = (struct AO_Circle*)a.priv; - - if (a.row * a.row + a.col * a.col < cir->radius * cir->radius) { - ARGB_set(&a.pixel, cir->color); - } - - return a.pixel; -} - -ARGB -AO_Image(const Animation* anim, PixelRendererParams a) { - struct AO_Image img = *(struct AO_Image*)a.priv; - - if (img.noRepeat == true && - (a.col < 0 || img.img.width * img.zoom <= a.col || - a.row < 0 || img.img.height * img.zoom <= a.row)) - { - return a.pixel; - } - - return *RGBImage_at(*(RGBImage*)a.priv, a.row / img.zoom, a.col / img.zoom); -} - -ARGB -AO_Line(const Animation* anim, PixelRendererParams a) { - struct AO_Line l = *(struct AO_Line*)a.priv; - - if (fabs(l.a * a.col + l.b * a.row + l.c) / sqrt(l.a * l.a + l.b * l.b) < l.width) { - ARGB_set(&a.pixel, l.color); - } - - return a.pixel; -} - -ARGB -AO_HorSegment(const Animation* anim, PixelRendererParams a) { - struct AO_HorSegment hs = *(struct AO_HorSegment*)a.priv; - - if (abs(a.row) <= hs.width && hs.left <= a.col && a.col <= hs.right) { - ARGB_set(&a.pixel, hs.color); - } - - return a.pixel; -} |
