⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmykcolorspace.java

📁 Java生成PDF Java生成PDF Java生成PDF
💻 JAVA
字号:
// $Id: CMYKColorSpace.java,v 1.3 2003/11/04 17:16:01 mike Exp $package org.faceless.pdf;import java.awt.color.*;import java.awt.Color;/** * <p> * A subclass of <tt>java.awt.color.ColorSpace</tt> representing * the uncalibrated (device-dependent) CMYK color space available * in PDF documents. * </p><p> * If colors need to be specified in CMYK, but accurate color * (the kind available with an ICC Profile) is not required, this * colorspace should be used, as it doesn't require an ICC profile * to be embedded in the PDF (resulting in a smaller file). * </p> * @since 1.1.5 * @version $Revision: 1.3 $ */public class CMYKColorSpace extends ColorSpace{    private org.faceless.pdf2.CMYKColorSpace wrap;    static final CMYKColorSpace space = new CMYKColorSpace();    private CMYKColorSpace()    {        super(TYPE_CMYK, 4);	wrap=org.faceless.pdf2.CMYKColorSpace.getInstance();    }    /**     * Return a CMYK Color Space     */    public static CMYKColorSpace getInstance()    {	return space;    }    public float[] toRGB(float[] cmyk)    {	return wrap.toRGB(cmyk);    }    public float[] fromRGB(float[] rgb)    {	return wrap.fromRGB(rgb);    }    public float[] fromCIEXYZ(float[] xyz)    {	return wrap.fromCIEXYZ(xyz);    }    public float[] toCIEXYZ(float[] cmyk)    {	return wrap.toCIEXYZ(cmyk);    }    /**     * A convenience method, returning a color in the CMYK colorspace     * with the specified levels of cyan, magenta, yellow and black.     * The parameters must be in the range from 0.0 to 1.0, or an     * <tt>IllegalArgumentException is thrown</tt>     * @param c the level of cyan from 0.0 to 1.0     * @param m the level of magenta from 0.0 to 1.0     * @param y the level of yellow from 0.0 to 1.0     * @param k the level of black from 0.0 to 1.0     * @throws IllegalArgumentException     */    public static Color getColor(float c, float m, float y, float k)    {	return org.faceless.pdf2.CMYKColorSpace.getColor(c,m,y,k);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -