| Summary: | SDL_RenderCopy ARGB888 texture to IYUV texture, RGB color be lost | ||
|---|---|---|---|
| Product: | SDL | Reporter: | aitemp |
| Component: | render | Assignee: | Sam Lantinga <slouken> |
| Status: | NEW --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.1 | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
render is OPENGL |
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 */ }