Skip to content
Snippets Groups Projects
Commit bdcc8cd9 authored by Tobias Pietzsch's avatar Tobias Pietzsch
Browse files

Merge branch 'master' of github.com:bigdataviewer/bigdataviewer-core

parents 4141e294 6cfe717e
No related branches found
No related tags found
No related merge requests found
......@@ -193,5 +193,11 @@
<artifactId>scijava-listeners</artifactId>
<version>1.0.0-beta-2</version>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
......@@ -48,4 +48,15 @@ public enum Interpolation
{
return name;
}
/**
*
* @return The next {@link Interpolation} value in the order defined by
* {@link Interpolation#values()} with cyclic continuation: The last element
* returns the first element. Can be used to toggle/cycle through interpolations
* in graphical user interface.
*/
public Interpolation next() {
return Interpolation.values()[ ( this.ordinal() + 1 ) % Interpolation.values().length ];
}
}
package bdv.viewer;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.*;
public class InterpolationTest {
@Test
public void next() {
Assert.assertEquals( Interpolation.NLINEAR, Interpolation.NEARESTNEIGHBOR.next() );
Assert.assertEquals( Interpolation.NEARESTNEIGHBOR, Interpolation.NLINEAR.next() );
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment