1
/* ============================================================
2
* Authors: Unai Garro <ugarro at users dot sourceforge dot net>
3
* Gilles Caulier <caulier dot gilles at free dot fr>
5
* Description : Threaded image filter to fix hot pixels
7
* Copyright 2005-2007 by Unai Garro and Gilles Caulier
9
* The algorithm for fixing the hot pixels was based on
10
* the code of jpegpixi, which was released under the GPL license,
11
* and is Copyright (C) 2003, 2004 Martin Dickopp
13
* This program is free software; you can redistribute it
14
* and/or modify it under the terms of the GNU General
15
* Public License as published by the Free Software Foundation;
16
* either version 2, or (at your option)
19
* This program is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
* GNU General Public License for more details.
24
* ============================================================*/
26
#ifndef HOTPIXELFIXER_H
27
#define HOTPIXELFIXER_H
33
#include <qvaluelist.h>
39
#include "dimgthreadedfilter.h"
46
namespace DigikamHotPixelsImagesPlugin
49
class HotPixelFixer : public Digikam::DImgThreadedFilter
54
enum InterpolationMethod
56
AVERAGE_INTERPOLATION = 0,
57
LINEAR_INTERPOLATION = 1,
58
QUADRATIC_INTERPOLATION = 2,
59
CUBIC_INTERPOLATION = 3
65
VERTICAL_DIRECTION = 1,
66
HORIZONTAL_DIRECTION = 2
71
HotPixelFixer(Digikam::DImg *orgImage, QObject *parent,
72
const QValueList<HotPixel>& hpList, int interpolationMethod);
77
virtual void filterImage(void);
79
void interpolate (Digikam::DImg &img,HotPixel &hp, int method);
80
void weightPixels (Digikam::DImg &img, HotPixel &px, int method, Direction dir, int maxComponent);
82
inline bool validPoint(Digikam::DImg &img, QPoint p)
84
return (p.x()>=0 && p.y()>=0 && p.x()<(long) img.width() && p.y()<(long) img.height());
87
QValueList <Weights> mWeightList;
91
int m_interpolationMethod;
93
QValueList<HotPixel> m_hpList;
96
} // NameSpace DigikamHotPixelsImagesPlugin
98
#endif // HOTPIXELFIXER_H