Search in sources :

Example 1 with ARGBDoubleType

use of net.imglib2.type.numeric.ARGBDoubleType in project imagej-ops by imagej.

the class AddNumericTypeBinaryMathAddTest method testAdd.

@Test
public void testAdd() {
    final ARGBDoubleType a = new ARGBDoubleType(255, 128, 128, 128);
    final ARGBDoubleType b = new ARGBDoubleType(255, 75, 35, 45);
    final Op op = ops.op(Ops.Math.Add.class, a, a, b);
    assertSame(NumericTypeBinaryMath.Add.class, op.getClass());
    op.run();
    assertEquals(203.0, a.getR(), DELTA);
    assertEquals(163.0, a.getG(), DELTA);
    assertEquals(173.0, a.getB(), DELTA);
}
Also used : Op(net.imagej.ops.Op) ARGBDoubleType(net.imglib2.type.numeric.ARGBDoubleType) NumericTypeBinaryMath(net.imagej.ops.math.NumericTypeBinaryMath) NumericTypeBinaryMath(net.imagej.ops.math.NumericTypeBinaryMath) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Aggregations

AbstractOpTest (net.imagej.ops.AbstractOpTest)1 Op (net.imagej.ops.Op)1 NumericTypeBinaryMath (net.imagej.ops.math.NumericTypeBinaryMath)1 ARGBDoubleType (net.imglib2.type.numeric.ARGBDoubleType)1 Test (org.junit.Test)1