Class ConvertedRandomAccess<A,B>

java.lang.Object
net.imglib2.converter.AbstractConvertedRandomAccess<A,B>
net.imglib2.converter.read.ConvertedRandomAccess<A,B>
All Implemented Interfaces:
EuclideanSpace, Localizable, Positionable, RandomAccess<B>, RealLocalizable, Sampler<B>, Typed<B>

public final class ConvertedRandomAccess<A,B> extends AbstractConvertedRandomAccess<A,B>
TODO
  • Field Details

    • converterSupplier

      private final Supplier<Converter<? super A, ? super B>> converterSupplier
    • converter

      private final Converter<? super A, ? super B> converter
    • convertedSupplier

      private final Supplier<? extends B> convertedSupplier
    • converted

      private final B converted
  • Constructor Details

    • ConvertedRandomAccess

      public ConvertedRandomAccess(RandomAccess<A> source, Supplier<Converter<? super A, ? super B>> converterSupplier, Supplier<? extends B> convertedSupplier)
      Creates a copy of b for conversion that can be accessed through get().
      Parameters:
      source -
      converterSupplier -
      convertedSupplier -
    • ConvertedRandomAccess

      public ConvertedRandomAccess(RandomAccess<A> source, Converter<? super A, ? super B> converter, Supplier<? extends B> convertedSupplier)
      Use this constructor for stateless functions
      Parameters:
      source -
      converter -
      convertedSupplier -
  • Method Details

    • get

      public B get()
      Description copied from interface: Sampler
      Access the actual T instance providing access to a pixel, sub-pixel or integral region value the Sampler points at.
    • getType

      public B getType()
      Description copied from interface: Typed
      Get an instance of T.

      It should not be assumed that the returned T instance is an independent copy. In particular, repeated calls to getType() may return the same instance.

      Returns:
      an instance of T
    • copy

      public ConvertedRandomAccess<A,B> copy()
      Specified by:
      copy in interface RandomAccess<A>
      Specified by:
      copy in interface Sampler<A>
      Specified by:
      copy in class AbstractConvertedRandomAccess<A,B>
      Returns:
      - A new Sampler in the same state accessing the same values. It does NOT copy T, just the state of the Sampler. Otherwise use T.copy() if available. Sampler.copy().get() == Sampler.get(), i.e. both hold the same value, not necessarily the same instance (this is the case for an ArrayCursor for example)