We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5295 - SDL_RenderCopy ARGB888 texture to IYUV texture, RGB color be lost
Summary: SDL_RenderCopy ARGB888 texture to IYUV texture, RGB color be lost
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: render (show other bugs)
Version: HG 2.1
Hardware: x86 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-22 06:45 UTC by aitemp
Modified: 2020-09-22 06:46 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aitemp 2020-09-22 06:45:54 UTC
SDL_Texture *YUVtexture = SDL_CreateTexture(render, SDL_PIXELFORMAT_IYUV, /* YV12/NV12... */, SDL_TEXTUREACCESS_TARGET, width, height);
if (texture)
{
SDL_UpdateYUVTexture(YUVtexture, NULL, yPlane, yPicth, uPlane, uPicth, vPlane, vPicth);

SDL_Texture *RGBtexture = SDL_CreateTexture(render, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, width, height);
SDL_UpdateTexture(RGBtexture, NULL, rgbData, rgbPitch);

SDL_SetRenderTarget(m_render, YUVtexture);
SDL_RenderCopy(m_render, RGBtexture, NULL, NULL); /* Copy RGB texture to YUV texture */
SDL_SetRenderTarget(m_render, NULL);

SDL_RenderCopy(m_render, YUVtexture, NULL, NULL); /* RGB texture without color */
}
Comment 1 aitemp 2020-09-22 06:46:50 UTC
render is OPENGL