diff options
| author | Syndamia <kamen@syndamia.com> | 2026-03-15 12:23:21 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2026-03-15 12:23:21 +0200 |
| commit | 2202e87c466803eeaddd974006aa9950d8e0d067 (patch) | |
| tree | 55cac9843e5789ac6ff29345ecd4fc44775c6b31 /Animation.h | |
| parent | 47e28b44615b9b068776f61b8741ea8692461c1d (diff) | |
| download | ppm_graphics-master.tar ppm_graphics-master.tar.gz ppm_graphics-master.zip | |
Diffstat (limited to 'Animation.h')
| -rw-r--r-- | Animation.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Animation.h b/Animation.h new file mode 100644 index 0000000..96fa765 --- /dev/null +++ b/Animation.h @@ -0,0 +1,29 @@ +#ifndef _ANIMATION +#define _ANIMATION + +#include "RGBImage.h" + +struct AnimationEventNode; +typedef struct AnimationEventNode AnimationEventNode; + +typedef struct Animation { + u32 width; + u32 height; + u32 frameCount; + u32 duplicateFrames; + + RGBImage frameBuffer; + AnimationEventNode* events; +} Animation; + +typedef ARGB (*PixelRenderer)(const Animation* anim, u32 currentFrame, ARGB pixel, i32 row, i32 col, void* priv); + +AnimationEventNode* AnimationEventNode_new(u32 startFrame, u32 endFrame, PixelRenderer renderCallback, void* privateData); +Animation Animation_new(u32 width, u32 height, u32 frameCount); +void Animation_free(Animation anim); +void Animation_delete(Animation* anim); + +void Animation_pushEvent(Animation* anim, u32 startFrame, u32 endFrame, PixelRenderer renderer, void* privateData); +void Animation_render(Animation* anim); + +#endif /* _ANIMATION */ |
