Examples of LookupTableJAI


Examples of com.lightcrafts.mediax.jai.LookupTableJAI


    /** Creates the lookup table and computes the inverse mapping. */
    private void createLUT(int ncubes) {
        if (colorMap == null) {
            colorMap = new LookupTableJAI(new byte[3][ncubes]);
        }

        byte[] rLUT = colorMap.getByteData(0);
        byte[] gLUT = colorMap.getByteData(1);
        byte[] bLUT = colorMap.getByteData(2);
View Full Code Here

Examples of com.lightcrafts.mediax.jai.LookupTableJAI

            for(int i = 0; i < 256; i++) {
                b[i] = (byte)i;
            }
        }

        return new LookupTableJAI(data);
    }
View Full Code Here

Examples of com.lightcrafts.mediax.jai.LookupTableJAI

                pb = (new ParameterBlock()).addSource(ri).add(matrix);
                ri = JAI.createRenderable("bandcombine", pb);
            }

            float contrast = paramBlock.getFloatParameter(4);
            LookupTableJAI lut = createContrastLUT(contrast, nBands);

            pb = (new ParameterBlock()).addSource(ri).add(lut);
            ri = JAI.createRenderable("lookup", pb);

            if(isPYCC) {
View Full Code Here

Examples of javax.media.jai.LookupTableJAI

        ParameterBlock pb = new ParameterBlock();
        pb.addSource(img);
        String opName = null;
        if (isErrorDiffusion) {
            opName = "errordiffusion";
            LookupTableJAI lut = new LookupTableJAI(new byte[] {(byte)0x00, (byte)0xff});
            pb.add(lut);
            pb.add(KernelJAI.ERROR_FILTER_FLOYD_STEINBERG);
        } else {
            opName = "ordereddither";
            //Create the color cube.
View Full Code Here

Examples of javax.media.jai.LookupTableJAI

        ParameterBlock pb = new ParameterBlock();
        pb.addSource(img);
        String opName = null;
        if (isErrorDiffusion) {
            opName = "errordiffusion";
            LookupTableJAI lut = new LookupTableJAI(new byte[] {(byte)0x00, (byte)0xff});
            pb.add(lut);
            pb.add(KernelJAI.ERROR_FILTER_FLOYD_STEINBERG);
        } else {
            opName = "ordereddither";
            //Create the color cube.
View Full Code Here

Examples of javax.media.jai.LookupTableJAI

    /**
     * Called when the image colormap is changed
     */
    public void newColormap() {
        LookupTableJAI lutJAI = imageProcessor.getColorLookupTable();
        if (lutJAI != null) {
            lut = lutJAI.getByteData();
        } else {
            defaultColormap();
        }
        repaint();
    }
View Full Code Here

Examples of javax.media.jai.LookupTableJAI

            loadRawImage();
            correctedImage = null;
        }
        if ( correctedImage == null ) {
            createGammaLut();
            LookupTableJAI jailut = new LookupTableJAI( gammaLut );
           
            // TODO: Why setting color model as a rendering hint produces black image???
            correctedImage  = LookupDescriptor.createRenderable( wbAdjustedRawImage, jailut, null );
           
            // Store the color model of the image
View Full Code Here

Examples of javax.media.jai.LookupTableJAI

        }
    }
   
    private void applyGammaLut() {
        createGammaLut();
        LookupTableJAI jailut = new LookupTableJAI( gammaLut );
        if ( correctedImage != null ) {
            correctedImage.setParameter( jailut, 0 );
        }
    }
View Full Code Here

Examples of javax.media.jai.LookupTableJAI

     */
    protected void applyColorMapping() {
        if ( channelMap == null || colorCorrected == null ) {
            return;
        }
        LookupTableJAI jailut = createColorMappingLUT();
        colorCorrected.setParameter( jailut, 0 );
        if ( saturatedIhsImage != null ) {
            saturatedIhsImage.setParameter( createSaturationMappingLUT() , 0 );
        }
       
View Full Code Here

Examples of javax.media.jai.LookupTableJAI

        if ( valueCurve == null ) {
            // No color mapping found, use identity mapping
            valueCurve = new ColorCurve();
        }

        LookupTableJAI jailut = null;
        if ( componentSizes[0] == 8 ) {
            byte[][] lut = new byte[componentSizes.length][256];
            double dx = 1.0/256.0;
            for ( int band = 0 ; band < colorModel.getNumComponents() ; band++ ) {
                for ( int n = 0 ; n < lut[band].length; n++ ) {
                    double x = dx * n;
                    double val = x;
                    if ( band < componentCurves.length && componentCurves[band] != null ) {
                        val = componentCurves[band].getValue( val );
                    }
                    if ( band < applyValueCurve.length && applyValueCurve[band] ) {
                        val = valueCurve.getValue( val );
                    }
                    val = Math.max( 0.0, Math.min( val, 1.0 ) );
                    lut[band][n] = (byte) ((lut[band].length-1) * val);
                }
            }
            jailut = new LookupTableJAI( lut );
        } else if ( componentSizes[0] == 16 ) {
            short[][] lut = new short[componentSizes.length][0x10000];
            double dx = 1.0/65536.0;
            for ( int band = 0 ; band < colorModel.getNumComponents() ; band++ ) {
                for ( int n = 0 ; n < lut[band].length; n++ ) {
                    double x = dx * n;
                    double val = x;
                    if ( band < componentCurves.length && componentCurves[band] != null ) {
                        val = componentCurves[band].getValue( val );
                    }
                    if ( band < applyValueCurve.length && applyValueCurve[band] ) {
                        val = valueCurve.getValue( val );
                    }
                    val = Math.max( 0.0, Math.min( val, 1.0 ) );
                    lut[band][n] = (short) ((lut[band].length-1) * val);
                }
            }
            jailut = new LookupTableJAI( lut, true );
        } else {
            log.error( "Unsupported data type with with = " + componentSizes[0] );
        }
        return jailut;
    }
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.