author dswitkin google import Binarizer from './Binarizer' ; import BitArray from './common/BitArray' ; import BitMatrix from './common/BitMatrix' ; import LuminanceSource from './LuminanceSource' ; import IllegalArgumentException from './IllegalArgumentException' ; export default class BinaryBitmap { private matrix : BitMatrix ; public constructor ( private binarizer ) { if ( binarizer === null ) { throw new IllegalArgumentException ( 'Binarizer must be non-null.' ) ; } } return public getWidth ( ) { return this . binarizer . getWidth ( ) ; } return public getHeight ( ) { return this . binarizer . getHeight ( ) ; } param y param row return throws public getBlackRow ( y , row ) { return this . binarizer . getBlackRow ( y , row ) ; } return throws public getBlackMatrix ( ) { if ( this . matrix === null || this . matrix === undefined ) { this . matrix = this . binarizer . getBlackMatrix ( ) ; } return this . matrix ; } return public isCropSupported ( ) { return this . binarizer . getLuminanceSource ( ) . isCropSupported ( ) ; } param left param top param width param height return public crop ( left , top , width , height ) { const newSource = this . binarizer . getLuminanceSource ( ) . crop ( left , top , width , height ) ; return new BinaryBitmap ( this . binarizer . createBinarizer ( newSource ) ) ; } return public isRotateSupported ( ) { return this . binarizer . getLuminanceSource ( ) . isRotateSupported ( ) ; } /**
     * Returns a new object with rotated image data by 90 degrees counterclockwise.
     * Only callable if  {@link #isRotateSupported()} is true.
     *
     *  return public rotateCounterClockwise ( ) { const newSource = this . binarizer . getLuminanceSource ( ) . rotateCounterClockwise ( ) ; return new BinaryBitmap ( this . binarizer . createBinarizer ( newSource ) ) ; } /**
     * Returns a new object with rotated image data by 45 degrees counterclockwise.
     * Only callable if  {@link #isRotateSupported()} is true.
     *
     *  return public rotateCounterClockwise45 ( ) { const newSource = this . binarizer . getLuminanceSource ( ) . rotateCounterClockwise45 ( ) ; return new BinaryBitmap ( this . binarizer . createBinarizer ( newSource ) ) ; } public toString ( ) { try { return this . getBlackMatrix ( ) . toString ( ) ; } catch ( e ) { return '' ; } } }