Examples of ARGBType


Examples of net.imglib2.type.numeric.ARGBType

   * array will update the {@link Image}.
   */
  public ARGBScreenImage( final int width, final int height, final int[] data )
  {
    super( new IntArray( data ), new long[]{ width, height }, new Fraction() );
    setLinkedType( new ARGBType( this ) );
    this.data = data;

    final SampleModel sampleModel = ARGB_COLOR_MODEL.createCompatibleWritableRaster( 1, 1 ).getSampleModel()
        .createCompatibleSampleModel( width, height );
    final DataBuffer dataBuffer = new DataBufferInt( data, width * height, 0 );
View Full Code Here

Examples of net.imglib2.type.numeric.ARGBType

      mapSingle( sourceRandomAccess, currentConverters[ 0 ] );
      return;
    }

    final Cursor< ARGBType > targetCursor = target.localizingCursor();
    final ARGBType bi = new ARGBType();

    while ( targetCursor.hasNext() )
    {
      targetCursor.fwd();
      sourceRandomAccess.setPosition( targetCursor.getLongPosition( 0 ), 0 );
      sourceRandomAccess.setPosition( targetCursor.getLongPosition( 1 ), 1 );
      int aSum = 0, rSum = 0, gSum = 0, bSum = 0;
      for ( int i = 0; i < size; i++ )
      {
        sourceRandomAccess.setPosition( currentPositions[ i ], dimIndex );
        currentConverters[ i ].convert( sourceRandomAccess.get(), bi );

        // accumulate converted result
        final int value = bi.get();
        final int a = ARGBType.alpha( value );
        final int r = ARGBType.red( value );
        final int g = ARGBType.green( value );
        final int b = ARGBType.blue( value );
        aSum += a;
View Full Code Here

Examples of net.imglib2.type.numeric.ARGBType

      sourceRandomAccess.setPosition( currentPositions[ 0 ], dimIndex );
      mapSingle( sourceRandomAccess, currentConverters[ 0 ] );
      return;
    }

    final ARGBType bi = new ARGBType();

    final RandomAccess< ARGBType > targetRandomAccess = target.randomAccess();

    targetRandomAccess.setPosition( min[ 1 ], 1 );
    while ( targetRandomAccess.getLongPosition( 1 ) <= max[ 1 ] )
    {
      sourceRandomAccess.setPosition( min[ 0 ], 0 );
      targetRandomAccess.setPosition( min[ 0 ], 0 );
      while ( targetRandomAccess.getLongPosition( 0 ) <= max[ 0 ] )
      {
        int aSum = 0, rSum = 0, gSum = 0, bSum = 0;
        for ( int i = 0; i < size; i++ )
        {
          sourceRandomAccess.setPosition( currentPositions[ i ], dimIndex );
          currentConverters[ i ].convert( sourceRandomAccess.get(), bi );

          // accumulate converted result
          final int value = bi.get();
          final int a = ARGBType.alpha( value );
          final int r = ARGBType.red( value );
          final int g = ARGBType.green( value );
          final int b = ARGBType.blue( value );
          aSum += a;
View Full Code Here

Examples of net.imglib2.type.numeric.ARGBType

   * Create an {@link ArrayImg}<{@link ARGBType}, {@link IntArray}>.
   */
  @SuppressWarnings( "unchecked" )
  final static public ArrayImg< ARGBType, IntArray > argbs( final long... dim )
  {
    return ( ArrayImg< ARGBType, IntArray > ) new ArrayImgFactory< ARGBType >().create( dim, new ARGBType() );
  }
View Full Code Here

Examples of net.imglib2.type.numeric.ARGBType

   */
  final public static ArrayImg< ARGBType, IntArray > argbs( final int[] array, final long... dim )
  {
    final IntArray access = new IntArray( array );
    final ArrayImg< ARGBType, IntArray > img = new ArrayImg< ARGBType, IntArray >( access, dim, new Fraction() );
    final ARGBType t = new ARGBType( img )
    img.setLinkedType( t );
    return img;
  }
View Full Code Here

Examples of net.imglib2.type.numeric.ARGBType

   * Create an {@link PlanarImg}<{@link ARGBType}, {@link IntArray}>.
   */
  @SuppressWarnings( "unchecked" )
  final static public PlanarImg< ARGBType, IntArray > argbs( final long... dim )
  {
    return ( PlanarImg< ARGBType, IntArray > ) new PlanarImgFactory< ARGBType >().create( dim, new ARGBType() );
  }
View Full Code Here

Examples of net.imglib2.type.numeric.ARGBType

  @Test
  public void testRgbHist()
  {
    final ArrayImgFactory< ARGBType > factory = new ArrayImgFactory< ARGBType >();
    final Img< ARGBType > img = factory.create( new long[] { 100, 200 }, new ARGBType() );
    for ( final ARGBType v : img )
    {
      v.set( ( int ) ( Math.random() * Integer.MAX_VALUE ) );
    }
    final RgbIterator data = new RgbIterator( img );
View Full Code Here

Examples of net.imglib2.type.numeric.ARGBType

        }

        @Override
        public List< IntType > next()
        {
          final ARGBType argbValue = cursor.next();
          tuple.get( 0 ).set( ( argbValue.get() >> 16 ) & 0xff );
          tuple.get( 1 ).set( ( argbValue.get() >> 8 ) & 0xff );
          tuple.get( 2 ).set( ( argbValue.get() >> 0 ) & 0xff );
          return tuple;
        }

        @Override
        public void remove()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.