Interface SamplerConverter<A,B>
-
- Type Parameters:
A- The type of values accessed by theSampler.B- The type of the value returned by thisSamplerConverter.
- All Known Implementing Classes:
ARGBChannelSamplerConverter,CompositeARGBSamplerConverter,RealDoubleSamplerConverter,RealFloatSamplerConverter
public interface SamplerConverter<A,B>This interface converts aSampler<A>into an instance ofB, whereAandBare typicallyTypes.Its intended use is to create objects that wrap the provided
Sampleritself instead of wrapping values obtained through theSampler. In other words, if theSampleris pointed at a different object, existing objects returned by thisSamplerConvertershould point at it as well.SamplerConverters are used inConvertersto create on-the-fly converted images that are both readable and writable. For example, consider accessing a channel of anARGBTypeimage asUnsignedByteType. The converted image needs to provide converted samplers (e.g.,RandomAccess<UnsignedByteType>) that "translate" to the samplers of the original image (e.g.,RandomAccess<ARGBType>).The converted
Samplerreturns anUnsignedByteTypeinstance onget(). If.setByte(10)is called on thatUnsignedByteTypeinstance, that must be translated back to the underlyingARGBType. To achieve this,SamplerConverter.convert(...)creates a specialUnsignedByteTypeinstance which knows about a specific source sampler (e.g.,RandomAccess<ARGBType>). When theUnsignedByteTypeinstance is written to (or read from), it gets the currentARGBTypefrom the source sampler and performs the conversion.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Bconvert(Sampler<? extends A> sampler)
-