digiKam
Loading...
Searching...
No Matches
lensdistortionpixelaccess.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 : 2004-12-27
7 * Description : access pixels method for lens distortion algorithm.
8 *
9 * SPDX-FileCopyrightText: 2004-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
10 * SPDX-FileCopyrightText: 2006-2010 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 *
14 * ============================================================ */
15
16#pragma once
17
18#define LensDistortionPixelAccessRegions 20
19#define LensDistortionPixelAccessWidth 40
20#define LensDistortionPixelAccessHeight 20
21#define LensDistortionPixelAccessXOffset 3
22#define LensDistortionPixelAccessYOffset 3
23
24// Local includes
25
26#include "dimg.h"
27#include "digikam_export.h"
28
29namespace Digikam
30{
31
45class DIGIKAM_EXPORT LensDistortionPixelAccess
46{
47
48public:
49
50 explicit LensDistortionPixelAccess(DImg* srcImage);
52
53 void pixelAccessGetCubic(double srcX, double srcY, double brighten, uchar* dst);
54
55protected:
56
57 inline uchar* pixelAccessAddress(int i, int j);
58 void pixelAccessSelectRegion(int n);
59 void pixelAccessDoEdge(int i, int j);
60 void pixelAccessReposition(int xInt, int yInt);
61 void cubicInterpolate(uchar* src, int rowStride, uchar* dst,
62 bool sixteenBit, double dx, double dy, double brighten);
63
64private:
65
66 DImg* m_image = nullptr;
67
68 DImg* m_buffer[LensDistortionPixelAccessRegions] = { nullptr };
69
70 int m_width = 0;
71 int m_height = 0;
72 int m_depth = 8;
73 int m_imageWidth = 0;
74 int m_imageHeight = 0;
75 bool m_sixteenBit = false;
76 int m_tileMinX[LensDistortionPixelAccessRegions] = { 0 };
77 int m_tileMaxX[LensDistortionPixelAccessRegions] = { 0 };
78 int m_tileMinY[LensDistortionPixelAccessRegions] = { 0 };
79 int m_tileMaxY[LensDistortionPixelAccessRegions] = { 0 };
80
81private:
82
83 // Disable
85 LensDistortionPixelAccess& operator=(const LensDistortionPixelAccess&) = delete;
86};
87
88} // namespace Digikam
Definition dimg.h:52
Definition lensdistortionpixelaccess.h:46
#define LensDistortionPixelAccessRegions
Definition lensdistortionpixelaccess.h:18
Definition datefolderview.cpp:34