public class ImageUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
adjustForXYDPI(RasterMaster snowImage)
This method resizes an image that has an X-DPI that is different the Y-DPI.
|
static int |
getAdjustedHeightForYDPI(RasterMaster snowImage)
Returns height of image adjusted to match the X-DPI (instead of the Y-DPI).
|
static int |
getLargeImageScaleFactor(int width,
int height,
int bitDepth,
long maxImageSize)
Call if scaling is configured (rpConfig.isScalingConfigured()) to determine
the scale factor.
|
static Dimension |
getThumbnailSize(int maxDimension,
int imageWidth,
int imageHeight,
int xDPI,
int yDPI)
Calculate the best dimensions for a thumbnail of a document page with the given width, height, and DPI.
|
static byte[] |
increaseBytes(byte[] inByte)
Return a new byte array with the same contents, double the size of the original.
|
static byte[] |
trimBytes(byte[] inByte,
int realSize)
Trim provided array to the provided size.
|
public static Dimension getThumbnailSize(int maxDimension, int imageWidth, int imageHeight, int xDPI, int yDPI)
maxDimension
- maximum size thumbnail can be scaled to - either width or height, depending on the original image's aspect ratioimageWidth
- original image's widthimageHeight
- original image's heightxDPI
- horizontal dots per inchyDPI
- vertical dots per inchpublic static boolean adjustForXYDPI(RasterMaster snowImage) throws InterruptedException
snowImage
- RasterMaster object containing the image to scaleInterruptedException
public static int getAdjustedHeightForYDPI(RasterMaster snowImage)
snowImage
- RasterMaster object containing the image to measurepublic static byte[] increaseBytes(byte[] inByte)
inByte
- byte array to copy and doublepublic static byte[] trimBytes(byte[] inByte, int realSize)
inByte
- array to trimrealSize
- size to trim array topublic static int getLargeImageScaleFactor(int width, int height, int bitDepth, long maxImageSize)
width
- Width of the image in pixelsheight
- Height of the image in pixelsbitDepth
- Bitdepth of the imagemaxImageSize
- The maximum image size-- width times height -- that should be sent to the clientCopyright © 2020 Snowbound Software Corporation. All rights reserved.