Scribus
Open source desktop publishing at your fingertips
sccolortransform.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 
8 #ifndef SCCOLORTRANSFORM_H
9 #define SCCOLORTRANSFORM_H
10 
11 #include <QSharedPointer>
12 #include <QWeakPointer>
13 #include "scribusapi.h"
14 #include "sccolortransformdata.h"
15 
16 class SCRIBUS_API ScColorTransform
17 {
18  friend class ScColorTransformPool;
19 public:
22  ScColorTransform(const QSharedPointer<ScColorTransformData>& data);
23 
24  ScColorMgmtEngine& engine() { return m_data->engine(); }
25  const ScColorMgmtEngine& engine() const { return m_data->engine(); }
26 
27  inline bool isNull() const { return (m_data.isNull() || m_data->isNull()); }
28  inline operator bool () const { return !isNull(); }
29 
30  const ScColorTransformInfo& transformInfo() const { return m_data->transformInfo(); }
31 
32  bool apply(void* input, void* output, uint numElem);
33  bool apply(QByteArray& input, QByteArray& output, uint numElem);
34 
35  bool operator==(const ScColorTransform& other) const;
36 
37 protected:
38  QSharedPointer<ScColorTransformData> m_data;
39 
40  QWeakPointer<ScColorTransformData> weakRef() const { return m_data.toWeakRef(); }
41  QSharedPointer<ScColorTransformData> strongRef() const { return m_data; }
42 };
43 
44 #endif
Definition: sccolortransformdata.h:17
Definition: sccolormgmtstructs.h:114
Definition: sccolortransform.h:16
Definition: sccolormgmtengine.h:16
Definition: sccolortransformpool.h:16