29 #ifndef DIGIKAM_BLUR_FX_FILTER_H
30 #define DIGIKAM_BLUR_FX_FILTER_H
41 class RandomNumberGenerator;
65 struct Q_DECL_HIDDEN Args
130 explicit BlurFXFilter(QObject*
const parent =
nullptr);
131 explicit BlurFXFilter(DImg*
const orgImage,
132 QObject*
const parent =
nullptr,
133 int blurFXType = ZoomBlur,
136 ~BlurFXFilter()
override;
140 return QLatin1String(
"digikam:BlurFXFilter");
143 static QString DisplayableName();
157 return FilterIdentifier();
162 void readParameters(
const FilterAction& action)
override;
166 void filterImage()
override;
169 void softenerBlur(
DImg*
const orgImage,
DImg*
const destImage);
170 void softenerBlurMultithreaded(
const Args& prm);
172 void shakeBlur(
DImg*
const orgImage,
DImg*
const destImage,
int Distance);
173 void shakeBlurStage1Multithreaded(
const Args& prm);
174 void shakeBlurStage2Multithreaded(
const Args& prm);
176 void frostGlass(
DImg*
const orgImage,
DImg*
const destImage,
int Frost);
179 void zoomBlur(
DImg*
const orgImage,
DImg*
const destImage,
int X,
int Y,
int Distance,
const QRect& pArea=QRect());
180 void zoomBlurMultithreaded(
const Args& prm);
182 void radialBlur(
DImg*
const orgImage,
DImg*
const destImage,
int X,
int Y,
int Distance,
const QRect& pArea=QRect());
183 void radialBlurMultithreaded(
const Args& prm);
185 void focusBlur(
DImg*
const orgImage,
DImg*
const destImage,
int X,
int Y,
int BlurRadius,
int BlendRadius,
186 bool bInversed=
false,
const QRect& pArea=QRect());
187 void focusBlurMultithreaded(
const Args& prm);
189 void farBlur(
DImg*
const orgImage,
DImg*
const destImage,
int Distance);
191 void motionBlur(
DImg*
const orgImage,
DImg*
const destImage,
int Distance,
double Angle=0.0);
192 void motionBlurMultithreaded(
const Args& prm);
194 void smartBlur(
DImg*
const orgImage,
DImg*
const destImage,
int Radius,
int Strength);
195 void smartBlurStage1Multithreaded(
const Args& prm);
196 void smartBlurStage2Multithreaded(
const Args& prm);
198 void mosaic(
DImg*
const orgImage,
DImg*
const destImage,
int SizeW,
int SizeH);
199 void mosaicMultithreaded(
const Args& prm);
203 void MakeConvolution(
DImg*
const orgImage,
DImg*
const destImage,
int Radius,
int Kernel[]);
204 void MakeConvolutionStage1Multithreaded(
const Args& prm);
205 void MakeConvolutionStage2Multithreaded(
const Args& prm);
207 DColor RandomColor(uchar*
const Bits,
int Width,
int Height,
bool sixteenBit,
int bytesDepth,
208 int X,
int Y,
int Radius,
210 uint*
const AverageColorR, uint*
const AverageColorG, uint*
const AverageColorB);
213 inline int Lim_Max(
int Now,
int Up,
int Max)
217 while (Now > Max - Up)
226 inline int GetIntensity (
int R,
int G,
int B)
228 return (
int)(R * 0.3 + G * 0.59 + B * 0.11);
232 inline int** Alloc2DArray (
int Columns,
int Rows)
236 int** lpcArray =
new int*[Columns];
238 for (
int i = 0 ; i < Columns ; ++i)
240 lpcArray[i] =
new int[Rows];
247 inline void Free2DArray (
int** lpcArray,
int Columns)
250 for (
int i = 0 ; i < Columns ; ++i)
252 delete [] lpcArray[i];
259 inline bool IsInside (
int Width,
int Height,
int X,
int Y)
261 bool bIsWOk = ((
X < 0) ?
false : (
X >=
Width ) ? false :
true);
262 bool bIsHOk = ((Y < 0) ?
false : (Y >=
Height) ? false :
true);
264 return (bIsWOk && bIsHOk);
267 inline int GetOffset(
int Width,
int X,
int Y,
int bytesDepth)
269 return (Y *
Width * bytesDepth) + (
X * bytesDepth);
272 inline int GetOffsetAdjusted(
int Width,
int Height,
int X,
int Y,
int bytesDepth)
277 return GetOffset(
Width,
X, Y, bytesDepth);
280 inline bool IsColorInsideTheRange (
int cR,
int cG,
int cB,
281 int nR,
int nG,
int nB,
284 if ((nR >= (cR - Range)) && (nR <= (cR + Range)))
286 if ((nG >= (cG - Range)) && (nG <= (cG + Range)))
288 if ((nB >= (cB - Range)) && (nB <= (cB + Range)))
Definition: blurfxfilter.h:44
QString filterIdentifier() const override
Definition: blurfxfilter.h:155
static int CurrentVersion()
Definition: blurfxfilter.h:150
BlurFXFilterTypes
Definition: blurfxfilter.h:50
@ ShakeBlur
Definition: blurfxfilter.h:56
@ SoftenerBlur
Definition: blurfxfilter.h:55
@ MotionBlur
Definition: blurfxfilter.h:54
@ SmartBlur
Definition: blurfxfilter.h:58
@ FarBlur
Definition: blurfxfilter.h:53
@ RadialBlur
Definition: blurfxfilter.h:52
@ FocusBlur
Definition: blurfxfilter.h:57
@ FrostGlass
Definition: blurfxfilter.h:59
static QList< int > SupportedVersions()
Definition: blurfxfilter.h:145
static QString FilterIdentifier()
Definition: blurfxfilter.h:138
Definition: dimgthreadedfilter.h:41
Definition: filteraction.h:43
Definition: randomnumbergenerator.h:64
@ Width
Definition: coredbfields.h:87
@ Height
Definition: coredbfields.h:88
Definition: datefolderview.cpp:43