Package org.broadleafcommerce.openadmin.server.service.artifact.image

Examples of org.broadleafcommerce.openadmin.server.service.artifact.image.Operation


    }

    public Operation[] buildOperations(Map<String, String> parameterMap, InputStream artifactStream, String mimeType) {
        List<Operation> operations = new ArrayList<Operation>();
        for (OperationBuilder builder : filters.values()) {
            Operation operation = builder.buildOperation(parameterMap, artifactStream, mimeType);
            if (operation != null) {
                operations.add(operation);
            }
        }
View Full Code Here


        String key = FilterTypeEnum.ALTERHSB.toString().toLowerCase();
        if (!containsMyFilterParams(key, parameterMap)) {
            return null;
        }

        Operation operation = new Operation();
        operation.setName(key);
        String factor = parameterMap.get(key + "-factor");
        operation.setFactor(factor==null?null:Double.valueOf(factor));

        UnmarshalledParameter hue = new UnmarshalledParameter();
        String hueApplyFactor = parameterMap.get(key + "-hue-apply-factor");
        hue.setApplyFactor(hueApplyFactor==null?false:Boolean.valueOf(hueApplyFactor));
        hue.setName("hue");
        hue.setType(ParameterTypeEnum.FLOAT.toString());
        hue.setValue(parameterMap.get(key + "-hue-amount"));

        UnmarshalledParameter saturation = new UnmarshalledParameter();
        String saturationApplyFactor = parameterMap.get(key + "-saturation-apply-factor");
        saturation.setApplyFactor(saturationApplyFactor == null ? false : Boolean.valueOf(saturationApplyFactor));
        saturation.setName("saturation");
        saturation.setType(ParameterTypeEnum.FLOAT.toString());
        saturation.setValue(parameterMap.get(key + "-saturation-amount"));

        UnmarshalledParameter brightness = new UnmarshalledParameter();
        String brightnessApplyFactor = parameterMap.get(key + "-brightness-apply-factor");
        brightness.setApplyFactor(brightnessApplyFactor == null ? false : Boolean.valueOf(brightnessApplyFactor));
        brightness.setName("brightness");
        brightness.setType(ParameterTypeEnum.FLOAT.toString());
        brightness.setValue(parameterMap.get(key + "-brightness-amount"));

        operation.setParameters(new UnmarshalledParameter[]{hue, saturation, brightness});
        return operation;
    }
View Full Code Here

        if (!containsMyFilterParams(key, parameterMap)) {
            return null;
        }

        Operation operation = new Operation();
        operation.setName(key);
        String factor = parameterMap.get(key + "-factor");
        operation.setFactor(factor==null?null:Double.valueOf(factor));

        UnmarshalledParameter kernelSize = new UnmarshalledParameter();
        String kernelSizeApplyFactor = parameterMap.get(key + "-kernel-size-apply-factor");
        kernelSize.setApplyFactor(kernelSizeApplyFactor == null ? false : Boolean.valueOf(kernelSizeApplyFactor));
        kernelSize.setName("kernel-size");
        kernelSize.setType(ParameterTypeEnum.INT.toString());
        kernelSize.setValue(parameterMap.get(key + "-kernel-size-amount"));

        UnmarshalledParameter numOfPasses = new UnmarshalledParameter();
        String numOfPassesApplyFactor = parameterMap.get(key + "-num-passes-apply-factor");
        numOfPasses.setApplyFactor(numOfPassesApplyFactor == null ? false : Boolean.valueOf(numOfPassesApplyFactor));
        numOfPasses.setName("num-passes");
        numOfPasses.setType(ParameterTypeEnum.INT.toString());
        numOfPasses.setValue(parameterMap.get(key + "-num-passes-amount"));

        operation.setParameters(new UnmarshalledParameter[]{kernelSize, numOfPasses});
        return operation;
    }
View Full Code Here

        if (!containsMyFilterParams(key, parameterMap)) {
            return null;
        }

        Operation operation = new Operation();
        operation.setName(key);

        return operation;
    }
View Full Code Here

        if (!containsMyFilterParams(key, parameterMap)) {
            return null;
        }

        Operation operation = new Operation();
        operation.setName(key);
        String factor = parameterMap.get(key + "-factor");
        operation.setFactor(factor==null?null:Double.valueOf(factor));

        UnmarshalledParameter red = new UnmarshalledParameter();
        String redApplyFactor = parameterMap.get(key + "-red-apply-factor");
        red.setApplyFactor(redApplyFactor == null ? false : Boolean.valueOf(redApplyFactor));
        red.setName("red");
        red.setType(ParameterTypeEnum.INT.toString());
        red.setValue(parameterMap.get(key + "-red-amount"));

        UnmarshalledParameter green = new UnmarshalledParameter();
        String greenApplyFactor = parameterMap.get(key + "-green-apply-factor");
        green.setApplyFactor(greenApplyFactor == null ? false : Boolean.valueOf(greenApplyFactor));
        green.setName("green");
        green.setType(ParameterTypeEnum.INT.toString());
        green.setValue(parameterMap.get(key + "-green-amount"));

        UnmarshalledParameter blue = new UnmarshalledParameter();
        String blueApplyFactor = parameterMap.get(key + "-blue-apply-factor");
        blue.setApplyFactor(blueApplyFactor == null ? false : Boolean.valueOf(blueApplyFactor));
        blue.setName("blue");
        blue.setType(ParameterTypeEnum.INT.toString());
        blue.setValue(parameterMap.get(key + "-blue-amount"));

        operation.setParameters(new UnmarshalledParameter[]{red, green, blue});
        return operation;
    }
View Full Code Here

        if (!containsMyFilterParams(key, parameterMap)) {
            return null;
        }

        Operation operation = new Operation();
        operation.setName(key);
        String factor = parameterMap.get(key + "-factor");
        operation.setFactor(factor==null?null:Double.valueOf(factor));

        UnmarshalledParameter rectangle = new UnmarshalledParameter();
        String rectangleApplyFactor = parameterMap.get(key + "-apply-factor");
        rectangle.setApplyFactor(rectangleApplyFactor == null ? false : Boolean.valueOf(rectangleApplyFactor));
        rectangle.setName("rectangle");
        rectangle.setType(ParameterTypeEnum.RECTANGLE.toString());
        StringBuffer sb = new StringBuffer();
        sb.append(parameterMap.get(key + "-x-amount"));
        sb.append(",");
        sb.append(parameterMap.get(key + "-y-amount"));
        sb.append(",");
        sb.append(parameterMap.get(key + "-width-amount"));
        sb.append(",");
        sb.append(parameterMap.get(key + "-height-amount"));
        rectangle.setValue(sb.toString());

        operation.setParameters(new UnmarshalledParameter[]{rectangle});
        return operation;
    }
View Full Code Here

        if (!containsMyFilterParams(key, parameterMap)) {
            return null;
        }

        Operation operation = new Operation();
        operation.setName(key);
        String factor = parameterMap.get(key + "-factor");
        operation.setFactor(factor==null?null:Double.valueOf(factor));

        UnmarshalledParameter rotate = new UnmarshalledParameter();
        String rotateApplyFactor = parameterMap.get(key + "-rotate-apply-factor");
        rotate.setApplyFactor(rotateApplyFactor == null ? false : Boolean.valueOf(rotateApplyFactor));
        rotate.setName("rotate");
        rotate.setType(ParameterTypeEnum.DOUBLE.toString());
        rotate.setValue(parameterMap.get(key + "-rotate-amount"));

        operation.setParameters(new UnmarshalledParameter[]{rotate});
        return operation;
    }
View Full Code Here

        if (!containsMyFilterParams(key, parameterMap)) {
            return null;
        }

        Operation operation = new Operation();
        operation.setName(key);
        String factor = parameterMap.get(key + "-factor");
        operation.setFactor(factor==null?null:Double.valueOf(factor));

        UnmarshalledParameter targetWidth = new UnmarshalledParameter();
        String targetWidthApplyFactor = parameterMap.get(key + "-width-apply-factor");
        targetWidth.setApplyFactor(targetWidthApplyFactor == null ? false : Boolean.valueOf(targetWidthApplyFactor));
        targetWidth.setName("target-width");
        targetWidth.setType(ParameterTypeEnum.INT.toString());
        targetWidth.setValue(parameterMap.get(key + "-width-amount"));

        UnmarshalledParameter targetHeight = new UnmarshalledParameter();
        String targetHeightApplyFactor = parameterMap.get(key + "-height-apply-factor");
        targetHeight.setApplyFactor(targetHeightApplyFactor == null ? false : Boolean.valueOf(targetHeightApplyFactor));
        targetHeight.setName("target-height");
        targetHeight.setType(ParameterTypeEnum.INT.toString());
        targetHeight.setValue(parameterMap.get(key + "-height-amount"));

        UnmarshalledParameter highQuality = new UnmarshalledParameter();
        highQuality.setName("high-quality");
        highQuality.setType(ParameterTypeEnum.BOOLEAN.toString());
        highQuality.setValue(parameterMap.get(key + "-high-quality")==null?"false":parameterMap.get(key + "-high-quality"));

        UnmarshalledParameter maintainAspectRatio = new UnmarshalledParameter();
        maintainAspectRatio.setName("maintain-aspect-ratio");
        maintainAspectRatio.setType(ParameterTypeEnum.BOOLEAN.toString());
        maintainAspectRatio.setValue(parameterMap.get(key + "-maintain-aspect-ratio") == null ? "false" : parameterMap.get(key + "-maintain-aspect-ratio"));

        UnmarshalledParameter reduceOnly = new UnmarshalledParameter();
        reduceOnly.setName("reduce-only");
        reduceOnly.setType(ParameterTypeEnum.BOOLEAN.toString());
        reduceOnly.setValue(parameterMap.get(key + "-reduce-only") == null ? "false" : parameterMap.get(key + "-reduce-only"));

        operation.setParameters(new UnmarshalledParameter[]{targetWidth, targetHeight, highQuality, maintainAspectRatio, reduceOnly});
        return operation;
    }
View Full Code Here

        if (!containsMyFilterParams(key, parameterMap)) {
            return null;
        }

        Operation operation = new Operation();
        operation.setName(key);
        String factor = parameterMap.get(key + "-factor");
        operation.setFactor(factor==null?null:Double.valueOf(factor));

        UnmarshalledParameter amount = new UnmarshalledParameter();
        String amountApplyFactor = parameterMap.get(key + "-value-apply-factor");
        amount.setApplyFactor(amountApplyFactor == null ? false : Boolean.valueOf(amountApplyFactor));
        amount.setName("value");
        amount.setType(ParameterTypeEnum.FLOAT.toString());
        amount.setValue(parameterMap.get(key + "-value-amount"));

        UnmarshalledParameter radius = new UnmarshalledParameter();
        String radiusApplyFactor = parameterMap.get(key + "-radius-apply-factor");
        radius.setApplyFactor(radiusApplyFactor == null ? false : Boolean.valueOf(radiusApplyFactor));
        radius.setName("radius");
        radius.setType(ParameterTypeEnum.INT.toString());
        radius.setValue(parameterMap.get(key + "-radius-amount"));

        operation.setParameters(new UnmarshalledParameter[]{amount, radius});
        return operation;
    }
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.openadmin.server.service.artifact.image.Operation

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.