public static < T extends NativeType< T >> ArrayImgAWTScreenImage< T, ? > emptyScreenImage( final T type, final long[] dims )
{
if ( ByteType.class.isAssignableFrom( type.getClass() ) )
{
final ByteArray array = new ByteArray( numElements( dims ) );
final ArrayImgAWTScreenImage< ByteType, ByteArray > container = new ByteAWTScreenImage( new ByteType( array ), array, dims );
container.setLinkedType( new ByteType( container ) );
return ( ArrayImgAWTScreenImage ) container;
}
if ( UnsignedByteType.class.isAssignableFrom( type.getClass() ) )
{
final ByteArray array = new ByteArray( numElements( dims ) );
final ArrayImgAWTScreenImage< UnsignedByteType, ByteArray > container = new UnsignedByteAWTScreenImage( new UnsignedByteType( array ), array, dims );
container.setLinkedType( new UnsignedByteType( container ) );
return ( ArrayImgAWTScreenImage ) container;
}