@Override public ARGBType duplicateTypeOnSameNativeImg() { return new ARGBType( img ); }
public ChannelSource( final RandomAccessibleInterval< ARGBType > img, final ChannelSourceCoordinator coordinator, final AffineTransform3D sourceTransform, final String name ) { super( img, new ARGBType(), sourceTransform, name ); this.coordinator = coordinator; }
@Override public ARGBType createVariable() { return new ARGBType( 0 ); }
public ChannelSource4D( final RandomAccessibleInterval< ARGBType > img, final ChannelSourceCoordinator coordinator, final AffineTransform3D sourceTransform, final String name ) { super( img, new ARGBType(), sourceTransform, name ); this.coordinator = coordinator; }
@Override public ARGBType getColor() { return new ARGBType(); }
@Override public ARGBType convert( Sampler< ? extends Composite< UnsignedByteType > > sampler ) { return new ARGBType( factory.apply( sampler ) ); }
@Override public ARGBType convert( Sampler< ? extends Composite< UnsignedByteType > > sampler ) { return new ARGBType( factory.apply( sampler ) ); }
/** * 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<>( new ARGBType() ).create( dim ); }
/** * 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<>( new ARGBType() ).create( dim ); }
public ImageJVirtualStackARGB( RandomAccessibleInterval< S > source, Converter< S, ARGBType > converter ) { super( source, converter, new ARGBType(), ImagePlus.COLOR_RGB ); imageProcessor.setMinAndMax( 0, 255 ); } }
@Override protected void linkType( final CachedCellImg< ARGBType, VolatileIntArray > img ) { img.setLinkedType( new ARGBType( img ) ); }
@Override public ARGBType copy() { return new ARGBType( get() ); }
@Override public ARGBType copy() { return new ARGBType( get() ); }
@Override public Img<ARGBType> asImage(final int numThreads) throws Exception { return Compute.apply(this, new ARGBType(), numThreads); } }
public static void colorSources( final List< ConverterSetup > cs, final long j ) { for ( int i = 0; i < cs.size(); ++i ) cs.get( i ).setColor( new ARGBType( ColorStream.get( i + j ) ) ); }
public ARGBImage(final long[] dim, final int[] pixels) { super(new IntArray(pixels), dim, new Fraction()); setLinkedType(new ARGBType(this)); } }
public static IntImagePlus<ARGBType> wrapRGBA( final ImagePlus imp ) { if ( imp.getType() != ImagePlus.COLOR_RGB) return null; final IntImagePlus< ARGBType > container = new IntImagePlus< ARGBType >( imp ); // create a Type that is linked to the container final ARGBType linkedType = new ARGBType( container ); // pass it to the DirectAccessContainer container.setLinkedType( linkedType ); return container; }
/** * Creates an {@link ArrayImg}<{@link ARGBType}, {@link IntAccess}> * using a {@link IntAccess} passed as argument. */ final static public < A extends IntAccess > ArrayImg< ARGBType, A > argbs( final A access, final long... dim ) { final ArrayImg< ARGBType, A > img = new ArrayImg<>( access, dim, new Fraction() ); final ARGBType t = new ARGBType( img ); img.setLinkedType( t ); return img; }
@Test public void testMergeARBGWriting() { // setup byte[] pixels = new byte[ 4 ]; Img< UnsignedByteType > image = ArrayImgs.unsignedBytes( pixels, 4 ); // process RandomAccessibleInterval< ARGBType > arbg = Converters.mergeARGB( image, ColorChannelOrder.ARGB ); arbg.randomAccess().get().set( new ARGBType( 0x01020304 ) ); // test Assert.assertArrayEquals( new byte[] { 1, 2, 3, 4 }, pixels ); }
@Test public void testARGBType() { Img< ARGBType > image = RandomImgs.seed( 42 ).nextImage( new ARGBType(), 10, 10 ); testIsRandomImageIntegerType( Converters.argbChannel( image, 0 ) ); testIsRandomImageIntegerType( Converters.argbChannel( image, 1 ) ); testIsRandomImageIntegerType( Converters.argbChannel( image, 2 ) ); testIsRandomImageIntegerType( Converters.argbChannel( image, 3 ) ); }