01: /*
02: Copyright © 2006,2007 Stefano Chizzolini. http://clown.stefanochizzolini.it
03:
04: Contributors:
05: * Stefano Chizzolini (original code developer, http://www.stefanochizzolini.it):
06: contributed code is Copyright © 2006,2007 by Stefano Chizzolini.
07:
08: This file should be part of the source code distribution of "PDF Clown library"
09: (the Program): see the accompanying README files for more info.
10:
11: This Program is free software; you can redistribute it and/or modify it under
12: the terms of the GNU General Public License as published by the Free Software
13: Foundation; either version 2 of the License, or (at your option) any later version.
14:
15: This Program is distributed in the hope that it will be useful, but WITHOUT ANY
16: WARRANTY, either expressed or implied; without even the implied warranty of
17: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.
18:
19: You should have received a copy of the GNU General Public License along with this
20: Program (see README files); if not, go to the GNU website (http://www.gnu.org/).
21:
22: Redistribution and use, with or without modification, are permitted provided that such
23: redistributions retain the above copyright notice, license and disclaimer, along with
24: this list of conditions.
25: */
26:
27: package it.stefanochizzolini.clown.documents.contents.colorSpaces;
28:
29: import it.stefanochizzolini.clown.documents.Document;
30: import it.stefanochizzolini.clown.objects.IPdfNumber;
31: import it.stefanochizzolini.clown.objects.PdfDirectObject;
32: import it.stefanochizzolini.clown.objects.PdfIndirectObject;
33: import it.stefanochizzolini.clown.objects.PdfName;
34: import it.stefanochizzolini.clown.util.NotImplementedException;
35:
36: /**
37: Device Red-Green-Blue color space [PDF:1.6:4.5.3].
38: @version 0.0.4
39: */
40: public class DeviceRGBColorSpace extends DeviceColorSpace {
41: // <class>
42: // <static>
43: // <fields>
44: /*
45: NOTE: It may be specified directly (i.e. without being defined in the ColorSpace subdictionary
46: of the contextual resource dictionary) [PDF:1.6:4.5.7].
47: */
48: public static final DeviceRGBColorSpace Default = new DeviceRGBColorSpace(
49: null, null);
50:
51: // </fields>
52: // </static>
53:
54: // <dynamic>
55: // <constructors>
56: public DeviceRGBColorSpace(Document context) {
57: super (context, PdfName.DeviceRGB);
58: }
59:
60: DeviceRGBColorSpace(PdfDirectObject baseObject,
61: PdfIndirectObject container) {
62: super (baseObject, container);
63: }
64:
65: // </constructors>
66:
67: // <interface>
68: // <public>
69: @Override
70: public DeviceRGBColorSpace clone(Document context) {
71: throw new NotImplementedException();
72: }
73:
74: @Override
75: public Color getColor(PdfDirectObject[] components) {
76: return new DeviceRGBColor(((IPdfNumber) components[0])
77: .getNumberValue(), ((IPdfNumber) components[1])
78: .getNumberValue(), ((IPdfNumber) components[2])
79: .getNumberValue());
80: }
81:
82: @Override
83: public Color getDefaultColor() {
84: return DeviceRGBColor.Default;
85: }
86: // </public>
87: // </interface>
88: // </dynamic>
89: // </class>
90: }
|