Class ImageUtils


  • public class ImageUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ImageUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int[] bytes2int​(byte[] in, int index1, int index2, int index3)  
      static int[] bytes2int​(byte[] in, int index1, int index2, int index3, int index4)  
      static java.awt.image.BufferedImage convert​(java.awt.image.BufferedImage src, int bufImgType)  
      static void getPixelsBGR​(java.awt.image.BufferedImage img, int y, int w, byte[] array, int[] temp)
      returns one row (height == 1) of byte packed image data in BGR or AGBR form
      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​(java.awt.image.BufferedImage img)  
      static void setBGRPixels​(byte[] bgrPixels, java.awt.image.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.
      • Methods inherited from class java.lang.Object

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

      • ImageUtils

        public ImageUtils()
    • Method Detail

      • nrChannels

        public static int nrChannels​(java.awt.image.BufferedImage img)
      • getPixelsBGR

        public static void getPixelsBGR​(java.awt.image.BufferedImage img,
                                        int y,
                                        int w,
                                        byte[] array,
                                        int[] temp)
        returns one row (height == 1) of byte packed image data in BGR or AGBR form
      • setBGRPixels

        public static void setBGRPixels​(byte[] bgrPixels,
                                        java.awt.image.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. 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

        public static java.awt.image.BufferedImage convert​(java.awt.image.BufferedImage src,
                                                           int bufImgType)