22 #ifndef SIRIUS_FILTER_H_ 23 #define SIRIUS_FILTER_H_ 54 static constexpr
int kCacheSize = 10;
56 using FilterFFTCacheUPtr = std::unique_ptr<FilterFFTCache>;
71 bool normalize =
false);
109 return {filter_.
size, padding_size_, padding_type_};
117 return {padding_size_.
row, padding_size_.
row, padding_size_.
col,
118 padding_size_.
col, padding_type_};
148 static Filter CreateZoomInFilter(
Image filter_image,
152 static Filter CreateZoomOutFilter(
Image filter_image,
156 static Filter CreateRealZoomFilter(
Image filter_image,
169 Size padding_size_{0, 0};
170 ZoomRatio zoom_ratio_{};
174 FilterFFTCacheUPtr filter_fft_cache_{
nullptr};
179 #endif // SIRIUS_FILTER_H_
PaddingType
Definition: image.h:31
Definition: exception.h:27
Frequency filter.
Definition: filter.h:52
Data class that represents the 2D coordinates of a point.
Definition: types.h:86
PaddingType padding_type() const
Get padding type.
Definition: filter.h:106
int input_resolution() const
Definition: types.h:141
LRU cache.
Definition: lru_cache.h:38
std::unique_ptr<::fftw_complex[], detail::ComplexDeleter > ComplexUPtr
Definition: types.h:57
Data class that represents zoom ratio as input_resolution/output_resolution.
Definition: types.h:105
FilterMetadata Metadata() const
Definition: filter.h:108
Size size() const
Filter image size.
Definition: filter.h:94
Size padding_size() const
Padding size needed for the filter.
Definition: filter.h:100
constexpr Point filter_default_hot_point
Definition: filter.h:47
bool IsLoaded() const
Filter is loaded and ready to be applied on an image FFT.
Definition: filter.h:88
Data class that represents the padding of an image.
Definition: image.h:39
Data class that represents the size of an image.
Definition: types.h:38
fftw::ComplexUPtr Process(const Size &image_size, fftw::ComplexUPtr image_fft) const
Apply the filter on the image_fft.
Filter & operator=(const Filter &)=delete
int row
Definition: types.h:79
int col
Definition: types.h:80
Padding padding() const
Zero padding needed for the filter.
Definition: filter.h:116
static Filter Create(Image filter_image, const ZoomRatio &zoom_ratio, const Point &hot_point=filter_default_hot_point, PaddingType padding_type=PaddingType::kMirrorPadding, bool normalize=false)
Filter which is adapted specifically for a particular zoom ratio.
Data class that represents an image (Size + Buffer)
Definition: image.h:65
const Point & hot_point() const
Definition: filter.h:121
bool IsLoaded() const
Check that the image is loaded Row, col and data are set.
Definition: image.h:122
Size size
Definition: image.h:157
bool CanBeApplied(const ZoomRatio &zoom_ratio) const
Check that the filter can be applied on the given zoom ratio.
Definition: filter.h:128