Package com.lightcrafts.mediax.jai

Examples of com.lightcrafts.mediax.jai.LookupTableJAI


        if (!MediaLibAccessor.isMediaLibCompatible(args)) {
            return null;
        }

        /* The table should be less than or equal to 4 bands. */
        LookupTableJAI table = (LookupTableJAI)args.getObjectParameter(0);
        if (table.getNumBands() > 4 ||
            table.getDataType() == DataBuffer.TYPE_USHORT) {
            return null;
        }

        return new MlibLookupOpImage(args.getRenderedSource(0),
                                     hints, layout,
View Full Code Here


                interpolator.reset();
                for (int i = 0; i < 0x10000; i++)
                    table[2][i] = (short) (0xffff & (int) Math.min(Math.max(i + 0xff * interpolator.interpolate(i / (double) 0xffff, blueCurve), 0), 0xffff));

                LookupTableJAI lookupTable = new LookupTableJAI(table, true);

                ParameterBlock pb = new ParameterBlock();
                pb.addSource(back);
                pb.add(lookupTable);
                return JAI.create("lookup", pb, JAIContext.noCacheHint);
View Full Code Here

            interpolator.reset();
            for (int i = 0; i < 0x10000; i++)
                table[2][i] = (short) (0xffff & (int) Math.min(Math.max(i + 10 * 0xff * interpolator.interpolate(i / (double) 0xffff, blueCurve), 0), 0xffff));

            LookupTableJAI lookupTable = new LookupTableJAI(table, true);

            ParameterBlock pb = new ParameterBlock();
            pb.addSource(back);
            pb.add(lookupTable);
            return JAI.create("lookup", pb, null);
View Full Code Here

            interpolator.reset();
            for (int i = 0; i < 0x10000; i++)
                table[2][i] = (short) (0xffff & (int) Math.min(Math.max(i + 0xff * interpolator.interpolate(i / (double) 0xffff, blueCurve), 0), 0xffff));

            LookupTableJAI lookupTable = new LookupTableJAI(table, true);

            ParameterBlock pb = new ParameterBlock();
            pb.addSource(image);
            pb.add(lookupTable);
            return JAI.create("lookup", pb, null);
View Full Code Here

                interpolator.reset();
                for (int i = 0; i < 0x10000; i++)
                    table[2][i] = (short) (0xffff & (int) Math.min(Math.max(i + 0xff * interpolator.interpolate(i / (double) 0xffff, blueCurve), 0), 0xffff));

                LookupTableJAI lookupTable = new LookupTableJAI(table, true);

                ParameterBlock pb = new ParameterBlock();
                pb.addSource(back);
                pb.add(lookupTable);
                return JAI.create("lookup", pb, JAIContext.noCacheHint);
View Full Code Here

        Cube cube = new Cube(getSourceImage(0), maxColorNum);
        cube.constructTree();
        cube.reduction();
        cube.assignment();

        colorMap = new LookupTableJAI(cube.colormap);
        setProperty("LUT", colorMap);
        setProperty("JAI.LookupTable", colorMap);
    }
View Full Code Here

                    ImageUtil.clampRoundByte(binarySearch(x, yL, yH, a, b, value));
            }
        }

        // Construct the lookup table.
        lut = new LookupTableJAI(data);
    }
View Full Code Here

        setProperty("LUT", colorMap);
        setProperty("JAI.LookupTable", colorMap);
    }

    private void createLUT() {
        colorMap = new LookupTableJAI(new byte[3][maxColorNum]);
        byte[][] map = colorMap.getByteData();
        int[] index = new int[maxColorNum];
        for (int i = 0; i < maxColorNum; i++)
            index[network[i][3]] = i;
        for (int i = 0; i < maxColorNum; i++) {
View Full Code Here

     */
    public RenderedImage create(ParameterBlock args,
                                RenderingHints hints) {
        // Get source and parameters.
        RenderedImage source = args.getRenderedSource(0);
        LookupTableJAI colorMap =
            (LookupTableJAI)args.getObjectParameter(0);
        KernelJAI errorKernel = (KernelJAI)args.getObjectParameter(1);

        // Check colorMap compatibility.
        if(colorMap.getNumBands() != 1 &&
           colorMap.getNumBands() != 3) {
            // 1 or 3 band colorMaps only.
            return null;
        } else if(colorMap.getDataType() != DataBuffer.TYPE_BYTE) {
            // byte colorMaps only
            return null;
        }

        // Check source compatibility.
        SampleModel sourceSM = source.getSampleModel();
        if(sourceSM.getDataType() != DataBuffer.TYPE_BYTE) {
            // byte source images only
            return null;
        } else if(sourceSM.getNumBands() != colorMap.getNumBands()) {
            // band counts must match
            return null;
        }

        // Get ImageLayout from RenderingHints if any.
View Full Code Here

        // Get ImageLayout from renderHints if any.
        ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
       

        RenderedImage source = paramBlock.getRenderedSource(0);
        LookupTableJAI lookupTable =
            (LookupTableJAI)paramBlock.getObjectParameter(0);
        KernelJAI kernel = (KernelJAI)paramBlock.getObjectParameter(1);

        return new ErrorDiffusionOpImage(source, renderHints, layout,
                                         lookupTable, kernel);
View Full Code Here

TOP

Related Classes of com.lightcrafts.mediax.jai.LookupTableJAI

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.