sdlUpdateYuvTexture function

int sdlUpdateYuvTexture(
  1. Pointer<SdlTexture> texture,
  2. Pointer<SdlRect> rect,
  3. Pointer<Uint8> yplane,
  4. int ypitch,
  5. Pointer<Uint8> uplane,
  6. int upitch,
  7. Pointer<Uint8> vplane,
  8. int vpitch,
)

Update a rectangle within a planar YV12 or IYUV texture with new pixel data.

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.

\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 \returns 0 on success or -1 if the texture is not valid; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.1.

\sa SDL_UpdateTexture

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)

Implementation

int sdlUpdateYuvTexture(
    Pointer<SdlTexture> texture,
    Pointer<SdlRect> rect,
    Pointer<Uint8> yplane,
    int ypitch,
    Pointer<Uint8> uplane,
    int upitch,
    Pointer<Uint8> vplane,
    int vpitch) {
  final sdlUpdateYuvTextureLookupFunction = libSdl2.lookupFunction<
      Int32 Function(
          Pointer<SdlTexture> texture,
          Pointer<SdlRect> rect,
          Pointer<Uint8> yplane,
          Int32 ypitch,
          Pointer<Uint8> uplane,
          Int32 upitch,
          Pointer<Uint8> vplane,
          Int32 vpitch),
      int Function(
          Pointer<SdlTexture> texture,
          Pointer<SdlRect> rect,
          Pointer<Uint8> yplane,
          int ypitch,
          Pointer<Uint8> uplane,
          int upitch,
          Pointer<Uint8> vplane,
          int vpitch)>('SDL_UpdateYUVTexture');
  return sdlUpdateYuvTextureLookupFunction(
      texture, rect, yplane, ypitch, uplane, upitch, vplane, vpitch);
}