oln::internal Namespace Reference

Internal purpose only. More...


Classes

struct  default_less< abstract::dpoint< Exact > >
struct  default_less< abstract::point< Exact > >
struct  compose_uu_
struct  compose_ub_
struct  compose_bu_
struct  default_less< coord >
 default_less<coord> More...

struct  default_less< dpoint1d >
struct  default_less< dpoint2d >
struct  default_less< dpoint3d >
struct  _fake
struct  default_less< point1d >
struct  default_less< point2d >
struct  default_less< point3d >
struct  wavelet_coeffs_
 Wavelet coefficient data structure. More...

struct  dim_skip_iterate_rec_
 Functions used to iterate over all dimensions except one. More...

struct  dim_skip_iterate_rec_< dim, skip, 0 >
 Specialization of dim_skip_iterate_rec_ with current dimension set to 0. More...

struct  dim_iterate_rec_
 Iterate over all dimensions except one. More...

struct  dim_iterate_rec_< dim, 0 >
 Specialization of dim_iterate_rec_ with skip dimension set to 0. More...


Enumerations

enum  dwt_transform_dir_ { dwt_fwd, dwt_bwd }
 Enum to know if you go in forward or backward order.


Functions

template<class I, class K> void dwt_transform_step_ (abstract::image< I > &im, const typename mlc::exact< I >::ret::point_type &p_, const unsigned d, const unsigned n, const K &coeffs)
 Step of a dwt transform.

template<class I, class K> void dwt_transform_inv_step_ (abstract::image< I > &im, const typename mlc::exact< I >::ret::point_type &p_, const unsigned d, const unsigned n, const K &coeffs)
 Step of a dwt invert transform.

template<class I, class K> void dwt_transform_ (abstract::image< I > &im, const unsigned l1, const unsigned l2, const K &coeffs, transforms::dwt_transform_type t)
 Internal dwt transform function.

template<class I, class K> void dwt_transform_inv_ (abstract::image< I > &im, const unsigned l1, const unsigned l2, const K &coeffs, transforms::dwt_transform_type t)
 Internal dwt invert transform function.


Variables

const ntg::float_d ln_2_ = 0.6931471805599453092
 Value of ln(2).


Detailed Description

Internal purpose only.

Function Documentation

template<class I, class K>
void dwt_transform_ abstract::image< I > &  im,
const unsigned  l1,
const unsigned  l2,
const K &  coeffs,
transforms::dwt_transform_type  t
 

Internal dwt transform function.

Parameters:
I Exact type of the image to process.
K Type of coefficients.

Definition at line 414 of file dwt.hh.

00419     {
00420      oln_point_type(I) p;
00421 
00422       switch (t) {
00423       case transforms::dwt_std:
00424         dim_iterate_rec_<I::dim, I::dim>::doit(im, p, l1, l2, coeffs, dwt_fwd);
00425         break;
00426       case transforms::dwt_non_std:
00427         for (unsigned n = l2; n >= l1; n >>= 1)
00428           dim_iterate_rec_<I::dim, I::dim>::doit(im, p, n, n, coeffs, dwt_fwd);
00429         break;
00430       }
00431     }

template<class I, class K>
void dwt_transform_inv_ abstract::image< I > &  im,
const unsigned  l1,
const unsigned  l2,
const K &  coeffs,
transforms::dwt_transform_type  t
 

Internal dwt invert transform function.

Parameters:
I Exact type of the image to process.
K Type of coefficients.

Definition at line 440 of file dwt.hh.

00445     {
00446      oln_point_type(I) p;
00447 
00448       switch (t) {
00449       case transforms::dwt_std:
00450         dim_iterate_rec_<I::dim, I::dim>::doit(im, p, l1, l2, coeffs, dwt_bwd);
00451         break;
00452       case transforms::dwt_non_std:
00453         for (unsigned n = l1; n <= l2; n <<= 1)
00454           dim_iterate_rec_<I::dim, I::dim>::doit(im, p, n, n, coeffs, dwt_bwd);
00455         break;
00456       }
00457     }

template<class I, class K>
void dwt_transform_inv_step_ abstract::image< I > &  im,
const typename mlc::exact< I >::ret::point_type &  p_,
const unsigned  d,
const unsigned  n,
const K &  coeffs
 

Step of a dwt invert transform.

Parameters:
I Exact type of the input image.
K type of coefficients.
  • im Image to process.
  • p_ Point to work on.
  • d Component d of p.
  • n Step number.
  • coeffs Coefficients.

Definition at line 219 of file dwt.hh.

Referenced by oln::internal::dim_skip_iterate_rec_< dim, skip, 0 >::doit().

00224     {
00225       assertion(n >= coeffs.size());
00226 
00227       const unsigned half = n >> 1;
00228       unsigned lim = coeffs.size() - 2;
00229       ntg::float_d* tmp = new ntg::float_d[n];
00230      oln_point_type(I) p(p_), q(p_);
00231       unsigned i, j, k, l;
00232 
00233       for (i = half - lim / 2, j = 0; j < lim; i++, j += 2) {
00234         tmp[j] = 0;
00235         tmp[j + 1] = 0;
00236         for (k = 0, l = 0; l < coeffs.size(); k++, l += 2) {
00237           p.nth(d) = (i + k) % half;
00238           q.nth(d) = p.nth(d) + half;
00239           tmp[j] += im[p] * coeffs.getInvH(l) + im[q] * coeffs.getInvH(l + 1);
00240           tmp[j + 1] += im[p] * coeffs.getInvG(l) + im[q] * coeffs.getInvG(l + 1);
00241         }
00242       }
00243       lim = n - 1;
00244       for (i = 0; j < lim; i++, j += 2) {
00245         tmp[j] = 0;
00246         tmp[j + 1] = 0;
00247         for (k = 0, l = 0; l < coeffs.size(); k++, l += 2) {
00248           p.nth(d) = i + k;
00249           q.nth(d) = p.nth(d) + half;
00250           tmp[j] += im[p] * coeffs.getInvH(l) + im[q] * coeffs.getInvH(l + 1);
00251           tmp[j + 1] += im[p] * coeffs.getInvG(l) + im[q] * coeffs.getInvG(l + 1);
00252         }
00253       }
00254 
00255       for (i = 0; i < n; i++) {
00256         p.nth(d) = i;
00257         im[p] = tmp[i];
00258       }
00259 
00260       delete[] tmp;
00261     }

template<class I, class K>
void dwt_transform_step_ abstract::image< I > &  im,
const typename mlc::exact< I >::ret::point_type &  p_,
const unsigned  d,
const unsigned  n,
const K &  coeffs
 

Step of a dwt transform.

Parameters:
I Exact type of the input image.
K type of coefficients.
  • im Image to process.
  • p_ Point to work on.
  • d Component d of p.
  • n Step number.
  • coeffs Coefficients.

Definition at line 165 of file dwt.hh.

Referenced by oln::internal::dim_skip_iterate_rec_< dim, skip, 0 >::doit().

00170     {
00171       assertion(n >= coeffs.size());
00172 
00173       const unsigned    half = n >> 1;
00174       unsigned          lim = n + 1 - coeffs.size();
00175       ntg::float_d*     tmp = new ntg::float_d[n];
00176       oln_point_type(I) p(p_);
00177       unsigned          i, j, k;
00178 
00179       for (i = 0, j = 0; j < lim; j += 2, i++) {
00180         tmp[i] = 0;
00181         tmp[i + half] = 0;
00182         for (k = 0; k < coeffs.size(); k++) {
00183           p.nth(d) = j + k;
00184           tmp[i] += im[p] * coeffs.getH(k);
00185           tmp[i + half] += im[p] * coeffs.getG(k);
00186         }
00187       }
00188       for (; i < half; j += 2, i++) {
00189         tmp[i] = 0;
00190         tmp[i + half] = 0;
00191         for (unsigned k = 0; k < coeffs.size(); k++) {
00192           p.nth(d) = (j + k) % n;
00193           tmp[i] += im[p] * coeffs.getH(k);
00194           tmp[i + half] += im[p] * coeffs.getG(k);
00195         }
00196       }
00197 
00198       for (i = 0; i < n; i++) {
00199         p.nth(d) = i;
00200         im[p] = tmp[i];
00201       }
00202 
00203       delete[] tmp;
00204     }


Generated on Thu Apr 15 20:16:17 2004 for Olena by doxygen 1.3.6-20040222