001: /**
002: * Copyright (c) 2004, www.pdfbox.org
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions are met:
007: *
008: * 1. Redistributions of source code must retain the above copyright notice,
009: * this list of conditions and the following disclaimer.
010: * 2. Redistributions in binary form must reproduce the above copyright notice,
011: * this list of conditions and the following disclaimer in the documentation
012: * and/or other materials provided with the distribution.
013: * 3. Neither the name of pdfbox; nor the names of its
014: * contributors may be used to endorse or promote products derived from this
015: * software without specific prior written permission.
016: *
017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
018: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
019: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
020: * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
021: * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
022: * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
023: * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
024: * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
025: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
026: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
027: *
028: * http://www.pdfbox.org
029: *
030: */package org.pdfbox.pdmodel.graphics.color;
031:
032: import org.pdfbox.cos.COSArray;
033: import org.pdfbox.cos.COSName;
034:
035: import java.awt.color.ColorSpace;
036: import java.awt.image.ColorModel;
037:
038: import java.io.IOException;
039:
040: /**
041: * This class represents a Pattern color space.
042: *
043: * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
044: * @version $Revision: 1.4 $
045: */
046: public class PDPattern extends PDColorSpace {
047: private COSArray array;
048:
049: /**
050: * The name of this color space.
051: */
052: public static final String NAME = "Pattern";
053:
054: /**
055: * Default constructor.
056: */
057: public PDPattern() {
058: array = new COSArray();
059: array.add(COSName.getPDFName(NAME));
060: }
061:
062: /**
063: * Constructor.
064: *
065: * @param pattern The pattern array.
066: */
067: public PDPattern(COSArray pattern) {
068: array = pattern;
069: }
070:
071: /**
072: * This will return the name of the color space.
073: *
074: * @return The name of the color space.
075: */
076: public String getName() {
077: return NAME;
078: }
079:
080: /**
081: * This will get the number of components that this color space is made up of.
082: *
083: * @return The number of components in this color space.
084: *
085: * @throws IOException If there is an error getting the number of color components.
086: */
087: public int getNumberOfComponents() throws IOException {
088: return -1;
089: }
090:
091: /**
092: * Create a Java colorspace for this colorspace.
093: *
094: * @return A color space that can be used for Java AWT operations.
095: *
096: * @throws IOException If there is an error creating the color space.
097: */
098: public ColorSpace createColorSpace() throws IOException {
099: throw new IOException("Not implemented");
100: }
101:
102: /**
103: * Create a Java color model for this colorspace.
104: *
105: * @param bpc The number of bits per component.
106: *
107: * @return A color model that can be used for Java AWT operations.
108: *
109: * @throws IOException If there is an error creating the color model.
110: */
111: public ColorModel createColorModel(int bpc) throws IOException {
112: throw new IOException("Not implemented");
113: }
114: }
|