Class RasterGeneratorDelegateToRaster<S,T>

Object
RasterGenerator<T>
RasterGeneratorSelectFormat<T>
RasterGeneratorDelegateToRaster<S,T>
Type Parameters:
S - delegate iteration-type
T - generator iteration-type (the iteration-type that is publicly exposed)
All Implemented Interfaces:
Generator<T>, TransformingGenerator<T,Stack>, ElementWriter<T>
Direct Known Subclasses:
DisplayStackGenerator, FlattenStackGenerator, RasterGeneratorBridge

public abstract class RasterGeneratorDelegateToRaster<S,T> extends RasterGeneratorSelectFormat<T>
Uses a delegate raster-generator and optionally applies a conversions before calling transform(T).
Author:
Owen Feehan
  • Constructor Details

    • RasterGeneratorDelegateToRaster

      protected RasterGeneratorDelegateToRaster(RasterGenerator<S> delegate)
      Creates a new RasterGeneratorDelegateToRaster instance.
      Parameters:
      delegate - The delegate.
  • Method Details

    • guaranteedImageAttributes

      public StackWriteAttributes guaranteedImageAttributes()
      Description copied from class: RasterGenerator
      Guarantees on the attributes of all images created by the generator.
      Specified by:
      guaranteedImageAttributes in class RasterGenerator<T>
      Returns:
      options that are guaranteed to be true of all images by the generator.
    • transform

      public Stack transform(T element) throws OutputWriteFailedException
      Description copied from interface: TransformingGenerator
      Applies any necessary preprocessing to create an element suitable for writing to the filesystem.
      Parameters:
      element - element to be assigned and then transformed.
      Returns:
      the transformed element after necessary preprocessing.
      Throws:
      OutputWriteFailedException - if anything goes wrong.
    • convertBeforeAssign

      protected abstract S convertBeforeAssign(T element) throws OperationFailedException
      Converts an element before setting it on the delegate.
      Parameters:
      element - element to convert
      Returns:
      converted element
      Throws:
      OperationFailedException - if anything goes wrong during conversion
    • convertBeforeTransform

      protected abstract Stack convertBeforeTransform(Stack stack)
      Converts an element before calling transform(T) on the delegate.
      Parameters:
      stack - stack to convert
      Returns:
      converted element
    • getDelegate

      protected RasterGenerator<S> getDelegate()
      The delegate.
      Returns:
      the delegate.