Class SamplingFactory

java.lang.Object
org.jpedal.images.SamplingFactory

public final class SamplingFactory extends Object
This class provides options to set the sampling level and apply a sharpening kernel. By default the sharpening level is set to high.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static int
    current setting - do not set directly
    static final int
    (default setting) high will agressively reduce images bigger than twice their drawn size at 100% so a image which appears as 100x100 on the PDF but whose raw images is 250x250 will be stored as 125x125 image and not a 250x250 image
    static final int
    (default setting) high will agressively reduce images bigger than twice their drawn size at 100% so a image which appears as 100x100 on the PDF but whose raw images is 250x250 will be stored as 125x125 image and not a 250x250 image
    static boolean
    current setting - do not set directly
    static boolean
     
    static final int
    medium will make sure images larger than page are reduced in size (often large scanned tiffs)
    static final int
    medium will make sure images larger than page are reduced in size (often large scanned tiffs)
    static int
    do nothing
    static final int
    do not use down-sampling on printing
    static final int
    use down-sampling on printing (which is default)
  • Method Summary

    Modifier and Type
    Method
    Description
    static double[][]
     
    static void
    setDownsampleMode(int newLevel)
    PDFs contain images which may often be much larger than the actual space they occupy and they are reduced to fit the space
    alters image sampling to speed up program and reduce memory with the strategies high, medium, none, enable_printing, disable_printing
    static void
    PDFs contain images which may often be much larger than the actual space they occupy and they are reduced to fit the space
    alters image sampling to speed up program and reduce memory in with the strategies "high","medium", "none", "enable_printing", "disable_printing"
    static void
    setSharpenKernel(double[][] userKernel)
    allow user to over-ride default setting and set their own 3x3 kernel to sharpen down-sampled images

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • none

      public static int none
      do nothing
    • medium

      public static final int medium
      medium will make sure images larger than page are reduced in size (often large scanned tiffs)
      See Also:
    • high

      public static final int high
      (default setting) high will agressively reduce images bigger than twice their drawn size at 100% so a image which appears as 100x100 on the PDF but whose raw images is 250x250 will be stored as 125x125 image and not a 250x250 image
      See Also:
    • mediumAndSharpen

      public static final int mediumAndSharpen
      medium will make sure images larger than page are reduced in size (often large scanned tiffs)
      See Also:
    • highAndSharpen

      public static final int highAndSharpen
      (default setting) high will agressively reduce images bigger than twice their drawn size at 100% so a image which appears as 100x100 on the PDF but whose raw images is 250x250 will be stored as 125x125 image and not a 250x250 image
      See Also:
    • downsampleLevel

      public static int downsampleLevel
      current setting - do not set directly
    • isPrintDownsampleEnabled

      public static boolean isPrintDownsampleEnabled
      current setting - do not set directly
    • kernelSharpen

      public static boolean kernelSharpen
  • Method Details

    • setDownsampleMode

      public static void setDownsampleMode(String newLevel)
      PDFs contain images which may often be much larger than the actual space they occupy and they are reduced to fit the space
      alters image sampling to speed up program and reduce memory in with the strategies "high","medium", "none", "enable_printing", "disable_printing"
      Parameters:
      newLevel - A String value of image sampling strategies
    • setDownsampleMode

      public static void setDownsampleMode(int newLevel)
      PDFs contain images which may often be much larger than the actual space they occupy and they are reduced to fit the space
      alters image sampling to speed up program and reduce memory with the strategies high, medium, none, enable_printing, disable_printing
      Parameters:
      newLevel - A String value of image sampling strategies
    • setSharpenKernel

      public static void setSharpenKernel(double[][] userKernel)
      allow user to over-ride default setting and set their own 3x3 kernel to sharpen down-sampled images
      Parameters:
      userKernel - Kernel used to sharpen image
    • getSharpenKernel

      public static double[][] getSharpenKernel()