Package net.imglib2.img.basictypeaccess.array

Examples of net.imglib2.img.basictypeaccess.array.ByteArray


  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;
    }
View Full Code Here


  }

  @Override
  public CellImg< T, ByteArray, DefaultCell< ByteArray > > createByteInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return createInstance( new ByteArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

  }

  @Override
  public NativeImg< T, ByteArray > createByteInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return new PlanarImg< T, ByteArray >( new ByteArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

  @Override
  public ArrayImg< T, ByteArray > createByteInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    final int numEntities = numEntitiesRangeCheck( dimensions, entitiesPerPixel );

    return new ArrayImg< T, ByteArray >( new ByteArray( numEntities ), dimensions, entitiesPerPixel );
  }
View Full Code Here

   * Creates an {@link ArrayImg}<{@link UnsignedByteType}, {@link ByteArray}>
   * reusing a passed byte[] array.
   */
  final public static ArrayImg< UnsignedByteType, ByteArray > unsignedBytes( final byte[] array, final long... dim )
  {
    final ByteArray access = new ByteArray( array );
    final ArrayImg< UnsignedByteType, ByteArray > img = new ArrayImg< UnsignedByteType, ByteArray >( access, dim, new Fraction() );
    final UnsignedByteType t = new UnsignedByteType( img );   
    img.setLinkedType( t );
    return img;
  }
View Full Code Here

   * Creates an {@link ArrayImg}<{@link ByteType}, {@link ByteArray}> reusing
   * a passed byte[] array.
   */
  final public static ArrayImg< ByteType, ByteArray > bytes( final byte[] array, final long... dim )
  {
    final ByteArray access = new ByteArray( array );
    final ArrayImg< ByteType, ByteArray > img = new ArrayImg< ByteType, ByteArray >( access, dim, new Fraction() );
    final ByteType t = new ByteType( img );   
    img.setLinkedType( t );
    return img;
  }
View Full Code Here

  // this is the constructor if you want it to be a variable
  public GenericByteType( final byte value )
  {
    img = null;
    dataAccess = new ByteArray( 1 );
    setValue( value );
  }
View Full Code Here

  }

  @Test
  public void testByteConstruction()
  {
    testConstruction( new ByteArray( 1 ) );
  }
View Full Code Here

  }

  @Override
  public CellImg< T, CharArray, DefaultCell< CharArray > > createCharInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return createInstance( new CharArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

  }

  @Override
  public NativeImg< T, CharArray > createCharInstance( final long[] dimensions, final Fraction entitiesPerPixel )
  {
    return new PlanarImg< T, CharArray >( new CharArray( 1 ), dimensions, entitiesPerPixel );
  }
View Full Code Here

TOP

Related Classes of net.imglib2.img.basictypeaccess.array.ByteArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.