Class SimpleImageScaler

java.lang.Object
loci.common.image.SimpleImageScaler
All Implemented Interfaces:
IImageScaler

public class SimpleImageScaler
extends java.lang.Object
implements IImageScaler
Basic implementation of IImageScaler. A n-by-n source region is transformed to 1 output pixel by picking the upper-left-most of the n-by-n pixels.
  • Constructor Summary

    Constructors 
    Constructor Description
    SimpleImageScaler()  
  • Method Summary

    Modifier and Type Method Description
    byte[] downsample​(byte[] srcImage, int width, int height, double scaleFactor, int bytesPerPixel, boolean littleEndian, boolean floatingPoint, int channels, boolean interleaved)
    Downsamples the given image.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • downsample

      public byte[] downsample​(byte[] srcImage, int width, int height, double scaleFactor, int bytesPerPixel, boolean littleEndian, boolean floatingPoint, int channels, boolean interleaved)
      Description copied from interface: IImageScaler
      Downsamples the given image.
      Specified by:
      downsample in interface IImageScaler
      Parameters:
      srcImage - a byte array representing the image to be downsampled
      width - the width in pixels of the source image
      height - the height in pixels of the source image
      scaleFactor - the value used to calculate the downsampled width and height; expected to be greater than 1
      bytesPerPixel - the number of bytes in one pixel (usually 1, 2, 4, or 8)
      littleEndian - true if bytes in a pixel are stored in little endian order
      floatingPoint - true if the pixels should be interpreted as float or double instead of uint32/uint64
      channels - the number of RGB channels included in srcImage
      interleaved - true if the RGB channels are stored in interleaved order (RGBRGBRGB... and not RRR...GGG...BBB)
      Returns:
      the downsampled image
      See Also:
      IImageScaler.downsample(byte[], int, int, double, int, boolean, boolean, int, boolean)