public static < T > T convertGenericToSpecificType ( Class < ? > type ) { if ( type == GrayI8 . class ) return ( T ) GrayU8 . class ; if ( type == GrayI16 . class ) return ( T ) GrayS16 . class ; if ( type == InterleavedI8 . class ) return ( T ) InterleavedU8 . class ; if ( type == InterleavedI16 . class ) return ( T ) InterleavedS16 . class ; return ( T ) type ; }
If an image is to be created then the generic type can t be used a specific one needs to be . An arbitrary specific image type is returned here .