Examples of RgbImage


Examples of jjil.core.RgbImage

                            "RgbMaskedImage",
                            null);
        }
        RgbMaskedImage rgbImage = (RgbMaskedImage) image;
        int[] src = rgbImage.getData();
        RgbImage rgbOutput = new RgbImage(rgbImage.getWidth(), rgbImage.getHeight());
        int[] dst = rgbOutput.getData();
        for (int i=0; i<rgbImage.getHeight(); i++) {
            for (int j=0; j<rgbImage.getWidth(); j++) {
                int nColorPixel = src[i*rgbImage.getWidth() + j];
                if (rgbImage.isMasked(i, j)) {
                    int nRed = RgbVal.getR(nColorPixel);
View Full Code Here

Examples of jjil.core.RgbImage

                      ErrorCodes.IMAGE_NOT_RGBIMAGE,
                      image.toString(),
                      null,
                      null);
        }
        RgbImage imageInput = (RgbImage) image;
        int[] rgb = imageInput.getData();
        for (int i=0; i<imageInput.getHeight() * imageInput.getWidth(); i++) {
            // the scaling has to be done on unsigned values.
            int nRed = RgbVal.getR(rgb[i]) - Byte.MIN_VALUE;
            int nGreen = RgbVal.getG(rgb[i]) - Byte.MIN_VALUE;
            int nBlue = RgbVal.getB(rgb[i]) - Byte.MIN_VALUE;
            // scale and convert back to signed byte values
View Full Code Here

Examples of jjil.core.RgbImage

                      ErrorCodes.IMAGE_NOT_RGBIMAGE,
                      imageInput.toString(),
                      null,
                      null);
        }
        RgbImage rgbInput = (RgbImage) imageInput;
        int [] rgbData = rgbInput.getData();
        Gray8Image grayOutput = new Gray8Image(
                rgbInput.getWidth(),
                rgbInput.getHeight());
        byte [] grayData = grayOutput.getData();
        for (int i=0; i<rgbInput.getHeight()*rgbInput.getWidth(); i++) {
            int nR = RgbVal.getR(rgbData[i]);
            int nG = RgbVal.getG(rgbData[i]);
            int nB = RgbVal.getB(rgbData[i]);
            int nMinVal = Integer.MAX_VALUE;
            for (int j=0; j<this.nRgbVecs.length; j++) {
View Full Code Here

Examples of jjil.core.RgbImage

                            jjil.core.ErrorCodes.NO_RESULT_AVAILABLE,
                            null,
                            null,
                            null);
        }
        RgbImage rgbImage = new RgbImage(
                this.rgbInput.getWidth(),
                this.rgbInput.getHeight());
        for (Enumeration e = this.vecROk.elements(); e.hasMoreElements();) {
            RgbRegion r = (RgbRegion) e.nextElement();
            int nRgb = RgbVal.toRgb(
                    (byte)((this.random.nextInt()&0xff)+Byte.MIN_VALUE),
                    (byte)((this.random.nextInt()&0xff)+Byte.MIN_VALUE),
                    (byte)((this.random.nextInt()&0xff)+Byte.MIN_VALUE));
            Rect rect = r.getRect();
            rgbImage = rgbImage.fill(rect, nRgb);
        }
        return rgbImage;
       
    }
View Full Code Here

Examples of jjil.core.RgbImage

                            jjil.core.ErrorCodes.NO_RESULT_AVAILABLE,
                            null,
                            null,
                            null);
        }
        RgbImage rgbImage = new RgbImage(
                this.rgbInput.getWidth(),
                this.rgbInput.getHeight());
        for (Enumeration e = this.vecROk.elements(); e.hasMoreElements();) {
            RgbRegion r = (RgbRegion) e.nextElement();
            int nRgb = r.getColor();
            Rect rect = r.getRect();
            rgbImage = rgbImage.fill(rect, nRgb);
        }
        return rgbImage;
    }
View Full Code Here

Examples of jjil.core.RgbImage

                      ErrorCodes.IMAGE_NOT_RGBIMAGE,
                      image.toString(),
                      null,
                      null);
        }
        RgbImage imageInput = (RgbImage) image;
        if (this.cX + this.cWidth > image.getWidth() ||
            this.cY + this.cHeight > image.getHeight()) {
            throw new Error(
                            Error.PACKAGE.CORE,
                            jjil.core.ErrorCodes.BOUNDS_OUTSIDE_IMAGE,
                            image.toString(),
                            this.toString(),
                            null);
        }
        RgbImage imageResult = new RgbImage(this.cWidth,this.cHeight);
        int[] src = imageInput.getData();
        int[] dst = imageResult.getData();
        for (int i=0; i<this.cHeight; i++) {
            System.arraycopy(
                    src,
                    (i+this.cY)*image.getWidth() + this.cX,
                    dst,
View Full Code Here

Examples of jjil.core.RgbImage

              ErrorCodes.IMAGE_NOT_RGBIMAGE,
              image.toString(),
              null,
              null);
        }
        RgbImage rgb = (RgbImage) image;
        int[] rgbData = rgb.getData();
        Gray8Image gray = new Gray8Image(image.getWidth(), image.getHeight());
        byte[] grayData = gray.getData();
        for (int i=0; i<image.getWidth() * image.getHeight(); i++) {
            /* get individual r, g, and b values, unmasking them from the
             * ARGB word. The r, g, and b values are signed values
View Full Code Here

Examples of jjil.core.RgbImage

        // e.g. cReduceWidth * this.cTargetWidth <= image.getWidth
        // This is important in the for loop below to keep from out of bounds
        // array access.
        int cReduceWidth = image.getWidth() / this.cTargetWidth;
        int cReduceHeight = image.getHeight() / this.cTargetHeight;
        RgbImage rgb = (RgbImage) image;
        int[] rnIn = rgb.getData();
        RgbImage result = new RgbImage(
            this.cTargetWidth,
            this.cTargetHeight);
        int[] rnOut = result.getData();
        for (int i=0; i<this.cTargetHeight; i++) {
            for (int j=0; j<this.cTargetWidth; j++) {
                rnOut[i*this.cTargetWidth + j] =
                  rnIn[(i*image.getWidth()*cReduceHeight) + (j*cReduceWidth)];
            }
View Full Code Here

Examples of jjil.core.RgbImage

                imInput.toString(),
                this.rgbBack.toString(),
                null);
       
        }
        RgbImage rgbInput = (RgbImage)imInput;
        int wInput[] = rgbInput.getData();
        int wBack[] = this.rgbBack.getData();
        Gray8Image grayOut = new Gray8Image(
                this.rgbBack.getWidth(),
                this.rgbBack.getHeight());       
        byte bGray[] = grayOut.getData();
View Full Code Here

Examples of jjil.core.RgbImage

                            ErrorCodes.IMAGE_NOT_RGBIMAGE,
                            imageInput.toString(),
                            null,
                            null);
        }
        RgbImage rgb = (RgbImage) imageInput;
        int[] nData = rgb.getData();
        Gray8Image imageResult = new Gray8Image(rgb.getWidth(), rgb.getHeight());
        byte[] bData = imageResult.getData();
        for (int i=0; i<rgb.getWidth()*rgb.getHeight(); i++) {
            int nRCurr = RgbVal.getR(nData[i]) - Byte.MIN_VALUE;
            int nGCurr = RgbVal.getG(nData[i]) - Byte.MIN_VALUE;
            int nBCurr = RgbVal.getB(nData[i]) - Byte.MIN_VALUE;
            int nRDiff = nRCurr - this.nR;
            int nGDiff = nGCurr - this.nG;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.