NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
#include <resampler.h>
Classes | |
struct | Contrib |
struct | Contrib_List |
struct | Scan_Buf |
Public Types | |
enum | Boundary_Op { BOUNDARY_WRAP = 0 , BOUNDARY_REFLECT = 1 , BOUNDARY_CLAMP = 2 } |
enum | Status { STATUS_OKAY = 0 , STATUS_OUT_OF_MEMORY = 1 , STATUS_BAD_FILTER_NAME = 2 , STATUS_SCAN_BUFFER_FULL = 3 } |
typedef Resample_Real | Sample |
Public Member Functions | |
Resampler (int src_x, int src_y, int dst_x, int dst_y, Boundary_Op boundary_op=BOUNDARY_CLAMP, Resample_Real sample_low=0.0f, Resample_Real sample_high=0.0f, const char *Pfilter_name=RESAMPLER_DEFAULT_FILTER, Contrib_List *Pclist_x=NULL, Contrib_List *Pclist_y=NULL, Resample_Real filter_x_scale=1.0f, Resample_Real filter_y_scale=1.0f, Resample_Real src_x_ofs=0.0f, Resample_Real src_y_ofs=0.0f) | |
~Resampler () | |
void | restart () |
bool | put_line (const Sample *Psrc) |
const Sample * | get_line () |
Status | status () const |
void | get_clists (Contrib_List **ptr_clist_x, Contrib_List **ptr_clist_y) |
Contrib_List * | get_clist_x () const |
Contrib_List * | get_clist_y () const |
Static Public Member Functions | |
static int | get_filter_num () |
static char * | get_filter_name (int filter_num) |
Private Types | |
enum | { MAX_SCAN_BUF_SIZE = RESAMPLER_MAX_DIMENSION } |
Private Member Functions | |
Resampler () | |
Resampler (const Resampler &o) | |
Resampler & | operator= (const Resampler &o) |
void | resample_x (Sample *Pdst, const Sample *Psrc) |
void | scale_y_mov (Sample *Ptmp, const Sample *Psrc, Resample_Real weight, int dst_x) |
void | scale_y_add (Sample *Ptmp, const Sample *Psrc, Resample_Real weight, int dst_x) |
void | clamp (Sample *Pdst, int n) |
void | resample_y (Sample *Pdst) |
int | reflect (const int j, const int src_x, const Boundary_Op boundary_op) |
Contrib_List * | make_clist (int src_x, int dst_x, Boundary_Op boundary_op, Resample_Real(*Pfilter)(Resample_Real), Resample_Real filter_support, Resample_Real filter_scale, Resample_Real src_ofs) |
int | count_ops (Contrib_List *Pclist, int k) |
Resample_Real | clamp_sample (Resample_Real f) const |
Private Attributes | |
int | total_ops |
int | m_intermediate_x |
int | m_resample_src_x |
int | m_resample_src_y |
int | m_resample_dst_x |
int | m_resample_dst_y |
Boundary_Op | m_boundary_op |
Sample * | m_Pdst_buf |
Sample * | m_Ptmp_buf |
Contrib_List * | m_Pclist_x |
Contrib_List * | m_Pclist_y |
bool | m_clist_x_forced |
bool | m_clist_y_forced |
bool | m_delay_x_resample |
int * | m_Psrc_y_count |
unsigned char * | m_Psrc_y_flag |
Scan_Buf * | m_Pscan_buf |
int | m_cur_src_y |
int | m_cur_dst_y |
Status | m_status |
Resample_Real | m_lo |
Resample_Real | m_hi |
Definition at line 14 of file resampler.h.
typedef Resample_Real Resampler::Sample |
Definition at line 17 of file resampler.h.
|
private |
Enumerator | |
---|---|
MAX_SCAN_BUF_SIZE |
Definition at line 129 of file resampler.h.
Enumerator | |
---|---|
BOUNDARY_WRAP | |
BOUNDARY_REFLECT | |
BOUNDARY_CLAMP |
Definition at line 31 of file resampler.h.
enum Resampler::Status |
Enumerator | |
---|---|
STATUS_OKAY | |
STATUS_OUT_OF_MEMORY | |
STATUS_BAD_FILTER_NAME | |
STATUS_SCAN_BUFFER_FULL |
Definition at line 38 of file resampler.h.
Resampler::Resampler | ( | int | src_x, |
int | src_y, | ||
int | dst_x, | ||
int | dst_y, | ||
Boundary_Op | boundary_op = BOUNDARY_CLAMP , |
||
Resample_Real | sample_low = 0.0f , |
||
Resample_Real | sample_high = 0.0f , |
||
const char * | Pfilter_name = RESAMPLER_DEFAULT_FILTER , |
||
Contrib_List * | Pclist_x = NULL , |
||
Contrib_List * | Pclist_y = NULL , |
||
Resample_Real | filter_x_scale = 1.0f , |
||
Resample_Real | filter_y_scale = 1.0f , |
||
Resample_Real | src_x_ofs = 0.0f , |
||
Resample_Real | src_y_ofs = 0.0f |
||
) |
Definition at line 1031 of file resampler.cpp.
References count_ops(), func, g_filters, m_boundary_op, m_clist_x_forced, m_clist_y_forced, m_cur_dst_y, m_cur_src_y, m_delay_x_resample, m_hi, m_intermediate_x, m_lo, m_Pclist_x, m_Pclist_y, m_Pdst_buf, m_Pscan_buf, m_Psrc_y_count, m_Psrc_y_flag, m_Ptmp_buf, m_resample_dst_x, m_resample_dst_y, m_resample_src_x, m_resample_src_y, m_status, make_clist(), MAX_SCAN_BUF_SIZE, Resampler::Contrib_List::n, name, NUM_FILTERS, resampler_assert, RESAMPLER_DEFAULT_FILTER, resampler_range_check(), Resampler::Scan_Buf::scan_buf_l, Resampler::Scan_Buf::scan_buf_y, STATUS_BAD_FILTER_NAME, STATUS_OKAY, STATUS_OUT_OF_MEMORY, support, and total_ops.
Resampler::~Resampler | ( | ) |
Definition at line 951 of file resampler.cpp.
References m_clist_x_forced, m_clist_y_forced, m_Pclist_x, m_Pclist_y, m_Pdst_buf, m_Pscan_buf, m_Psrc_y_count, m_Psrc_y_flag, m_Ptmp_buf, MAX_SCAN_BUF_SIZE, Resampler::Contrib_List::p, Resampler::Scan_Buf::scan_buf_l, and total_ops.
|
private |
|
private |
|
private |
Definition at line 778 of file resampler.cpp.
References clamp_sample().
Referenced by resample_y().
|
inlineprivate |
|
inlineprivate |
Definition at line 159 of file resampler.h.
Referenced by Resampler().
|
inline |
Definition at line 83 of file resampler.h.
References m_Pclist_x.
|
inline |
Definition at line 87 of file resampler.h.
References m_Pclist_y.
void Resampler::get_clists | ( | Contrib_List ** | ptr_clist_x, |
Contrib_List ** | ptr_clist_y | ||
) |
Definition at line 1219 of file resampler.cpp.
References m_Pclist_x, and m_Pclist_y.
|
static |
Definition at line 1233 of file resampler.cpp.
References g_filters, and NUM_FILTERS.
|
static |
Definition at line 1228 of file resampler.cpp.
References NUM_FILTERS.
const Resampler::Sample * Resampler::get_line | ( | ) |
Definition at line 924 of file resampler.cpp.
References m_cur_dst_y, m_Pclist_y, m_Pdst_buf, m_Psrc_y_flag, m_resample_dst_y, m_resample_src_y, Resampler::Contrib_List::n, resample_y(), and resampler_range_check().
Referenced by decodeWaveletData().
|
private |
Definition at line 439 of file resampler.cpp.
References cast_to_int(), date::ceil(), date::floor(), Resampler::Contrib_List::n, Resampler::Contrib_List::p, Resampler::Contrib::pixel, reflect(), resampler_assert, and Resampler::Contrib::weight.
Referenced by Resampler().
bool Resampler::put_line | ( | const Sample * | Psrc | ) |
Definition at line 848 of file resampler.cpp.
References m_cur_src_y, m_delay_x_resample, m_intermediate_x, m_Pscan_buf, m_Psrc_y_count, m_Psrc_y_flag, m_resample_dst_x, m_resample_src_x, m_resample_src_y, m_status, MAX_SCAN_BUF_SIZE, resample_x(), resampler_assert, resampler_range_check(), Resampler::Scan_Buf::scan_buf_l, Resampler::Scan_Buf::scan_buf_y, STATUS_OUT_OF_MEMORY, STATUS_SCAN_BUFFER_FULL, and TRUE.
Referenced by decodeWaveletData().
|
private |
Definition at line 399 of file resampler.cpp.
References BOUNDARY_REFLECT, BOUNDARY_WRAP, and posmod().
Referenced by make_clist().
Definition at line 728 of file resampler.cpp.
References mu::isnan(), m_Pclist_x, m_resample_dst_x, Resampler::Contrib_List::n, Resampler::Contrib_List::p, Resampler::Contrib::pixel, resampler_assert, total_ops, and Resampler::Contrib::weight.
Referenced by put_line(), and resample_y().
|
private |
Definition at line 788 of file resampler.cpp.
References clamp(), FALSE, m_cur_dst_y, m_delay_x_resample, m_hi, m_intermediate_x, m_lo, m_Pclist_y, m_Pscan_buf, m_Psrc_y_count, m_Psrc_y_flag, m_Ptmp_buf, m_resample_dst_x, m_resample_src_y, MAX_SCAN_BUF_SIZE, Resampler::Contrib_List::n, Resampler::Contrib_List::p, Resampler::Contrib::pixel, resample_x(), resampler_assert, resampler_range_check(), scale_y_add(), scale_y_mov(), Resampler::Scan_Buf::scan_buf_l, Resampler::Scan_Buf::scan_buf_y, and Resampler::Contrib::weight.
Referenced by get_line().
void Resampler::restart | ( | ) |
Definition at line 1002 of file resampler.cpp.
References FALSE, m_cur_dst_y, m_cur_src_y, m_Pclist_y, m_Pscan_buf, m_Psrc_y_count, m_Psrc_y_flag, m_resample_dst_y, m_resample_src_y, m_status, MAX_SCAN_BUF_SIZE, Resampler::Contrib_List::n, resampler_range_check(), Resampler::Scan_Buf::scan_buf_l, Resampler::Scan_Buf::scan_buf_y, and STATUS_OKAY.
|
private |
|
private |
|
inline |
Definition at line 76 of file resampler.h.
References m_status.
|
private |
Definition at line 112 of file resampler.h.
Referenced by Resampler().
|
private |
Definition at line 120 of file resampler.h.
Referenced by Resampler(), and ~Resampler().
|
private |
Definition at line 121 of file resampler.h.
Referenced by Resampler(), and ~Resampler().
|
private |
Definition at line 140 of file resampler.h.
Referenced by get_line(), resample_y(), Resampler(), and restart().
|
private |
Definition at line 139 of file resampler.h.
Referenced by put_line(), Resampler(), and restart().
|
private |
Definition at line 123 of file resampler.h.
Referenced by put_line(), resample_y(), and Resampler().
|
private |
Definition at line 168 of file resampler.h.
Referenced by clamp_sample(), resample_y(), and Resampler().
|
private |
Definition at line 105 of file resampler.h.
Referenced by put_line(), resample_y(), and Resampler().
|
private |
Definition at line 167 of file resampler.h.
Referenced by clamp_sample(), resample_y(), and Resampler().
|
private |
Definition at line 117 of file resampler.h.
Referenced by get_clist_x(), get_clists(), resample_x(), Resampler(), and ~Resampler().
|
private |
Definition at line 118 of file resampler.h.
Referenced by get_clist_y(), get_clists(), get_line(), resample_y(), Resampler(), restart(), and ~Resampler().
|
private |
Definition at line 114 of file resampler.h.
Referenced by get_line(), Resampler(), and ~Resampler().
|
private |
Definition at line 137 of file resampler.h.
Referenced by put_line(), resample_y(), Resampler(), restart(), and ~Resampler().
|
private |
Definition at line 125 of file resampler.h.
Referenced by put_line(), resample_y(), Resampler(), restart(), and ~Resampler().
|
private |
Definition at line 126 of file resampler.h.
Referenced by get_line(), put_line(), resample_y(), Resampler(), restart(), and ~Resampler().
|
private |
Definition at line 115 of file resampler.h.
Referenced by resample_y(), Resampler(), and ~Resampler().
|
private |
Definition at line 109 of file resampler.h.
Referenced by put_line(), resample_x(), resample_y(), and Resampler().
|
private |
Definition at line 110 of file resampler.h.
Referenced by get_line(), Resampler(), and restart().
|
private |
Definition at line 107 of file resampler.h.
Referenced by put_line(), and Resampler().
|
private |
Definition at line 108 of file resampler.h.
Referenced by get_line(), put_line(), resample_y(), Resampler(), and restart().
|
private |
Definition at line 142 of file resampler.h.
Referenced by put_line(), Resampler(), restart(), and status().
|
private |
Definition at line 102 of file resampler.h.
Referenced by resample_x(), Resampler(), scale_y_add(), scale_y_mov(), and ~Resampler().