Package com.lightcrafts.mediax.jai

Examples of com.lightcrafts.mediax.jai.EnumeratedParameter


        /* Get BorderExtender from hints if any. */
        BorderExtender extender = RIFUtil.getBorderExtenderHint(hints);

        float shear_amt = args.getFloatParameter(0);
        EnumeratedParameter shear_dir =
            (EnumeratedParameter)args.getObjectParameter(1);
        float xTrans = args.getFloatParameter(2);
        float yTrans = args.getFloatParameter(3);
        double[] backgroundValues = (double[])args.getObjectParameter(5);

        // Create the affine transform
        AffineTransform tr = new AffineTransform();

        if (shear_dir.equals(ShearDescriptor.SHEAR_HORIZONTAL)) {
            // SHEAR_HORIZONTAL
            tr.setTransform(1.0, 0.0, shear_amt, 1.0, xTrans, 0.0);
        } else {
            // SHEAR_VERTICAL
            tr.setTransform(1.0, shear_amt, 0.0, 1.0, 0.0, yTrans);
View Full Code Here


        BorderExtender extender = RIFUtil.getBorderExtenderHint(renderHints);

        RenderedImage source = paramBlock.getRenderedSource(0);

        float shear_amt = paramBlock.getFloatParameter(0);
        EnumeratedParameter shear_dir =
            (EnumeratedParameter)paramBlock.getObjectParameter(1);

        float xTrans = paramBlock.getFloatParameter(2);
        float yTrans = paramBlock.getFloatParameter(3);

        Object arg1 = paramBlock.getObjectParameter(4);
        Interpolation interp = (Interpolation)arg1;

        double[] backgroundValues = (double[])paramBlock.getObjectParameter(5);

        // Create the affine transform
        AffineTransform tr = new AffineTransform();

        if (shear_dir.equals(ShearDescriptor.SHEAR_HORIZONTAL)) {
            // SHEAR_HORIZONTAL
            tr.setTransform(1.0, 0.0, shear_amt, 1.0, xTrans, 0.0);
        } else {
            // SHEAR_VERTICAL
            tr.setTransform(1.0, shear_amt, 0.0, 1.0, 0.0, yTrans);
View Full Code Here

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

        RenderedImage source = paramBlock.getRenderedSource(0);
        EnumeratedParameter scalingType =
            (EnumeratedParameter)paramBlock.getObjectParameter(0);
        EnumeratedParameter dataNature =
            (EnumeratedParameter)paramBlock.getObjectParameter(1);

        FFT fft = new FFT(false, new Integer(scalingType.getValue()), 2);

        return new DFTOpImage(source, renderHints, layout, dataNature, fft);
View Full Code Here

      alpha2 = (RenderedImage)args.getObjectParameter(1);
  }

        boolean premultiplied =
            ((Boolean)args.getObjectParameter(2)).booleanValue();
        EnumeratedParameter destAlpha =
            (EnumeratedParameter)args.getObjectParameter(3);

        if (destAlpha.equals(CompositeDescriptor.NO_DESTINATION_ALPHA)) {
            return new CompositeNoDestAlphaOpImage(source1, source2,
                                                   hints, layout,
                                                   alpha1, alpha2,
                                                   premultiplied);
        } else {
            return new CompositeOpImage(source1, source2,
                                        hints, layout,
                                        alpha1, alpha2,
                                        premultiplied,
                     destAlpha.equals(CompositeDescriptor.DESTINATION_ALPHA_FIRST));
        }
    }
View Full Code Here

        if((serverMask & SERVER_JPEG_FULL) != SERVER_JPEG_FULL &&
           (serverMask & SERVER_FPX_FULL) != SERVER_FPX_FULL) {
            if((opMask & MASK_ROTATION) != 0) {
          // NOTE: The transpose operation uses clockwise rotation
          // whereas this operation expects counterclockwise.
                EnumeratedParameter transposeType = null;
                switch(paramBlock.getIntParameter(9)) {
                case 90:
                    transposeType = TransposeDescriptor.ROTATE_270;
                    break;
                case 180:
                    transposeType = TransposeDescriptor.ROTATE_180;
                    break;
                case 270:
                    transposeType = TransposeDescriptor.ROTATE_90;
                    break;
                }
                if(transposeType != null) { // deliberately redundant test
                    rendering =
                        JAI.create("transpose", rendering, transposeType);
                }
            }

            if((opMask & MASK_MIRROR_AXIS) != 0) {
                String axis = (String)paramBlock.getObjectParameter(10);
                EnumeratedParameter transposeType =
                    axis.equalsIgnoreCase("x") ?
                    TransposeDescriptor.FLIP_VERTICAL :
                    TransposeDescriptor.FLIP_HORIZONTAL;
                rendering = JAI.create("transpose", rendering, transposeType);
            }
View Full Code Here

        ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
       

        RenderedImage source = paramBlock.getRenderedSource(0);

        EnumeratedParameter type =
            (EnumeratedParameter)paramBlock.getObjectParameter(0);

        SampleModel sm = source.getSampleModel();
        if ((sm instanceof MultiPixelPackedSampleModel) &&
            (sm.getSampleSize(0) == 1) &&
            (sm.getDataType() == DataBuffer.TYPE_BYTE ||
             sm.getDataType() == DataBuffer.TYPE_USHORT ||
             sm.getDataType() == DataBuffer.TYPE_INT)) {
            return new TransposeBinaryOpImage(source, renderHints, layout,
                                              type.getValue());
        } else {
            return new TransposeOpImage(source, renderHints, layout,
                                        type.getValue());
        }
    }
View Full Code Here

TOP

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

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.