Class PDFImageColorModel.SoftMask

  • Enclosing class:
    PDFImageColorModel

    protected static class PDFImageColorModel.SoftMask
    extends java.lang.Object
    A representation of the alpha channel. The SoftMask maintains a width, height, & bitspersample, since they do not necessarily have to be the same as the source image's. Can also contain a Matte array, which controls premultiplication of source color samples.
    • Constructor Summary

      Constructors 
      Constructor Description
      SoftMask​(byte[] alpha, int w, int h, int bps, float[] marray)
      Create SoftMask.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float getAlpha​(int x, int y)
      returns the alpha value that would be mapped to the point in the source image.
      int getUnnormalizedAlpha​(int x, int y)  
      void setSourceImageSize​(int sw, int sh)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • width

        public int width
      • height

        public int height
      • bitspersample

        public int bitspersample
      • alphabits

        public byte[] alphabits
      • matte

        public float[] matte
    • Constructor Detail

      • SoftMask

        public SoftMask​(byte[] alpha,
                        int w,
                        int h,
                        int bps,
                        float[] marray)
        Create SoftMask.
    • Method Detail

      • setSourceImageSize

        public void setSourceImageSize​(int sw,
                                       int sh)
      • getAlpha

        public float getAlpha​(int x,
                              int y)
        returns the alpha value that would be mapped to the point in the source image. Since the image dimensions may not match the mask dimensions, these routines find the alpha value based on the sizes of the source and destination.
      • getUnnormalizedAlpha

        public int getUnnormalizedAlpha​(int x,
                                        int y)