Package jjil.core

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


                            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

                      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

              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

        // 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

                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

                            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

                  image.toString(),
                  null,
                  null);
        }
        Gray8Image gray = (Gray8Image) image;
        RgbImage rgb = new RgbImage(image.getWidth(), image.getHeight());
        byte[] grayData = gray.getData();
        int[] rgbData = rgb.getData();
        for (int i=0; i<gray.getWidth() * gray.getHeight(); i++) {
            /* Convert from signed byte value to unsigned byte for storage
             * in the RGB image.
             */
            int grayUnsigned = (grayData[i]) - Byte.MIN_VALUE;
View Full Code Here

       
        int cWidth  = imageInput.getWidth();
        int cHeight = imageInput.getHeight();
        int rgbInput[] = ((RgbImage)imageInput).getData();
       
        RgbImage imageResult = new RgbImage(cWidth, cHeight);
        int[] rgbOutput = imageResult.getData();
       
        for(int i=0;i<cHeight;i++) {
            /* declare and initialize integers which will hold the r, g, and b
             * pixel values. The variables are named and numbered as if
             * they were array indices for three different 3x3 arrays.
View Full Code Here

                            ErrorCodes.IMAGE_NOT_RGBIMAGE,
                            imageInput.toString(),
                            null,
                            null);
        }
        RgbImage rgbInput = (RgbImage) imageInput;
        RgbMaskedImage rgbOutput = new RgbMaskedImage(rgbInput);
        buildVector(rgbInput.getWidth(), rgbInput.getHeight());
        for (int i=0; i<rgbInput.getHeight(); i++) {
            if (this.rnX[i] != null) {
                for (int j=0; j<this.rnX[i].length; j+= 2) {
                    for (int k = this.rnX[i][j]; k<this.rnX[i][j+1]; k++) {
                        rgbOutput.setMask(i, k);
                    }
View Full Code Here

TOP

Related Classes of jjil.core.RgbImage

Copyright © 2018 www.massapicom. 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.