Warning, file /office/calligra/libs/pigment/KoColorConversionCache.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  * Copyright (C) 2007 Cyrille Berger <cberger@cberger.net>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Library General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Library General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Library General Public License
0015  * along with this library; see the file COPYING.LIB.  If not, write to
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef _KO_COLOR_CONVERSION_CACHE_HPP_
0021 #define _KO_COLOR_CONVERSION_CACHE_HPP_
0022 
0023 class KoCachedColorConversionTransformation;
0024 class KoColorSpace;
0025 
0026 #include "KoColorConversionTransformation.h"
0027 
0028 /**
0029  * This class holds a cache of KoColorConversionTransformations.
0030  *
0031  * This class is not part of public API, and can be changed without notice.
0032  */
0033 class KoColorConversionCache
0034 {
0035 public:
0036     struct CachedTransformation;
0037 public:
0038     KoColorConversionCache();
0039     ~KoColorConversionCache();
0040 
0041     /**
0042      * This function returns a cached color transformation if available
0043      * or create one.
0044      * @param src source color space
0045      * @param dst destination color space
0046      * @param _renderingIntent the rendering intent
0047      * @param conversionFlags the conversion flags
0048      */
0049     KoCachedColorConversionTransformation cachedConverter(const KoColorSpace* src,
0050                                                           const KoColorSpace* dst,
0051                                                           KoColorConversionTransformation::Intent _renderingIntent,
0052                                                           KoColorConversionTransformation::ConversionFlags conversionFlags);
0053 
0054     /**
0055      * This function is called by the destructor of the color space to
0056      * warn the cache that any pointers to this color space is going to
0057      * be invalid and that the cache needs to stop using those pointers.
0058      * @param src source color space
0059      */
0060     void colorSpaceIsDestroyed(const KoColorSpace* src);
0061 private:
0062     struct Private;
0063     Private* const d;
0064 };
0065 
0066 /**
0067  * This class hold a cached color conversion. It can only be created
0068  * by the cache and when it's deleted it return the transformation to
0069  * the pool of available color conversion transformation.
0070  *
0071  * This class is not part of public API, and can be changed without notice.
0072  */
0073 class KoCachedColorConversionTransformation
0074 {
0075     friend class KoColorConversionCache;
0076 private:
0077     KoCachedColorConversionTransformation(KoColorConversionCache* cache,
0078                                           KoColorConversionCache::CachedTransformation* transfo);
0079 public:
0080     KoCachedColorConversionTransformation(const KoCachedColorConversionTransformation&);
0081     ~KoCachedColorConversionTransformation();
0082 public:
0083     const KoColorConversionTransformation* transformation() const;
0084 private:
0085     struct Private;
0086     Private* const d;
0087 };
0088 
0089 
0090 #endif