digiKam
embossfilter.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2005-05-25
7  * Description : Emboss threaded image filter.
8  *
9  * Copyright (C) 2005-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2006-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11  * Copyright (C) 2010 by Martin Klapetek <martin dot klapetek at gmail dot com>
12  *
13  * Original Emboss algorithm copyrighted 2004 by
14  * Pieter Z. Voloshyn <pieter dot voloshyn at gmail dot com>.
15  *
16  * This program is free software; you can redistribute it
17  * and/or modify it under the terms of the GNU General
18  * Public License as published by the Free Software Foundation;
19  * either version 2, or (at your option)
20  * any later version.
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * ============================================================ */
28 
29 #ifndef DIGIKAM_EMBOSS_FILTER_H
30 #define DIGIKAM_EMBOSS_FILTER_H
31 
32 // Local includes
33 
34 #include "digikam_export.h"
35 #include "dimgthreadedfilter.h"
36 #include "digikam_globals.h"
37 
38 namespace Digikam
39 {
40 
41 class DIGIKAM_EXPORT EmbossFilter : public DImgThreadedFilter
42 {
43  Q_OBJECT
44 
45 public:
46 
47  explicit EmbossFilter(QObject* const parent = nullptr);
48  explicit EmbossFilter(DImg* const orgImage, QObject* const parent = nullptr, int depth=30);
49  ~EmbossFilter() override;
50 
51  static QString FilterIdentifier()
52  {
53  return QLatin1String("digikam:EmbossFilter");
54  }
55 
56  static QString DisplayableName();
57 
59  {
60  return QList<int>() << 1;
61  }
62 
63  static int CurrentVersion()
64  {
65  return 1;
66  }
67 
68  QString filterIdentifier() const override
69  {
70  return FilterIdentifier();
71  }
72 
73  FilterAction filterAction() override;
74  void readParameters(const FilterAction& action) override;
75 
76 private:
77 
78  void filterImage() override;
79  void embossMultithreaded(uint start, uint stop, uint h, double Depth);
80 
81  inline int Lim_Max (int Now, int Up, int Max);
82  inline int getOffset(int Width, int X, int Y, int bytesDepth);
83 
84 private:
85 
86  int m_depth;
87 };
88 
89 } // namespace Digikam
90 
91 #endif // DIGIKAM_EMBOSS_FILTER_H
Definition: dimgthreadedfilter.h:41
Definition: dimg.h:62
Definition: embossfilter.h:42
QString filterIdentifier() const override
Definition: embossfilter.h:68
static QString FilterIdentifier()
Definition: embossfilter.h:51
static QList< int > SupportedVersions()
Definition: embossfilter.h:58
static int CurrentVersion()
Definition: embossfilter.h:63
Definition: filteraction.h:43
#define X
@ Width
Definition: coredbfields.h:87
Definition: datefolderview.cpp:43