Class TLcdBandMergeOp

java.lang.Object
com.luciad.imaging.operator.ALcdImageOperator
com.luciad.imaging.operator.TLcdBandMergeOp

public final class TLcdBandMergeOp extends ALcdImageOperator
Merges the bands of two images together.

The bands of the second image are added sequentially to the first, without reordering. Band merging is currently restricted to a maximum of 4 bands. This operator can for example be used to merge three grayscale bands and interpret them as RGB. For color data the bands should generally not be re-ordered. Otherwise they may or may not be interpreted as a color anymore. See here for details.

Example


 // Using the static method:
 ALcdBasicImage redImage = ...;
 ALcdBasicImage greenImage = ...;
 ALcdBasicImage blueImage = ...;
 ALcdBasicImage outputImage =
   TLcdBandMergeOp.bandMerge(
     TLcdBandMergeOp.bandMerge(redImage, greenImage),
     blueImage
   );

 // Using a data object:
 ALcdBasicImage redImage = ...;
 ALcdBasicImage greenImage = ...;
 ALcdBasicImage blueImage = ...;
 TLcdBandMergeOp op = new TLcdBandMergeOp();
 ILcdDataObject params = op.getParameterDataType().newInstance();
 params.setValue(TLcdBandMergeOp.INPUT_IMAGE, redImage);
 params.setValue(TLcdBandMergeOp.SECOND_IMAGE, greenImage);
 ALcdBasicImage outputImage = op.apply(params);
 params = op.getParameterDataType().newInstance();
 params.setValue(TLcdBandMergeOp.INPUT_IMAGE, outputImage);
 params.setValue(TLcdBandMergeOp.SECOND_IMAGE, blueImage);
 outputImage = op.apply(params);
 
Input
Output
Since:
2014.0
  • Field Details

    • NAME

      public static final String NAME
      Name of the operator.
      See Also:
    • INPUT_IMAGE

      public static final TLcdDataProperty INPUT_IMAGE
      The input image.
    • SECOND_IMAGE

      public static final TLcdDataProperty SECOND_IMAGE
      The image to band merge the input image with.
    • BAND_MERGE_FILTER_TYPE

      public static final TLcdDataType BAND_MERGE_FILTER_TYPE
      Input data type of the operator.
  • Constructor Details

    • TLcdBandMergeOp

      public TLcdBandMergeOp()
      Default constructor.
  • Method Details

    • apply

      public ALcdImage apply(ILcdDataObject aParameters)
      Description copied from class: ALcdImageOperator
      Applies this operator to the given input parameters. The parameters are stored in a data object which must be of the type given by ALcdImageOperator.getParameterDataType().
      Specified by:
      apply in class ALcdImageOperator
      Parameters:
      aParameters - the parameters for the operator
      Returns:
      the image produced by the operator
    • bandMerge

      public static ALcdBasicImage bandMerge(ALcdBasicImage aInputImage, ALcdBasicImage aSecondImage)
      Create a band merge operator with a specified input image.
      Parameters:
      aInputImage - the input image.
      aSecondImage - the image to band merge the input image with.
      Returns:
      a new band merge operator.