| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2010 by Dominik Seichter * |
| 3 | * [email protected] * |
| 4 | * * |
| 5 | * This program is free software; you can redistribute it and/or modify * |
| 6 | * it under the terms of the GNU General Public License as published by * |
| 7 | * the Free Software Foundation; either version 2 of the License, or * |
| 8 | * (at your option) any later version. * |
| 9 | * * |
| 10 | * This program is distributed in the hope that it will be useful, * |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 13 | * GNU General Public License for more details. * |
| 14 | * * |
| 15 | * You should have received a copy of the GNU General Public License * |
| 16 | * along with this program; if not, write to the * |
| 17 | * Free Software Foundation, Inc., * |
| 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 19 | ***************************************************************************/ |
| 20 | |
| 21 | #ifndef _COLORSPACE_H_ |
| 22 | #define _COLORSPACE_H_ |
| 23 | |
| 24 | #include <podofo/podofo.h> |
| 25 | |
| 26 | /** |
| 27 | * A more powerful representation |
| 28 | * of a colorspace than EPdfColorSpace. |
| 29 | * |
| 30 | */ |
| 31 | class ColorSpace { |
| 32 | public: |
| 33 | /** |
| 34 | * Construct a DeviceGray ColorSpace |
| 35 | */ |
| 36 | ColorSpace(); |
| 37 | |
| 38 | /** |
| 39 | * Construct a colorspace from a colorspace name |
| 40 | */ |
| 41 | ColorSpace(const PoDoFo::PdfName & rName); |
| 42 | |
| 43 | /** |
| 44 | * Copy constructor |
| 45 | */ |
| 46 | ColorSpace(const ColorSpace & rhs); |
| 47 | ~ColorSpace(); |
| 48 | |
| 49 | const ColorSpace & operator=(const ColorSpace & rhs); |
| 50 | |
| 51 | /** |
| 52 | * Checks if this is a "simple" |
| 53 | * colorspace (i.e. DeviceGray, DeviceRGB, DeviceCMYK). |
| 54 | * \returns true if this is a simple colospace |
| 55 | */ |
| 56 | bool IsSimpleColorSpace() const; |
| 57 | |
| 58 | /** |
| 59 | * Convert this object into an EPdfColorSpace |
| 60 | * enum. |
| 61 | * \returns enum value if possible or ePdfColorSpace_Unknown |
| 62 | */ |
| 63 | PoDoFo::PdfColorSpace ConvertToPdfColorSpace() const; |
| 64 | |
| 65 | /** |
| 66 | * Retrieve the internal name. |
| 67 | * \return the internal name |
| 68 | */ |
| 69 | inline const PoDoFo::PdfName & GetName() const; |
| 70 | |
| 71 | private: |
| 72 | PoDoFo::PdfName m_name; |
| 73 | |
| 74 | }; |
| 75 | |
| 76 | const PoDoFo::PdfName & ColorSpace::GetName() const |
| 77 | { |
| 78 | return m_name; |
| 79 | } |
| 80 | |
| 81 | #endif // _COLORSPACE_H_ |