al_get_video_frame(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸ’– NAME πŸ’–

okay so this is al_get_video_frame(3), and it lives in the Library Functions Manual β€” specifically the Allegro 5 API, bestie ✨

al_get_video_frame β€” your main-character function for grabbing the current video frame, no cap πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro5/allegro_video.h>

ALLEGRO_BITMAP *al_get_video_frame(ALLEGRO_VIDEO *video)

πŸ¦‹ DESCRIPTION πŸ¦‹

It returns the current video frame. The bitmap is owned by the video, so do not attempt to free it β€” that's not your job, and trying would be giving red flag energy 😭

Do not free this bitmap, bestie. The video owns it. Periodt. πŸ’…

The bitmap will stay valid until the next call to al_get_video_frame.

Videos often do not use square pixels, so the recommended way to draw a video frame would be using code like this β€” copy the vibe, not the ownership mistakes 🫢

float scale = 1.0; /* Adjust this to fit your target bitmap dimensions. */
ALLEGRO_BITMAP* frame = al_get_video_frame(video);
float sw = al_get_bitmap_width(frame);
float sh = al_get_bitmap_height(frame);
float dw = scale * al_get_video_scaled_width(video);
float dh = scale * al_get_video_scaled_height(video);
al_draw_scaled_bitmap(frame, 0, 0, sw, sh, 0, 0, dw, dh, 0);

🌸 SINCE 🌸

This icon landed in 5.1.0 β€” vintage-ish, but still slay ⭐


🧚 SEE ALSO 🧚

Go peek at those too, iykyk πŸ’œ


Final footer energy: source/version is the Allegro reference manual, this page is al_get_video_frame(3), and no date line showed up to the party β€” bye bestie, stay scaled and stay iconic πŸ’…βœ¨

πŸ“¦ where this page comes from
  • arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms