code: public static <T extends ImageGray<T>>
  	T yuvToGray(ByteBuffer bufferY , int width , int height, int strideRow , T output , BWorkArrays workArrays, Class<T> outputType )
  	{
  		if( outputType == GrayU8.class ) {
  			return (T) yuvToGray(bufferY,width,height,strideRow,(GrayU8)output);
  		} else if( outputType == GrayF32.class ) {
  			return (T) yuvToGray(bufferY,width,height,strideRow,(GrayF32)output,workArrays);
  		} else {
  			throw new IllegalArgumentException("Unsupported BoofCV Image Type "+outputType.getSimpleName());
  		}
  	}
docs: Converts an YUV 420 888 into gray
  
  @param output Output: Optional storage for output image.  Can be null.
  @param outputType  Output: Type of output image
  @param <T> Output image type
  @return Gray scale image