- java.lang.Object
-
- bdv.viewer.render.SimpleVolatileProjector<A,B>
-
- Type Parameters:
A- pixel type of the sourceRandomAccessible.B- pixel type of the targetRandomAccessibleInterval.
- All Implemented Interfaces:
VolatileProjector
public class SimpleVolatileProjector<A,B> extends Object implements VolatileProjector
AnVolatileProjector, that renders a target 2DRandomAccessibleIntervalby copying values from a sourceRandomAccessible. The source can have more dimensions than the target. Target coordinate (x,y) is copied from source coordinate (x,y,0,...,0).- Author:
- Tobias Pietzsch, Stephan Saalfeld
-
-
Constructor Summary
Constructors Constructor Description SimpleVolatileProjector(net.imglib2.RandomAccessible<A> source, net.imglib2.converter.Converter<? super A,B> converter, net.imglib2.RandomAccessibleInterval<B> target)Create new projector with the given source and a converter from source to target pixel type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()AbortVolatileProjector.map()if it is currently running.longgetLastFrameRenderNanoTime()How many nano-seconds did the lastVolatileProjector.map()take.booleanisValid()booleanmap(boolean clearUntouchedTargetPixels)Render the 2D target image by copying values from the source.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface bdv.viewer.render.VolatileProjector
map
-
-
-
-
Constructor Detail
-
SimpleVolatileProjector
public SimpleVolatileProjector(net.imglib2.RandomAccessible<A> source, net.imglib2.converter.Converter<? super A,B> converter, net.imglib2.RandomAccessibleInterval<B> target)
Create new projector with the given source and a converter from source to target pixel type.- Parameters:
source- source pixels.converter- converts from the source pixel type to the target pixel type.target- the target interval that this projector maps to
-
-
Method Detail
-
cancel
public void cancel()
Description copied from interface:VolatileProjectorAbortVolatileProjector.map()if it is currently running.- Specified by:
cancelin interfaceVolatileProjector
-
getLastFrameRenderNanoTime
public long getLastFrameRenderNanoTime()
Description copied from interface:VolatileProjectorHow many nano-seconds did the lastVolatileProjector.map()take.- Specified by:
getLastFrameRenderNanoTimein interfaceVolatileProjector- Returns:
- time needed for rendering the last frame, in nano-seconds.
-
isValid
public boolean isValid()
- Specified by:
isValidin interfaceVolatileProjector- Returns:
- true if all mapped pixels were valid.
-
map
public boolean map(boolean clearUntouchedTargetPixels)
Render the 2D target image by copying values from the source. Source can have more dimensions than the target. Target coordinate (x,y) is copied from source coordinate (x,y,0,...,0).Check after each line whether rendering was
canceled.- Specified by:
mapin interfaceVolatileProjector- Returns:
- true if rendering was completed (all target pixels written). false if rendering was interrupted.
-
-