Examples of CIELabColorSpace


Examples of org.apache.xmlgraphics.java2d.color.CIELabColorSpace

                result[i] = new NamedColorSpace(name, colorvalue, profileName, profileURI);
                break;
            case ColorSpace.TYPE_Lab:
                //Not sure if this always D50 here,
                //but the illuminant in the header is fixed to D50.
                CIELabColorSpace labCS = ColorSpaces.getCIELabColorSpaceD50();
                result[i] = new NamedColorSpace(name, labCS.toColor(colorvalue, 1.0f),
                        profileName, profileURI);
                break;
            default:
                throw new UnsupportedOperationException(
                        "PCS type is not supported: " + profile.getPCSType());
View Full Code Here

Examples of org.apache.xmlgraphics.java2d.color.CIELabColorSpace

            Color colCMYK = DeviceCMYKColorSpace.createCMYKColor(compsCMYK);
            g2d.setColor(colCMYK);
            g2d.fillRect(60, 30, 40, 40);

            //Try CIELab (not implemented, yet)
            CIELabColorSpace d50 = ColorSpaces.getCIELabColorSpaceD50();
            Color colLab = d50.toColor(83.25f, 16.45f, 96.89f, 1.0f);
            g2d.setColor(colLab);
            g2d.fillRect(110, 30, 40, 40);

            //Try named color (Separation, not implemented, yet)
            float[] c1xyz = d50.toCIEXYZNative(83.25f, 16.45f, 96.89f);
            NamedColorSpace postgelb = new NamedColorSpace("Postgelb", c1xyz);
            Color colNamed = new Color(postgelb, new float[] {1.0f}, 1.0f);
            g2d.setColor(colNamed);
            g2d.fillRect(160, 30, 40, 40);
View Full Code Here

Examples of org.apache.xmlgraphics.java2d.color.CIELabColorSpace

                float l = parseComponent(args[3], 0f, 100f, value);
                float a = parseComponent(args[4], -127f, 127f, value);
                float b = parseComponent(args[5], -127f, 127f, value);

                //Assuming the XSL-FO spec uses the D50 white point
                CIELabColorSpace cs = ColorSpaces.getCIELabColorSpaceD50();
                //use toColor() to have components normalized
                Color labColor = cs.toColor(l, a, b, 1.0f);
                //Convert to ColorWithFallback
                parsedColor = new ColorWithFallback(labColor, sRGB);
            } catch (RuntimeException re) {
                throw new PropertyException(re);
            }
View Full Code Here

Examples of org.apache.xmlgraphics.java2d.color.CIELabColorSpace

        Color fallbackColor = getsRGBFallback(color);
        StringBuffer sb = new StringBuffer("cie-lab-color(");
        sb.append(fallbackColor.getRed()).append(',');
        sb.append(fallbackColor.getGreen()).append(',');
        sb.append(fallbackColor.getBlue());
        CIELabColorSpace cs = (CIELabColorSpace)color.getColorSpace();
        float[] lab = cs.toNativeComponents(color.getColorComponents(null));
        for (int i = 0; i < 3; i++) {
            sb.append(',').append(lab[i]);
        }
        sb.append(')');
        return sb.toString();
View Full Code Here

Examples of org.apache.xmlgraphics.java2d.color.CIELabColorSpace

            } else if (cs instanceof NamedColorSpace) {
                PDFSeparationColorSpace sepcs = getSeparationColorSpace((NamedColorSpace)cs);
                establishColor(codeBuffer, sepcs, color, fill);
                return true;
            } else if (cs instanceof CIELabColorSpace) {
                CIELabColorSpace labcs = (CIELabColorSpace)cs;
                PDFCIELabColorSpace pdflab = getCIELabColorSpace(labcs);
                selectColorSpace(codeBuffer, pdflab, fill);
                float[] comps = color.getColorComponents(null);
                float[] nativeComps = labcs.toNativeComponents(comps);
                writeColor(codeBuffer, nativeComps, labcs.getNumComponents(), (fill ? "sc" : "SC"));
                return true;
            }
        }
        return false;
    }
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.