FAQ Database Discussion Community


Set the pixel format AND create texture from surface in SDL

c++,pixel,sdl-2,surface,pixelformat
I am currently trying some things using pixel manipulation and I would like to set the pixel format of a SDL_Surface. The problem here is that I am loading up an image with the SDL_image.h. So I have to create a texture from a surface like this: surface = IMG_Load(filePath);...

How to copy bytes from memory using pattern (YUYV packed to YUV420 planar)

c++,memory-management,video-processing,micro-optimization,pixelformat
Let's start with this: I have a block of memory of 16 bytes and I need to copy only even bytes to a 8 bytes block of memory. My current algorithm is doing something like this: unsigned int source_size = 16, destination_size = 8, i; unsigned char * source =...