Package lejos.hardware.video
Class YUYVImage
- java.lang.Object
-
- lejos.hardware.video.YUYVImage
-
public class YUYVImage extends java.lang.ObjectClass to represent a YUV video image- Author:
- Gabriel Ferrer, Andy
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisplay(GraphicsLCD device, int xDest, int yDest, int threshold)Display the image at the specified location on the provided monochrome device or image.intgetHeight()return the image heightintgetMeanY()Return the mean of the Y components for the image (mean brightness)intgetNumPixels()return the number of pixels in the imageintgetU(int x, int y)return the U component of the specified pixelintgetV(int x, int y)return the V component of the specified pixelintgetWidth()return the image widthintgetY(int x, int y)return the Y component of the specified pixel
-
-
-
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- pixelswidth- image widthheight- 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-
-
-