Class YUYVImage


  • public class YUYVImage
    extends java.lang.Object
    Class to represent a YUV video image
    Author:
    Gabriel Ferrer, Andy
    • Constructor Summary

      Constructors 
      Constructor Description
      YUYVImage​(byte[] pix, int width, int height)
      Create a YUYV image of the requested size using the byte array as the source of pixel information
      YUYVImage​(int width, int height)
      Create a new YUYV image of the specified size
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void display​(GraphicsLCD device, int xDest, int yDest, int threshold)
      Display the image at the specified location on the provided monochrome device or image.
      int getHeight()
      return the image height
      int getMeanY()
      Return the mean of the Y components for the image (mean brightness)
      int getNumPixels()
      return the number of pixels in the image
      int getU​(int x, int y)
      return the U component of the specified pixel
      int getV​(int x, int y)
      return the V component of the specified pixel
      int getWidth()
      return the image width
      int getY​(int x, int y)
      return the Y component of the specified pixel
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • YUYVImage

        public YUYVImage​(byte[] pix,
                         int width,
                         int height)
        Create a YUYV image of the requested size using the byte array as the source of pixel information
        Parameters:
        pix - pixels
        width - image width
        height - image height
      • YUYVImage

        public YUYVImage​(int width,
                         int height)
        Create a new YUYV image of the specified size
        Parameters:
        width -
        height -
    • Method Detail

      • getNumPixels

        public int getNumPixels()
        return the number of pixels in the image
        Returns:
        number of pixels
      • getWidth

        public int getWidth()
        return the image width
        Returns:
        width
      • getHeight

        public int getHeight()
        return the image height
        Returns:
        height
      • getY

        public int getY​(int x,
                        int y)
        return the Y component of the specified pixel
        Parameters:
        x -
        y -
        Returns:
        Y component
      • getU

        public int getU​(int x,
                        int y)
        return the U component of the specified pixel
        Parameters:
        x -
        y -
        Returns:
        U component
      • getV

        public int getV​(int x,
                        int y)
        return the V component of the specified pixel
        Parameters:
        x -
        y -
        Returns:
        V component
      • getMeanY

        public int getMeanY()
        Return the mean of the Y components for the image (mean brightness)
        Returns:
        mean Y value
      • display

        public void display​(GraphicsLCD device,
                            int xDest,
                            int yDest,
                            int threshold)
        Display the image at the specified location on the provided monochrome device or image. Pixels with a Y value below threshold will be set, those above unset.
        Parameters:
        threshold -