1 /* 2 * * Copyright (C) 2006-2011 Anders Brander <anders@brander.dk>, 3 * * Anders Kvist <akv@lnxbx.dk> and Klaus Post <klauspost@gmail.com> 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 2 8 * of the License, or (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 */ 19 20 #ifndef denoisethread_h__ 21 #define denoisethread_h__ 22 23 #include "fftw3.h" 24 #include "jobqueue.h" 25 #include "pthread.h" 26 #include "complexblock.h" 27 #include "floatimageplane.h" 28 29 namespace RawStudio { 30 namespace FFTFilter { 31 32 class DenoiseThread 33 { 34 public: 35 DenoiseThread(void); 36 virtual ~DenoiseThread(void); 37 void addJobs(JobQueue *waiting, JobQueue *finished); 38 void jobsEnded(); 39 void runDenoise(); 40 fftwf_plan forward; 41 fftwf_plan reverse; 42 ComplexBlock *complex; 43 FloatImagePlane *input_plane; 44 pthread_t thread_id; 45 pthread_cond_t run_thread; 46 pthread_mutex_t run_thread_mutex; 47 gboolean exitThread; 48 gboolean threadExited; 49 private: 50 JobQueue *waiting; 51 JobQueue *finished; 52 void procesFFT(FFTJob* job); 53 54 }; 55 56 }} // namespace RawStudio::FFTFilter 57 58 #endif // denoisethread_h__ 59