Package net.imglib2.util

Examples of net.imglib2.util.Fraction


  @Override
  public NativeImg<BitType, ? extends LongAccess> createSuitableNativeImg( final NativeImgFactory<BitType> storageFactory, final long dim[] )
  {
    // create the container
    final NativeImg<BitType, ? extends LongAccess> container = storageFactory.createLongInstance( dim, new Fraction( 1, 64 ) );

    // create a Type that is linked to the container
    final BitType linkedType = new BitType( container );

    // pass it to the NativeContainer
View Full Code Here


  @Override
  public NativeImg< BasePairCharType, ? extends CharAccess > createSuitableNativeImg( final NativeImgFactory< BasePairCharType > storageFactory, final long dim[] )
  {
    // create the container
    final NativeImg<BasePairCharType, ? extends CharAccess> container = storageFactory.createCharInstance( dim, new Fraction() );
   
    // create a Type that is linked to the container
    final BasePairCharType linkedType = new BasePairCharType( container );

    // pass it to the NativeContainer
View Full Code Here

    return value ? "1" : "0";
  }

  @Override
  public Fraction getEntitiesPerPixel() { return new Fraction(); }
View Full Code Here

  @Override
  public NativeImg< ARGBType, ? extends IntAccess > createSuitableNativeImg( final NativeImgFactory< ARGBType > storageFactory, final long dim[] )
  {
    // create the container
    final NativeImg<ARGBType, ? extends IntAccess> container = storageFactory.createIntInstance( dim, new Fraction() );
   
    // create a Type that is linked to the container
    final ARGBType linkedType = new ARGBType( container );

    // pass it to the NativeContainer
View Full Code Here

    final int rgba = get();
    return "(r=" + red( rgba ) + ",g=" + green( rgba ) + ",b=" + blue( rgba ) + ",a=" + alpha( rgba ) + ")";
  }

  @Override
  public Fraction getEntitiesPerPixel() { return new Fraction(); }
View Full Code Here

  @Override
  public NativeImg< NativeARGBDoubleType, ? extends DoubleAccess > createSuitableNativeImg(
      final NativeImgFactory< NativeARGBDoubleType > storageFactory,
      final long dim[] )
  {
    final NativeImg< NativeARGBDoubleType, ? extends DoubleAccess > container = storageFactory.createDoubleInstance( dim, new Fraction( 4, 1 ) );
    final NativeARGBDoubleType linkedType = new NativeARGBDoubleType( container );
    container.setLinkedType( linkedType );
    return container;
  }
View Full Code Here

  }

  @Override
  public Fraction getEntitiesPerPixel()
  {
    return new Fraction( 4, 1 );
  }
View Full Code Here

  };

  public < A extends ArrayDataAccess< A > > void testConstruction( final A creator )
  {
    for ( int i = 0; i < dim.length; ++i ) {
      final AbstractCell< A > cell = new DefaultCell< A >( creator, dim[ i ], offset[ i ], new Fraction( 2, 1 ) );
      assertTrue( creator.getClass().isInstance( cell.getData() ) );
      assertTrue( cell.size() == expectedLength[ i ] );
    }
  }
View Full Code Here

  }

  @Test
  public void testLocalIndexCalculation()
  {
    final AbstractCell< FloatArray > cell = new DefaultCell< FloatArray >( new FloatArray( 1 ), new int[] {20, 8, 10}, new long[] { 0, 9876543210l, 222 } , new Fraction( 2, 1 ) );
    final long[][] position = { {3, 4, 5}, {12, 0, 3}, {3, 2, 0} };
    final int[] expectedIndex = { 883, 492, 43 };
    for ( int i = 0; i < position.length; ++i )
    {
      assertTrue( cell.localPositionToIndex( position[ i ] ) == expectedIndex[ i ] );
View Full Code Here

  }

  @Test
  public void testGlobalPositionCalculation()
  {
    final AbstractCell< FloatArray > cell = new DefaultCell< FloatArray >( new FloatArray( 1 ), new int[] {20, 8, 10}, new long[] { 0, 9876543210l, 222 } , new Fraction( 2, 1 ) );
    final int[] index = { 883, 492, 43 };
    final long[][] expectedPosition = { { 3, 9876543214l, 227 }, { 12, 9876543210l, 225 }, { 3, 9876543212l, 222 } };
    for ( int i = 0; i < index.length; ++i )
    {
      final long[] position = new long[ 3 ];
View Full Code Here

TOP

Related Classes of net.imglib2.util.Fraction

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.