@Override public ARGBType createVariable() { return new ARGBType( 0 ); }
public static Color getColorN(long n) { Iterator< ARGBType > iterator = ColorStream.iterator(); ARGBType c = new ARGBType(); for (int i = 0; i<n+43; i++) for (int j = 0; j<3; j++) c = iterator.next(); return new Color( ARGBType.red( c.get() ), ARGBType.green( c.get() ), ARGBType.blue( c.get() ) ); }
@Override public void setZero() { set( 0 ); }
@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 ); }
@Override public int argb( final int i ) { final int r = values.length > 0 ? get( ColorTable.RED, i ) : 0; final int g = values.length > 1 ? get( ColorTable.GREEN, i ) : 0; final int b = values.length > 2 ? get( ColorTable.BLUE, i ) : 0; final int a = values.length > 3 ? get( ColorTable.ALPHA, i ) : 0xff; return ARGBType.rgba( r, g, b, a ); }
public ARGBType( final int value ) { img = null; dataAccess = new IntArray( 1 ); set( value ); }
@Override public int argb( final int i ) { final int r = values.length > 0 ? get( ColorTable.RED, i ) : 0; final int g = values.length > 1 ? get( ColorTable.GREEN, i ) : 0; final int b = values.length > 2 ? get( ColorTable.BLUE, i ) : 0; final int a = values.length > 3 ? get( ColorTable.ALPHA, i ) : 0xff; return ARGBType.rgba( r, g, b, a ); }
public ChannelSource( final RandomAccessibleInterval< ARGBType > img, final ChannelSourceCoordinator coordinator, final AffineTransform3D sourceTransform, final String name ) { super( img, new ARGBType(), sourceTransform, name ); this.coordinator = coordinator; }