Examples of ColorProfile


Examples of edu.harvard.hul.ois.ots.schemas.MIX.ColorProfile

            iam.setImageColorEncoding(ice);
            gci = new GeneralCaptureInformation ();
            icm.setGeneralCaptureInformation(gci);
           
            // Here are some pieces which are constructed once, but added only if they're needed.
            cp = new ColorProfile ();           // Add this to phi if needed
            iccp = new IccProfile();            // Add this to cp if needed
            ycbcr = new YCbCr ();               // Add this to phi if needed
            sfc = new SpecialFormatCharacteristics()// Add this to bii if needed
            jp2000 = new JPEG2000 ();           // Add this to sfc if needed
            eo = new EncodingOptions ();
View Full Code Here

Examples of org.apache.fop.fo.pagination.ColorProfile

    public Property eval(Property[] args,
                         PropertyInfo pInfo) throws PropertyException {
        // Map color profile NCNAME to src from declarations/color-profile element
        String colorProfileName = args[3].getString();
        Declarations decls = pInfo.getFO().getRoot().getDeclarations();
        ColorProfile cp = null;
        if (decls == null) {
            //function used in a color-specification
            //on a FO occurring:
            //a) before the fo:declarations,
            //b) or in a document without fo:declarations?
            //=> return the sRGB fallback
            Property[] rgbArgs = new Property[3];
            System.arraycopy(args, 0, rgbArgs, 0, 3);
            return new RGBColorFunction().eval(rgbArgs, pInfo);
        } else {
            cp = decls.getColorProfile(colorProfileName);
            if (cp == null) {
                PropertyException pe = new PropertyException("The " + colorProfileName
                        + " color profile was not declared");
                pe.setPropertyInfo(pInfo);
                throw pe;
            }
        }
        String src = cp.getSrc();
       
        float red = 0, green = 0, blue = 0;
        red = args[0].getNumber().floatValue();
        green = args[1].getNumber().floatValue();
        blue = args[2].getNumber().floatValue();
View Full Code Here

Examples of org.apache.fop.fo.pagination.ColorProfile

    public Property eval(Property[] args,
                         PropertyInfo pInfo) throws PropertyException {
        // Map color profile NCNAME to src from declarations/color-profile element
        String colorProfileName = args[3].getString();
        Declarations decls = pInfo.getFO().getRoot().getDeclarations();
        ColorProfile cp = null;
        if (decls == null) {
            //function used in a color-specification
            //on a FO occurring:
            //a) before the fo:declarations,
            //b) or in a document without fo:declarations?
            //=> return the sRGB fallback
            if (!ColorUtil.isPseudoProfile(colorProfileName)) {
                Property[] rgbArgs = new Property[3];
                System.arraycopy(args, 0, rgbArgs, 0, 3);
                return new RGBColorFunction().eval(rgbArgs, pInfo);
            }
        } else {
            cp = decls.getColorProfile(colorProfileName);
            if (cp == null) {
                if (!ColorUtil.isPseudoProfile(colorProfileName)) {
                    PropertyException pe = new PropertyException("The " + colorProfileName
                            + " color profile was not declared");
                    pe.setPropertyInfo(pInfo);
                    throw pe;
                }
            }
        }
        String src = (cp != null ? cp.getSrc() : "");

        float red = 0, green = 0, blue = 0;
        red = args[0].getNumber().floatValue();
        green = args[1].getNumber().floatValue();
        blue = args[2].getNumber().floatValue();
View Full Code Here

Examples of org.apache.fop.fo.pagination.ColorProfile

        // Map color profile NCNAME to src from declarations/color-profile element
        String colorProfileName = args[3].getString();
        Declarations decls = (pInfo.getFO() != null
                ? pInfo.getFO().getRoot().getDeclarations()
                : null);
        ColorProfile cp = null;
        if (decls == null) {
            //function used in a color-specification
            //on a FO occurring:
            //a) before the fo:declarations,
            //b) or in a document without fo:declarations?
            //=> return the sRGB fallback
            if (!ColorUtil.isPseudoProfile(colorProfileName)) {
                Property[] rgbArgs = new Property[3];
                System.arraycopy(args, 0, rgbArgs, 0, 3);
                return new RGBColorFunction().eval(rgbArgs, pInfo);
            }
        } else {
            cp = decls.getColorProfile(colorProfileName);
            if (cp == null) {
                if (!ColorUtil.isPseudoProfile(colorProfileName)) {
                    PropertyException pe = new PropertyException("The " + colorProfileName
                            + " color profile was not declared");
                    pe.setPropertyInfo(pInfo);
                    throw pe;
                }
            }
        }
        String src = (cp != null ? cp.getSrc() : "");

        float red = 0;
        float green = 0;
        float blue = 0;
        red = args[0].getNumber().floatValue();
View Full Code Here

Examples of org.apache.fop.fo.pagination.ColorProfile

        String colorName = args[4].getString();

        Declarations decls = (pInfo.getFO() != null
                ? pInfo.getFO().getRoot().getDeclarations()
                : null);
        ColorProfile cp = null;
        if (decls != null) {
            cp = decls.getColorProfile(colorProfileName);
        }
        if (cp == null) {
            PropertyException pe = new PropertyException("The " + colorProfileName
                    + " color profile was not declared");
            pe.setPropertyInfo(pInfo);
            throw pe;
        }

        float red = 0;
        float green = 0;
        float blue = 0;
        red = args[0].getNumber().floatValue();
        green = args[1].getNumber().floatValue();
        blue = args[2].getNumber().floatValue();
        /* Verify rgb replacement arguments */
        if ((red < 0 || red > 255)
                || (green < 0 || green > 255)
                || (blue < 0 || blue > 255)) {
            throw new PropertyException("sRGB color values out of range. "
                    + "Arguments to rgb-named-color() must be [0..255] or [0%..100%]");
        }

        // rgb-named-color is replaced with fop-rgb-named-color which has an extra argument
        // containing the color profile src attribute as it is defined in the color-profile
        // declarations element.
        StringBuffer sb = new StringBuffer();
        sb.append("fop-rgb-named-color(");
        sb.append(red / 255f);
        sb.append(',').append(green / 255f);
        sb.append(',').append(blue / 255f);
        sb.append(',').append(colorProfileName);
        sb.append(',').append(cp.getSrc());
        sb.append(", '").append(colorName).append('\'');
        sb.append(")");

        return ColorProperty.getInstance(pInfo.getUserAgent(), sb.toString());
    }
View Full Code Here

Examples of org.apache.fop.fo.pagination.ColorProfile

        StringBuffer sb = new StringBuffer();

        // Map color profile NCNAME to src from declarations/color-profile element
        String colorProfileName = args[3].getString();
        Declarations decls = pInfo.getFO().getRoot().getDeclarations();
        ColorProfile cp = decls.getColorProfile(colorProfileName);
        if (cp == null) {
            PropertyException pe = new PropertyException("The " + colorProfileName
                    + " color profile was not declared");
            pe.setPropertyInfo(pInfo);
            throw pe;
        }
        String src = cp.getSrc();
       
        // rgb-icc is replaced with fop-rgb-icc which has an extra fifth argument containing the
        // color profile src attribute as it is defined in the color-profile declarations element.
        sb.append("fop-rgb-icc(" + args[0]);
        for (int ix = 1; ix < args.length; ix++) {
View Full Code Here

Examples of org.foray.fotree.fo.obj.ColorProfile

        }
        case CHARACTER: {
            return new Character(parent, propertyList);
        }
        case COLOR_PROFILE: {
            return new ColorProfile(parent, propertyList);
        }
        case CONDITIONAL_PAGE_MASTER_REFERENCE: {
            return new ConditionalPageMasterReference(parent, propertyList);
        }
        case DECLARATIONS: {
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.