public static < In extends ImageBase < In > , Out extends ImageBase < Out > , K extends Kernel1D , B extends ImageBorder < In > > void horizontal ( K kernel , In input , Out output , B border ) { switch ( input . getImageType ( ) . getFamily ( ) ) { case GRAY : { if ( input instanceof GrayF32 ) { ConvolveImage . horizontal ( ( Kernel1D_F32 ) kernel , ( GrayF32 ) input , ( GrayF32 ) output , ( ImageBorder_F32 ) border ) ; } else if ( input instanceof GrayU8 ) { if ( GrayI16 . class . isAssignableFrom ( output . getClass ( ) ) ) ConvolveImage . horizontal ( ( Kernel1D_S32 ) kernel , ( GrayU8 ) input , ( GrayI16 ) output , ( ImageBorder_S32 ) border ) ; else ConvolveImage . horizontal ( ( Kernel1D_S32 ) kernel , ( GrayU8 ) input , ( GrayS32 ) output , ( ImageBorder_S32 ) border ) ; } else if ( input instanceof GrayS16 ) { ConvolveImage . horizontal ( ( Kernel1D_S32 ) kernel , ( GrayS16 ) input , ( GrayI16 ) output , ( ImageBorder_S32 ) border ) ; } else { throw new IllegalArgumentException ( "Unknown image type: " + input . getClass ( ) . getName ( ) ) ; } } break ; case INTERLEAVED : { if ( input instanceof InterleavedF32 ) { ConvolveImage . horizontal ( ( Kernel1D_F32 ) kernel , ( InterleavedF32 ) input , ( InterleavedF32 ) output , ( ImageBorder_IL_F32 ) border ) ; } else if ( input instanceof InterleavedU8 ) { if ( InterleavedI16 . class . isAssignableFrom ( output . getClass ( ) ) ) ConvolveImage . horizontal ( ( Kernel1D_S32 ) kernel , ( InterleavedU8 ) input , ( InterleavedI16 ) output , ( ImageBorder_IL_S32 ) border ) ; else ConvolveImage . horizontal ( ( Kernel1D_S32 ) kernel , ( InterleavedU8 ) input , ( InterleavedS32 ) output , ( ImageBorder_IL_S32 ) border ) ; } else if ( input instanceof InterleavedS16 ) { ConvolveImage . horizontal ( ( Kernel1D_S32 ) kernel , ( InterleavedS16 ) input , ( InterleavedU16 ) output , ( ImageBorder_IL_S32 ) border ) ; } else { throw new IllegalArgumentException ( "Unknown image type: " + input . getClass ( ) . getName ( ) ) ; } } break ; case PLANAR : { Planar inp = ( Planar ) input ; Planar outp = ( Planar ) output ; for ( int i = 0 ; i < inp . getNumBands ( ) ; i ++ ) { horizontal ( kernel , inp . getBand ( i ) , outp . getBand ( i ) , ( ImageBorder ) border ) ; } } break ; } }
Performs a horizontal 1D convolution across the image . Borders are handled as specified by the border parameter .