Examples of RgbMaskedImage


Examples of jjil.core.RgbMaskedImage

                            ErrorCodes.OBJECT_NOT_EXPECTED_TYPE,
                            image.toString(),
                            "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);
                    int nGreen = RgbVal.getG(nColorPixel);
                    int nBlue = RgbVal.getB(nColorPixel);
                    nRed = Math.max(Byte.MIN_VALUE,
                                Math.min(Byte.MAX_VALUE,
                                (nRed*this.nDim)>>8));
                    nGreen = Math.max(Byte.MIN_VALUE,
                                Math.min(Byte.MAX_VALUE,
                                (nGreen*this.nDim)>>8));
                    nBlue = Math.max(Byte.MIN_VALUE,
                                Math.min(Byte.MAX_VALUE,
                                (nBlue*this.nDim)>>8));
                    dst[i*rgbImage.getWidth()+j] =
                        RgbVal.toRgb((byte)nRed, (byte)nGreen, (byte)nBlue);
                } else {
                    dst[i*rgbImage.getWidth()+j] = nColorPixel;
                }
            }
        }
        super.setOutput(rgbOutput);
    }
View Full Code Here

Examples of jjil.core.RgbMaskedImage

                imInput.toString(),
                this.rgbBack.toString(),
                null);
       
        }
        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]);
 
View Full Code Here

Examples of jjil.core.RgbMaskedImage

                            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);
                    }
                }
            }
        }
        super.setOutput(rgbOutput);
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.