Exemple #1
0
static void
yuv422p_yv12(int width, int height, const u_char **in, int *istride,
             u_char **out, int *ostride)
{
    copy_plane(0, 0, 1, 1);
    red_plane(1, 2, 2, 1, 1, 2);
    red_plane(2, 1, 2, 1, 1, 2);
}
Pixel Picture::get_pixel(int x, int y)
{
  if ((x < 0) || ((unsigned)x >= width)) {
    return (Pixel){.r=0, .g=0, .b=0, .a=0};
  }
  if ((y < 0) || ((unsigned)y >= height)) {
    return (Pixel){.r=0, .g=0, .b=0, .a=0};
  }

  Pixel p;
  unsigned index = x + y *height;
  p.r = red_plane()[index];
  p.g = green_plane()[index];
  p.b = blue_plane()[index];
  p.a = alpha_plane()[index];
  return p;
}