File: MyImageAnalyzer.h

package info (click to toggle)
lynkeos.app 3.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,740 kB
  • sloc: objc: 36,412; ansic: 684; cpp: 148; sh: 68; makefile: 21
file content (140 lines) | stat: -rw-r--r-- 4,015 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//
//  Lynkeos
//  $Id: MyImageAnalyzer.h 526 2013-08-08 22:12:26Z j-etienne $
//
//  Created by Jean-Etienne LAMIAUD on Wed jun 6 2007.
//  Copyright (c) 2007-2013. Jean-Etienne LAMIAUD
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//

/*!
 * @header
 * @abstract Image analysis process class
 */
#ifndef __MYIMAGE_ANALYZER_H
#define __MYIMAGE_ANALYZER_H

#include "LynkeosFourierBuffer.h"
#include "LynkeosProcessing.h"

/*!
 * @abstract Reference string for this process
 * @ingroup Processing
 */
extern NSString * const myImageAnalyzerRef;

/*!
 * @abstract Reference for reading/setting the analysis entry parameters.
 * @ingroup Processing
 */
extern NSString * const myImageAnalyzerParametersRef;

/*!
 * @abstract Reference for reading/setting the analysis result.
 * @ingroup Processing
 */
extern NSString * const myImageAnalyzerResultRef;

/*!
 * @abstract Reference for reading/setting the autoselect parameter.
 * @ingroup Processing
 */
extern NSString * const myAutoselectParameterRef;

/*!
 * @enum MyAnalysisMethod
 * @abstract Analysis method enumeration
 * @ingroup Processing
 */
typedef enum
{
   EntropyAnalysis,
   SpectrumAnalysis
} MyAnalysisMethod;

/*!
 * @abstract General entry parameters for image quality analysis
 * @ingroup Processing
 */
@interface MyImageAnalyzerParameters : NSObject <LynkeosProcessingParameter>
{
@public
   LynkeosIntegerRect   _analysisRect;    //!< The analysis rectangle
   MyAnalysisMethod     _method;          //!< Analysis method used
   double               _lowerCutoff;     //!< Lower frequency cutoff
   double               _upperCutoff;     //!< Upper frequency cutoff
}
@end

/*!
 * @abstract Result of the analysis process (entry data for further processing)
 * @ingroup Processing
 */
@interface MyImageAnalyzerResult : NSObject <LynkeosProcessingParameter>
{
@public
   double          _quality;        //!< Result of analysis!
}

/*!
 * @abstract Accessor to the quality
 */
- (NSNumber*) quality;

@end

/*!
 * @abstract Autoselect parameters
 * @discussion The process view controller uses a process parameter to store
 *    the autoselect parameters, which are unknown to the process itself
 * @ingroup Processing
 */
@interface MyAutoselectParams : NSObject <LynkeosProcessingParameter>
{
@public
   //! The quality level below which images are not selected
   double _qualityThreshold;
}
@end

/*!
 * @abstract Image analysis processing class
 * @ingroup Processing
 */
@interface MyImageAnalyzer : NSObject <LynkeosProcessing>
{
@private
   id <LynkeosDocument> _document;  //!< The document in which we are processing
   MyImageAnalyzerParameters *_params;    //!< Parameters of analysis
   double               _lowerCutoff;     //!< Lower frequency cutoff
   double               _upperCutoff;     //!< Upper frequency cutoff
   //! Per thread buffer for Fourier transform
   LynkeosFourierBuffer      *_bufferSpectrum;
}

@end

/*!
 * @abstract Filter the image with the filter used for analysis
 * @discussion This is used for previewing the analysis filter effect
 * @param[in,out] image The image to filter
 * @param down Lower frequency cutoff
 * @param up Upper frequency cutoff
 */
extern void filterImageForAnalysis( LynkeosFourierBuffer *image,
                                    double down,
                                    double up );
#endif