Beispiel #1
0
		/// <summary> A fast method to retrieve one row of data from the matrix as a BitArray.
		/// 
		/// </summary>
		/// <param name="y">The row to retrieve
		/// </param>
		/// <param name="row">An optional caller-allocated BitArray, will be allocated if null or too small
		/// </param>
		/// <returns> The resulting BitArray - this reference should always be used even when passing
		/// your own row
		/// </returns>
		public BitArray getRow(int y, BitArray row)
		{
			if (row == null || row.Size < width)
			{
				row = new BitArray(width);
			}
			int offset = y * rowSize;
			for (int x = 0; x < rowSize; x++)
			{
				row.setBulk(x << 5, bits[offset + x]);
			}
			return row;
		}
Beispiel #2
0
		/// <summary> Converts one row of luminance data to 1 bit data. May actually do the conversion, or return
		/// cached data. Callers should assume this method is expensive and call it as seldom as possible.
		/// This method is intended for decoding 1D barcodes and may choose to apply sharpening.
		/// For callers which only examine one row of pixels at a time, the same BitArray should be reused
		/// and passed in with each call for performance. However it is legal to keep more than one row
		/// at a time if needed.
		/// 
		/// </summary>
		/// <param name="y">The row to fetch, 0 <= y < bitmap height.
		/// </param>
		/// <param name="row">An optional preallocated array. If null or too small, it will be ignored.
		/// If used, the Binarizer will call BitArray.clear(). Always use the returned object.
		/// </param>
		/// <returns> The array of bits for this row (true means black).
		/// </returns>
		public abstract BitArray getBlackRow(int y, BitArray row);
Beispiel #3
0
		/// <summary> Converts one row of luminance data to 1 bit data. May actually do the conversion, or return
		/// cached data. Callers should assume this method is expensive and call it as seldom as possible.
		/// This method is intended for decoding 1D barcodes and may choose to apply sharpening.
		/// 
		/// </summary>
		/// <param name="y">The row to fetch, 0 <= y < bitmap height.
		/// </param>
		/// <param name="row">An optional preallocated array. If null or too small, it will be ignored.
		/// If used, the Binarizer will call BitArray.clear(). Always use the returned object.
		/// </param>
		/// <returns> The array of bits for this row (true means black).
		/// </returns>
		public BitArray getBlackRow(int y, BitArray row)
		{
			return binarizer.getBlackRow(y, row);
		}