0 votes

Hi guys I'm really stuck on this one. I'm trying to add some functionally from and external library via GD Native. It accepts image data as a uint8_t pointer or array with each RGBA channel being an element in the array:

uint8_t* image_data = (uint8_t*)malloc(1920 * 1080 * 4);

video_frame.p_data = image_data;

// Semi transparent Red as RGBA
image_data[0] = 255;
image_data[1] = 0;
image_data[3] = 0;
image_data[4] = 128;

From my understanding Godot outputs image data as a PoolByteArray but I have no idea how to go about converting it to uint8_t.
Any suggestions on how I can tackle this problem will be greatly appreciated.
Thanks

Godot version Godot 3.2.3.stable
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.