File indexing completed on 2024-06-09 04:23:30

0001 /*
0002  *  SPDX-FileCopyrightText: 2012 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005  */
0006 
0007 #ifndef KOOPTIMIZEDCOMPOSITEOPFACTORY_H
0008 #define KOOPTIMIZEDCOMPOSITEOPFACTORY_H
0009 
0010 #include "kritapigment_export.h"
0011 
0012 class KoCompositeOp;
0013 class KoColorSpace;
0014 
0015 /**
0016  * The creation of the optimized composite ops is moved into a separate
0017  * objects module for two reasons:
0018  *
0019  * 1) They are not templated, that is they do not need inlining into
0020  *    the user's code.
0021  * 2) This removes compilation dependencies.
0022  * 3) (most important!) When the object module is shared with a colorspace
0023  *    class, which is quite huge itself, GCC layouts the code somehow badly
0024  *    that causes 60% performance degradation.
0025  */
0026 
0027 class KRITAPIGMENT_EXPORT KoOptimizedCompositeOpFactory
0028 {
0029 public:
0030     static KoCompositeOp* createAlphaDarkenOpHard32(const KoColorSpace *cs);
0031     static KoCompositeOp* createAlphaDarkenOpCreamy32(const KoColorSpace *cs);
0032     static KoCompositeOp* createOverOp32(const KoColorSpace *cs);
0033     static KoCompositeOp* createAlphaDarkenOpHard128(const KoColorSpace *cs);
0034     static KoCompositeOp* createAlphaDarkenOpCreamy128(const KoColorSpace *cs);
0035     static KoCompositeOp* createOverOp128(const KoColorSpace *cs);
0036     static KoCompositeOp* createOverOpU64(const KoColorSpace *cs);
0037     static KoCompositeOp* createCopyOp128(const KoColorSpace *cs);
0038     static KoCompositeOp* createCopyOpU64(const KoColorSpace *cs);
0039     static KoCompositeOp* createCopyOp32(const KoColorSpace *cs);
0040     static KoCompositeOp* createAlphaDarkenOpHardU64(const KoColorSpace *cs);
0041     static KoCompositeOp* createAlphaDarkenOpCreamyU64(const KoColorSpace *cs);
0042 };
0043 
0044 #endif /* KOOPTIMIZEDCOMPOSITEOPFACTORY_H */