Java BufferedImage Operation fakeAOI(final BufferedImage pImage, final Rectangle pSourceRegion)

Here you can find the source of fakeAOI(final BufferedImage pImage, final Rectangle pSourceRegion)

Description

fake AOI

License

Open Source License

Declaration

public static BufferedImage fakeAOI(final BufferedImage pImage,
            final Rectangle pSourceRegion) 

Method Source Code

//package com.java2s;

import java.awt.*;
import java.awt.image.BufferedImage;

public class Main {
    public static BufferedImage fakeAOI(final BufferedImage pImage,
            final Rectangle pSourceRegion) {
        if (pImage == null) {
            return null;
        }/*w  ww .  ja  v a  2 s  .  c o m*/

        if (pSourceRegion != null) {
            if (pSourceRegion.x != 0 || pSourceRegion.y != 0
                    || pSourceRegion.width != pImage.getWidth()
                    || pSourceRegion.height != pImage.getHeight()) {
                return pImage.getSubimage(pSourceRegion.x, pSourceRegion.y,
                        pSourceRegion.width, pSourceRegion.height);
            }
        }

        return pImage;
    }
}

Related

  1. dye(BufferedImage image, Color color)
  2. ensureIntRGB(final BufferedImage img)
  3. ensureRGBAImage(BufferedImage img)
  4. fadeImageByShape(BufferedImage bimg, Shape arbshape, double alpha, int rule)
  5. fadeImages(BufferedImage source1, BufferedImage source2, BufferedImage target, int relX, int targetX)
  6. findavg(BufferedImage bimg)
  7. findColor(BufferedImage image, int startX, int startY, int dirX, int dirY, int colorIndex)
  8. findDifference(BufferedImage img2, BufferedImage img1)
  9. findDominantColor(BufferedImage paramBufferedImage)