diff options
Diffstat (limited to 'src/jniglue/tests/org/OpenColorIO/ColorSpaceTest.java')
-rw-r--r-- | src/jniglue/tests/org/OpenColorIO/ColorSpaceTest.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/jniglue/tests/org/OpenColorIO/ColorSpaceTest.java b/src/jniglue/tests/org/OpenColorIO/ColorSpaceTest.java new file mode 100644 index 0000000..f49e582 --- /dev/null +++ b/src/jniglue/tests/org/OpenColorIO/ColorSpaceTest.java @@ -0,0 +1,41 @@ + +import junit.framework.TestCase; +import org.OpenColorIO.*; + +public class ColorSpaceTest extends TestCase { + + protected void setUp() { + } + + protected void tearDown() { + } + + public void test_interface() { + ColorSpace cs = new ColorSpace().Create(); + cs.setName("mynewcolspace"); + assertEquals("mynewcolspace", cs.getName()); + cs.setFamily("fam1"); + assertEquals("fam1", cs.getFamily()); + cs.setEqualityGroup("match1"); + assertEquals("match1", cs.getEqualityGroup()); + cs.setDescription("this is a test"); + assertEquals("this is a test", cs.getDescription()); + cs.setBitDepth(BitDepth.BIT_DEPTH_F16); + assertEquals(BitDepth.BIT_DEPTH_F16, cs.getBitDepth()); + cs.setIsData(false); + assertEquals(false, cs.isData()); + cs.setAllocation(Allocation.ALLOCATION_LG2); + assertEquals(Allocation.ALLOCATION_LG2, cs.getAllocation()); + float test[] = new float[]{0.1f, 0.2f, 0.3f}; + cs.setAllocationVars(3, test); + assertEquals(3, cs.getAllocationNumVars()); + float out[] = new float[3]; + cs.getAllocationVars(out); + LogTransform lt = new LogTransform().Create(); + lt.setBase(10.f); + cs.setTransform(lt, ColorSpaceDirection.COLORSPACE_DIR_TO_REFERENCE); + LogTransform ott = (LogTransform)cs.getTransform(ColorSpaceDirection.COLORSPACE_DIR_TO_REFERENCE); + assertEquals(10.f, ott.getBase()); + } + +} |