Package jjil.core

Examples of jjil.core.Gray8Image


                    imageFirst.toString(),
                    imageSecond.toString(),
                    null);
           
        }
        Gray8Image gray1 = (Gray8Image) imageFirst;
        Gray8Image gray2 = (Gray8Image) imageSecond;
        byte[] data1 = gray1.getData();
        byte[] data2 = gray2.getData();
        for (int i=0; i<data1.length; i++) {
            data1[i] = (byte) Math.min(
                    Byte.MAX_VALUE,
                    Math.max(Byte.MIN_VALUE, (data1[i] + data2[i])));
        }
View Full Code Here


                  null,
                  null);
        }
        RgbImage rgb = (RgbImage) image;
        int[] rgbData = rgb.getData();
        Gray8Image gray = new Gray8Image(image.getWidth(), image.getHeight());
        byte[] grayData = gray.getData();
        if (colorChosen.equals(RED)) {
            for (int i=0; i<image.getWidth() * image.getHeight(); i++) {
                /* get individual color value, unmasking it from the
                 * ARGB word
                 */
 
View Full Code Here

                      ErrorCodes.SHRINK_OUTPUT_LARGER_THAN_INPUT,
                      image.toString(),
                      this.toString(),
                      null);
        }
        Gray8Image input = (Gray8Image) image;
        /* horizontal shrink */
        Gray32Image horiz = shrinkHoriz(input);
        /* vertical shrink */
        Gray8Image result = shrinkVert(horiz);
        super.setOutput(result);
    }
View Full Code Here

     * @param input the input image.
     * @returns the shrunk image.
     */
    private Gray8Image shrinkVert(Gray32Image input) {
        /* vertical shrink */
        Gray8Image vert = new Gray8Image(input.getWidth(), this.cHeight);
        int[] inData = input.getData();
        byte[] outData = vert.getData();
        int[] nPixelSum = new int[input.getWidth()];
        for (int i=0; i<input.getWidth(); i++) {
            nPixelSum[i] = 0;
        }
        int nPos = 0;
View Full Code Here

                    ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                    image.toString(),
                    null,
                    null);
        }
        Gray8Image gray = (Gray8Image) image;
        Gray32Image gray32 = new Gray32Image(image.getWidth(), image.getHeight());
        byte[] grayData = gray.getData();
        int[] gray32Data = gray32.getData();
        for (int i=0; i<gray.getWidth() * gray.getHeight(); i++) {
            /* Convert from signed byte value to unsigned byte for storage
             * in the 32-bit image.
             */
            int grayUnsigned = (grayData[i]) - Byte.MIN_VALUE;
            /* Assign 32-bit output */
 
View Full Code Here

                    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.
             */
            byte r = RgbVal.getR(rgbData[i]);
View Full Code Here

                      ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                      image.toString(),
                      null,
                      null);
        }
        Gray8Image imageInput = (Gray8Image) 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);
        }
        Gray8Image imageResult = new Gray8Image(this.cWidth,this.cHeight);
        byte[] src = imageInput.getData();
        byte[] 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_GRAY8IMAGE,
                      image.toString(),
                      null,
                      null);
        }
        Gray8Image input = (Gray8Image) image;
        Gray8Image result = new Gray8Image(image.getWidth(), image.getHeight());
        byte[] bIn = input.getData();
        byte[] bResult = result.getData();
        int[] wCoeff = this.nCoeff[this.cSigma];
        int cHeight = input.getHeight();
        for (int j=0; j<input.getWidth(); j++) {
            for (int i=0; i<cHeight; i++) {
                /* left side of Gaussian */
 
View Full Code Here

              ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
              image.toString(),
              null,
              null);
        }
        Gray8Image input = (Gray8Image) image;
        Gray8Image result = new Gray8Image(image.getWidth(), image.getHeight());
        byte[] bIn = input.getData();
        byte[] bResult = result.getData();
        int[] wCoeff = this.nCoeff[this.cSigma];
        int cWidth = input.getWidth();
        for (int j=0; j<cWidth; j++) {
            for (int i=0; i<input.getHeight(); i++) {
                /* top side of Canny operator */
 
View Full Code Here

       
        }

        int wInput[] = ((RgbImage)imInput).getData();
        int wBack[] = this.rgbBack.getData();
        Gray8Image grayOut = new Gray8Image(
                this.rgbBack.getWidth(),
                this.rgbBack.getHeight());       
        byte bGray[] = grayOut.getData();
        for (int i=0; i<imInput.getWidth() * imInput.getHeight(); i++) {
            int rIn = RgbVal.getR(wInput[i]);
            int gIn = RgbVal.getG(wInput[i]);
            int bIn = RgbVal.getB(wInput[i]);
            int rBack = RgbVal.getR(wBack[i]);
View Full Code Here

TOP

Related Classes of jjil.core.Gray8Image

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.