mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-04 03:15:59 -04:00
Implement Texture::UpdateYUV()
This commit is contained in:
parent
e5c74863f0
commit
be15f8c1d6
@ -93,6 +93,11 @@ void Texture::Update(const Optional<Rect>& rect, const void* pixels, int pitch)
|
|||||||
throw Exception("SDL_UpdateTexture failed");
|
throw Exception("SDL_UpdateTexture failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Texture::UpdateYUV(const Optional<Rect>& rect, const Uint8* yplane, int ypitch, const Uint8* uplane, int upitch, const Uint8* vplane, int vpitch) {
|
||||||
|
if (SDL_UpdateYUVTexture(texture_, rect ? &*rect : nullptr, yplane, ypitch, uplane, upitch, vplane, vpitch) != 0)
|
||||||
|
throw Exception("SDL_UpdateYUVTexture failed");
|
||||||
|
}
|
||||||
|
|
||||||
void Texture::SetBlendMode(SDL_BlendMode blendMode) {
|
void Texture::SetBlendMode(SDL_BlendMode blendMode) {
|
||||||
if (SDL_SetTextureBlendMode(texture_, blendMode) != 0)
|
if (SDL_SetTextureBlendMode(texture_, blendMode) != 0)
|
||||||
throw Exception("SDL_SetTextureBlendMode failed");
|
throw Exception("SDL_SetTextureBlendMode failed");
|
||||||
|
@ -311,6 +311,25 @@ public:
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void Update(const Optional<Rect>& rect, const void* pixels, int pitch);
|
void Update(const Optional<Rect>& rect, const void* pixels, int pitch);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Update the given texture rectangle with new pixel data
|
||||||
|
///
|
||||||
|
/// \param[in] rect Rect representing the area to update, or NullOpt to
|
||||||
|
/// update the entire texture
|
||||||
|
/// \param[in] yplane Raw pixel data for the Y plane
|
||||||
|
/// \param[in] ypitch Number of bytes between rows of pixel data for the Y plane
|
||||||
|
/// \param[in] uplane Raw pixel data for the U plane
|
||||||
|
/// \param[in] upitch Number of bytes between rows of pixel data for the U plane
|
||||||
|
/// \param[in] vplane Raw pixel data for the V plane
|
||||||
|
/// \param[in] vpitch Number of bytes between rows of pixel data for the V plane
|
||||||
|
///
|
||||||
|
/// \throws SDL2pp::Exception
|
||||||
|
///
|
||||||
|
/// \see http://wiki.libsdl.org/SDL_UpdateYUVTexture
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
void UpdateYUV(const Optional<Rect>& rect, const Uint8* yplane, int ypitch, const Uint8* uplane, int upitch, const Uint8* vplane, int vpitch);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Set the blend mode for a texture, used by SDL2pp::Renderer::Copy
|
/// \brief Set the blend mode for a texture, used by SDL2pp::Renderer::Copy
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user