ZXing.PlanarYUVLuminanceSource.getRow C# (CSharp) Method

getRow() public method

Fetches one row of luminance data from the underlying platform's bitmap. Values range from 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have to bitwise and with 0xff for each value. It is preferable for implementations of this method to only fetch this row rather than the whole image, since no 2D Readers may be installed and getMatrix() may never be called.
public getRow ( int y, byte row ) : byte[]
y int The row to fetch, 0 <= y < Height.
row byte An optional preallocated array. If null or too small, it will be ignored. /// Always use the returned object, and ignore the .length of the array.
return byte[]
      override public byte[] getRow(int y, byte[] row)
      {
         if (y < 0 || y >= Height)
         {
            throw new ArgumentException("Requested row is outside the image: " + y);
         }
         int width = Width;
         if (row == null || row.Length < width)
         {
            row = new byte[width];
         }
         int offset = (y + top) * dataWidth + left;
         Array.Copy(yuvData, offset, row, 0, width);
         return row;
      }