diff options
author | Sam Lantinga <slouken@libsdl.org> | 2013-09-28 14:06:47 -0700 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2013-09-28 14:06:47 -0700 |
commit | 68152a1b9af7a391a79c6a2d2aa14e893718e95b (patch) | |
tree | 907728413a527c9497ddee37fc8646513b082242 /include/SDL_render.h | |
parent | acf6118b2f90c1f193852e050e2e5a13a70cfe44 (diff) | |
download | sdl-68152a1b9af7a391a79c6a2d2aa14e893718e95b.tar.gz |
Added optimized YUV texture upload path with SDL_UpdateYUVTexture()
Diffstat (limited to 'include/SDL_render.h')
-rw-r--r-- | include/SDL_render.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/SDL_render.h b/include/SDL_render.h index 1e24619f0..a765dc79f 100644 --- a/include/SDL_render.h +++ b/include/SDL_render.h @@ -382,6 +382,31 @@ extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, const void *pixels, int pitch); /** + * \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data. + * + * \param texture The texture to update + * \param rect A pointer to the rectangle of pixels to update, or NULL to + * update the entire texture. + * \param Yplane The raw pixel data for the Y plane. + * \param Ypitch The number of bytes between rows of pixel data for the Y plane. + * \param Uplane The raw pixel data for the U plane. + * \param Upitch The number of bytes between rows of pixel data for the U plane. + * \param Vplane The raw pixel data for the V plane. + * \param Vpitch The number of bytes between rows of pixel data for the V plane. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note You can use SDL_UpdateTexture() as long as your pixel data is + * a contiguous block of Y and U/V planes in the proper order, but + * this function is available if your pixel data is not contiguous. + */ +extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch); + +/** * \brief Lock a portion of the texture for write-only pixel access. * * \param texture The texture to lock for access, which was created with |