com.mortennobel.imagescaling
Class ImageUtils

java.lang.Object
  extended by com.mortennobel.imagescaling.ImageUtils

public class ImageUtils
extends java.lang.Object

Author:
Heinz Doerr

Constructor Summary
ImageUtils()
           
 
Method Summary
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 byte[] 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 java.lang.String imageTypeName(java.awt.image.BufferedImage img)
           
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

imageTypeName

public static java.lang.String imageTypeName(java.awt.image.BufferedImage img)

nrChannels

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

getPixelsBGR

public static byte[] 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

Parameters:
img -
y -
w -
array -
temp - must be either null or a array with length of w*h
Returns:

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)


Copyright © 2010. All Rights Reserved.