Skip to content
Snippets Groups Projects
Unverified Commit 6207124b authored by Tobias Pietzsch's avatar Tobias Pietzsch Committed by GitHub
Browse files

Merge pull request #40 from hanslovsky/best-mipmap-level-for-source

Query best mipmap level from source directly.
parents c6aa04f1 69447d3f
No related branches found
No related tags found
No related merge requests found
...@@ -555,13 +555,23 @@ public class ViewerState ...@@ -555,13 +555,23 @@ public class ViewerState
* @return mipmap level * @return mipmap level
*/ */
public synchronized int getBestMipMapLevel( final AffineTransform3D screenScaleTransform, final int sourceIndex ) public synchronized int getBestMipMapLevel( final AffineTransform3D screenScaleTransform, final int sourceIndex )
{
return getBestMipMapLevel( screenScaleTransform, sources.get( sourceIndex ).getSpimSource() );
}
/**
* Get the mipmap level that best matches the given screen scale for the given source.
*
* @param screenScaleTransform
* screen scale, transforms screen coordinates to viewer coordinates.
* @return mipmap level
*/
public synchronized int getBestMipMapLevel( final AffineTransform3D screenScaleTransform, final Source< ? > source )
{ {
final AffineTransform3D screenTransform = new AffineTransform3D(); final AffineTransform3D screenTransform = new AffineTransform3D();
getViewerTransform( screenTransform ); getViewerTransform( screenTransform );
screenTransform.preConcatenate( screenScaleTransform ); screenTransform.preConcatenate( screenScaleTransform );
final Source< ? > source = sources.get( sourceIndex ).getSpimSource();
return MipmapTransforms.getBestMipMapLevel( screenTransform, source, currentTimepoint ); return MipmapTransforms.getBestMipMapLevel( screenTransform, source, currentTimepoint );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment