Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_ls_utils.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __KIS_LS_UTILS_H
8#define __KIS_LS_UTILS_H
9
10#include "kis_types.h"
11#include "kritaimage_export.h"
12
13#include "kis_lod_transform.h"
14#include <KoPattern.h>
15
20
23
24
25namespace KisLsUtils
26{
27
28 QRect growSelectionUniform(KisPixelSelectionSP selection, int growSize, const QRect &applyRect);
29
30 KRITAIMAGE_EXPORT void selectionFromAlphaChannel(KisPaintDeviceSP srcDevice,
31 KisSelectionSP dstSelection,
32 const QRect &srcRect);
33
34 void findEdge(KisPixelSelectionSP selection, const QRect &applyRect, const bool edgeHidden);
35 QRect growRectFromRadius(const QRect &rc, int radius);
37 const QRect &applyRect,
38 qreal radius);
39
40 static const int FULL_PERCENT_RANGE = 100;
41 void adjustRange(KisPixelSelectionSP selection, const QRect &applyRect, const int range);
42
44 const QRect &applyRect,
45 const quint8 *lookup_table,
46 bool antiAliased,
47 bool edgeHidden);
48
49 extern const int noiseNeedBorder;
50
51 void applyNoise(KisPixelSelectionSP selection,
52 const QRect &applyRect,
53 int noise,
54 const psd_layer_effects_context *context,
56
59 const QRect &srcRect,
60 const QRect &dstRect,
61 const QRect &totalNeedRect,
62 const bool knockOutInverted);
63
64 void fillPattern(KisPaintDeviceSP fillDevice,
65 const QRect &applyRect,
67 int scale,
68 KoPatternSP pattern,
69 int horizontalPhase,
70 int verticalPhase,
71 bool alignWithLayer);
72
73 void fillOverlayDevice(KisPaintDeviceSP fillDevice,
74 const QRect &applyRect,
76 KisResourcesInterfaceSP resourcesInterface,
78
79 void applyFinalSelection(const QString &projectionId,
80 KisSelectionSP baseSelection,
81 KisPaintDeviceSP srcDevice,
83 const QRect &srcRect,
84 const QRect &dstRect,
85 const psd_layer_effects_context *context,
86 const psd_layer_effects_shadow_base *config, KisResourcesInterfaceSP resourcesInterface,
88
90
91 template<class ConfigStruct>
93 {
94 LodWrapper(int lod,
95 const ConfigStruct *srcStruct)
96
97 {
98 if (lod > 0) {
99 storage.reset(new ConfigStruct(*srcStruct));
100
101 const qreal lodScale = KisLodTransform::lodToScale(lod);
102 storage->scaleLinearSizes(lodScale);
103
104 config = storage.data();
105 } else {
106 config = srcStruct;
107 }
108 }
109
110 const ConfigStruct *config;
111
112 private:
113 QScopedPointer<ConfigStruct> storage;
114 };
115
116}
117
118#endif /* __KIS_LS_UTILS_H */
static qreal lodToScale(int levelOfDetail)
void applyContourCorrection(KisPixelSelectionSP selection, const QRect &applyRect, const quint8 *lookup_table, bool antiAliased, bool edgeHidden)
const int noiseNeedBorder
QRect growSelectionUniform(KisPixelSelectionSP selection, int growSize, const QRect &applyRect)
QRect growRectFromRadius(const QRect &rc, int radius)
void adjustRange(KisPixelSelectionSP selection, const QRect &applyRect, const int range)
void findEdge(KisPixelSelectionSP selection, const QRect &applyRect, const bool edgeHidden)
void fillPattern(KisPaintDeviceSP fillDevice, const QRect &applyRect, KisLayerStyleFilterEnvironment *env, int scale, KoPatternSP pattern, int horizontalPhase, int verticalPhase, bool alignWithLayer)
void fillOverlayDevice(KisPaintDeviceSP fillDevice, const QRect &applyRect, const psd_layer_effects_overlay_base *config, KisResourcesInterfaceSP resourcesInterface, KisLayerStyleFilterEnvironment *env)
void applyNoise(KisPixelSelectionSP selection, const QRect &applyRect, int noise, const psd_layer_effects_context *context, KisLayerStyleFilterEnvironment *env)
bool checkEffectEnabled(const psd_layer_effects_shadow_base *config, KisMultipleProjection *dst)
void knockOutSelection(KisPixelSelectionSP selection, KisPixelSelectionSP knockOutSelection, const QRect &srcRect, const QRect &dstRect, const QRect &totalNeedRect, const bool knockOutInverted)
void selectionFromAlphaChannel(KisPaintDeviceSP srcDevice, KisSelectionSP dstSelection, const QRect &srcRect)
static const int FULL_PERCENT_RANGE
void applyGaussianWithTransaction(KisPixelSelectionSP selection, const QRect &applyRect, qreal radius)
void applyFinalSelection(const QString &projectionId, KisSelectionSP baseSelection, KisPaintDeviceSP srcDevice, KisMultipleProjection *dst, const QRect &, const QRect &dstRect, const psd_layer_effects_context *, const psd_layer_effects_shadow_base *config, KisResourcesInterfaceSP resourcesInterface, const KisLayerStyleFilterEnvironment *env)
QScopedPointer< ConfigStruct > storage
LodWrapper(int lod, const ConfigStruct *srcStruct)
const ConfigStruct * config