Package com.mortennobel.imagescaling
Class ImageUtils
java.lang.Object
com.mortennobel.imagescaling.ImageUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int[]
bytes2int
(byte[] in, int index1, int index2, int index3) static int[]
bytes2int
(byte[] in, int index1, int index2, int index3, int index4) static BufferedImage
convert
(BufferedImage src, int bufImgType) static byte[]
copyJpegMetaData
(byte[] source, byte[] dest) Copy jpeg meta data (exif) from source to dest and save it to out.static void
copyJpegMetaData
(InputStream source, InputStream dest, ImageOutputStream out) Copy jpeg meta data (exif) from source to dest and save it to outstatic byte[]
getPixelsBGR
(BufferedImage img, int y, int w, byte[] array, int[] temp) returns one row (height == 1) of byte packed image data in BGR or AGBR formstatic String
static void
ints2bytes
(int[] in, byte[] out, int index1, int index2, int index3) static void
ints2bytes
(int[] in, byte[] out, int index1, int index2, int index3, int index4) static int
nrChannels
(BufferedImage img) static void
setBGRPixels
(byte[] bgrPixels, BufferedImage img, int x, int y, int w, int h) converts and copies byte packed BGR or ABGR into the img buffer, the img type may vary (e.g.
-
Constructor Details
-
ImageUtils
public ImageUtils()
-
-
Method Details
-
imageTypeName
-
nrChannels
-
getPixelsBGR
returns one row (height == 1) of byte packed image data in BGR or AGBR form- Parameters:
img
-y
-w
-array
-temp
- must be either null or a array with length of w*h- Returns:
-
setBGRPixels
converts and copies byte packed BGR or ABGR into the img buffer, the img type may vary (e.g. RGB or BGR, int or byte packed) but the number of components (w/o alpha, w alpha, gray) must match does not unmange the image for all (A)RGN and (A)BGR and gray imaged -
ints2bytes
public static void ints2bytes(int[] in, byte[] out, int index1, int index2, int index3) -
ints2bytes
public static void ints2bytes(int[] in, byte[] out, int index1, int index2, int index3, int index4) -
bytes2int
public static int[] bytes2int(byte[] in, int index1, int index2, int index3) -
bytes2int
public static int[] bytes2int(byte[] in, int index1, int index2, int index3, int index4) -
convert
-
copyJpegMetaData
Copy jpeg meta data (exif) from source to dest and save it to out.- Parameters:
source
-dest
-- Returns:
- result
- Throws:
IOException
-
copyJpegMetaData
public static void copyJpegMetaData(InputStream source, InputStream dest, ImageOutputStream out) throws IOException Copy jpeg meta data (exif) from source to dest and save it to out- Parameters:
source
-dest
-out
-- Throws:
IOException
-