Package jjil.core

Examples of jjil.core.Gray8Image


                    ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                    image.toString(),
                    null,
                    null);
        }
        Gray8Image input = (Gray8Image) image;
        byte[] bIn = input.getData();
        for (int i=0; i<bIn.length; i++) {
           bIn[i] = (byte) Math.min(Byte.MIN_VALUE,
               Math.min(Byte.MAX_VALUE, this.mN * bIn[i]));
        }
        super.setOutput(input);
View Full Code Here


                    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] =
                    (data1[i] == Byte.MAX_VALUE && data2[i] == Byte.MAX_VALUE) ?
                        Byte.MAX_VALUE : Byte.MIN_VALUE;
        }
View Full Code Here

            null,
            null);

        }
        Gray32Image gray32 = (Gray32Image) image;
        Gray8Image gray8 = new Gray8Image(image.getWidth(), image.getHeight());
        int[] gray32Data = gray32.getData();
        byte[] gray8Data = gray8.getData();
        for (int i=0; i<gray32.getWidth() * gray32.getHeight(); i++) {
            /* Convert from 32-bit value to 8-bit value.
             */
             /* Assign 8-bit output */
            gray8Data[i] = (byte
View Full Code Here

         * the input image. But my own feeling is that it is OK if
         * they don't match. The result will be a working lookup
         * table, in any case, though the histogram won't quite
         * match what was intended.
         */
        Gray8Image input = (Gray8Image) image;
        // get the input histogram
        int[] histCum = Gray8Hist.computeHistogram(input);
        // for the purposes of computation below we need a cumulative
        // pixel count, not a histogram
        for (int i=1; i<256; i++) {
View Full Code Here

                    null);
        }
        if (this.imageOutput == null ||
          this.imageOutput.getWidth() != image.getWidth() ||
          this.imageOutput.getHeight() != image.getHeight()) {
          this.imageOutput = new Gray8Image(
              image.getWidth(),
              image.getHeight());
        }
        Gray32Image gray = (Gray32Image) image;
        int[] data = gray.getData();
View Full Code Here

            image.toString(),
            null,
            null);
        }
        Gray16Image gray = (Gray16Image) image;
        Gray8Image gray8 = new Gray8Image(image.getWidth(), image.getHeight());
        short[] grayData = gray.getData();
        byte[] gray8Data = gray8.getData();
        for (int i=0; i<gray.getWidth() * gray.getHeight(); i++) {
            /* Convert from 16-bit value to 8-bit value, discarding
             * most significant bits.
             */
            gray8Data[i] = (byte) (grayData[i] & 0xff);
View Full Code Here

            this.fft = new Fft1d(Math.max(nWidth, nHeight));
        } else {
            this.fft.setMaxWidth(Math.max(nWidth, nHeight));
        }
       
        Gray8Image gray = (Gray8Image) im;
        byte data[] = gray.getData();
        // create output
        Complex32Image cxmResult = new Complex32Image(nWidth, nHeight);
        // take FFT of each row
        int nIndex = 0;
        Complex cxRow[] = new Complex[nWidth];
View Full Code Here

                      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;
View Full Code Here

       
        }
        RgbMaskedImage rgbInput = (RgbMaskedImage)imInput;
        int wInput[] = rgbInput.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.getHeight(); i++) {
            for (int j=0; j<imInput.getWidth(); j++) {
                if (!rgbInput.isMasked(i, j) && !this.rgbBack.isMasked(i,j)) {
                    int rIn = RgbVal.getR(wInput[i*grayOut.getWidth()+j]);
                    int gIn = RgbVal.getG(wInput[i*grayOut.getWidth()+j]);
                    int bIn = RgbVal.getB(wInput[i*grayOut.getWidth()+j]);
                    int rBack = RgbVal.getR(wBack[i*grayOut.getWidth()+j]);
                    int gBack = RgbVal.getG(wBack[i*grayOut.getWidth()+j]);
                    int bBack = RgbVal.getB(wBack[i*grayOut.getWidth()+j]);
                    int gRes = Math.abs(rIn-rBack) +
                            Math.abs(gIn-gBack) +
                            Math.abs(bIn-bBack);
                    bGray[i*grayOut.getWidth()+j] =
                            (byte) Math.min(gRes, Byte.MAX_VALUE);
                } else {
                    bGray[i] = Byte.MIN_VALUE;
                }
            }
View Full Code Here

        }
        int nHeight = this.nRowEnd - this.nRowStart;
      int nWidth = Math.max(
                this.nColRightStart - this.nColLeftStart,
                this.nColRightEnd - this.nColLeftEnd);
        this.imageOutput = new Gray8Image(nWidth, nHeight);

    }
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.