Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Macros | Functions
pyramid2.h File Reference
#include <functional>
#include <vector>
#include <vigra/convolution.hxx>
#include <vigra/error.hxx>
#include <vigra/inspectimage.hxx>
#include <vigra/numerictraits.hxx>
#include <vigra/rgbvalue.hxx>
#include <vigra/sized_int.hxx>
#include <vigra/transformimage.hxx>
Include dependency graph for pyramid2.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  enblend::FromPromotePlusFunctorWrapper< T1, T2, T3 >
 

Namespaces

 enblend
 

Macros

#define IMUL6(A)   (A * SKIPSMImagePixelType(6))
 
#define IMUL5(A)   (A * SKIPSMImagePixelType(5))
 
#define IMUL11(A)   (A * SKIPSMImagePixelType(11))
 
#define AMUL6(A)   (A * SKIPSMAlphaPixelType(6))
 
#define SKIPSM_EXPAND(SCALE_OUT00, SCALE_OUT10, SCALE_OUT01, SCALE_OUT11)
 
#define SKIPSM_EXPAND_SHIFT
 
#define SKIPSM_EXPAND_ROW_END(SCALE_OUT00, SCALE_OUT10, SCALE_OUT01, SCALE_OUT11)
 
#define SKIPSM_EXPAND_COLUMN_END(SCALE_OUT00, SCALE_OUT10, SCALE_OUT01, SCALE_OUT11)
 
#define SKIPSM_EXPAND_COLUMN_END_WRAPAROUND(SCALE_OUT00, SCALE_OUT10, SCALE_OUT01, SCALE_OUT11)
 
#define SKIPSM_EXPAND_ROW_COLUMN_END(SCALE_OUT00, SCALE_OUT10, SCALE_OUT01, SCALE_OUT11)
 

Functions

template<typename ImagePixelComponentType >
unsigned int enblend::filterHalfWidth (const unsigned int levels)
 Calculate the half-width of a n-level filter. More...
 
template<typename SKIPSMImagePixelType , typename SKIPSMAlphaPixelType , typename SrcImageIterator , typename SrcAccessor , typename AlphaIterator , typename AlphaAccessor , typename DestImageIterator , typename DestAccessor , typename DestAlphaIterator , typename DestAlphaAccessor >
void enblend::reduce (bool wraparound, SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, AlphaIterator alpha_upperleft, AlphaAccessor aa, DestImageIterator dest_upperleft, DestImageIterator dest_lowerright, DestAccessor da, DestAlphaIterator dest_alpha_upperleft, DestAlphaIterator dest_alpha_lowerright, DestAlphaAccessor daa)
 The Burt & Adelson Reduce operation. More...
 
template<typename SKIPSMImagePixelType , typename SKIPSMAlphaPixelType , typename SrcImageIterator , typename SrcAccessor , typename AlphaIterator , typename AlphaAccessor , typename DestImageIterator , typename DestAccessor , typename DestAlphaIterator , typename DestAlphaAccessor >
void enblend::reduce (bool wraparound, triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, pair< AlphaIterator, AlphaAccessor > mask, triple< DestImageIterator, DestImageIterator, DestAccessor > dest, triple< DestAlphaIterator, DestAlphaIterator, DestAlphaAccessor > destMask)
 
template<typename SKIPSMImagePixelType , typename SrcImageIterator , typename SrcAccessor , typename DestImageIterator , typename DestAccessor >
void enblend::reduce (bool wraparound, SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, DestImageIterator dest_upperleft, DestImageIterator dest_lowerright, DestAccessor da)
 The Burt & Adelson Reduce operation. More...
 
template<typename SKIPSMImagePixelType , typename SrcImageIterator , typename SrcAccessor , typename DestImageIterator , typename DestAccessor >
void enblend::reduce (bool wraparound, triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, triple< DestImageIterator, DestImageIterator, DestAccessor > dest)
 
template<typename SKIPSMImagePixelType , typename SrcImageIterator , typename SrcAccessor , typename DestImageIterator , typename DestAccessor , typename CombineFunctor >
void enblend::expand (bool add, bool wraparound, SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, DestImageIterator dest_upperleft, DestImageIterator dest_lowerright, DestAccessor da, CombineFunctor cf)
 The Burt & Adelson Expand operation. More...
 
template<typename SKIPSMImagePixelType , typename SrcImageIterator , typename SrcAccessor , typename DestImageIterator , typename DestAccessor >
void enblend::expand (bool add, bool wraparound, triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, triple< DestImageIterator, DestImageIterator, DestAccessor > dest)
 

Macro Definition Documentation

#define AMUL6 (   A)    (A * SKIPSMAlphaPixelType(6))

Definition at line 61 of file pyramid2.h.

Referenced by enblend::reduce().

#define IMUL11 (   A)    (A * SKIPSMImagePixelType(11))

Definition at line 60 of file pyramid2.h.

Referenced by enblend::reduce().

#define IMUL5 (   A)    (A * SKIPSMImagePixelType(5))

Definition at line 59 of file pyramid2.h.

Referenced by enblend::reduce().

#define IMUL6 (   A)    (A * SKIPSMImagePixelType(6))

Definition at line 58 of file pyramid2.h.

Referenced by enblend::expand(), and enblend::reduce().

#define SKIPSM_EXPAND (   SCALE_OUT00,
  SCALE_OUT10,
  SCALE_OUT01,
  SCALE_OUT11 
)
Value:
current = SKIPSMImagePixelType(sa(sx)); \
out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \
out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \
out01 = sc0a[srcx]; \
out11 = sc0b[srcx]; \
sc1a[srcx] = sc0a[srcx]; \
sc1b[srcx] = sc0b[srcx]; \
sc0a[srcx] = sr1 + IMUL6(sr0) + current; \
sc0b[srcx] = (sr0 + current) * 4; \
sr1 = sr0; \
sr0 = current; \
out00 += sc0a[srcx]; \
out10 += sc0b[srcx]; \
out01 += sc0a[srcx]; \
out11 += sc0b[srcx]; \
out00 /= SKIPSMImagePixelType(SCALE_OUT00); \
out10 /= SKIPSMImagePixelType(SCALE_OUT10); \
out01 /= SKIPSMImagePixelType(SCALE_OUT01); \
out11 /= SKIPSMImagePixelType(SCALE_OUT11); \
da.set(cf(SKIPSMImagePixelType(da(dx)), out00), dx); \
++dx.x; \
da.set(cf(SKIPSMImagePixelType(da(dx)), out10), dx); \
++dx.x; \
da.set(cf(SKIPSMImagePixelType(da(dxx)), out01), dxx); \
++dxx.x; \
da.set(cf(SKIPSMImagePixelType(da(dxx)), out11), dxx); \
++dxx.x;
#define IMUL6(A)
Definition: pyramid2.h:58

Definition at line 863 of file pyramid2.h.

Referenced by enblend::expand().

#define SKIPSM_EXPAND_COLUMN_END (   SCALE_OUT00,
  SCALE_OUT10,
  SCALE_OUT01,
  SCALE_OUT11 
)
Value:
out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \
out01 = sc0a[srcx]; \
out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \
out11 = sc0b[srcx]; \
sc1a[srcx] = sc0a[srcx]; \
sc1b[srcx] = sc0b[srcx]; \
sc0a[srcx] = sr1 + IMUL6(sr0); \
sc0b[srcx] = sr0 * 4; \
out00 += sc0a[srcx]; \
out01 += sc0a[srcx]; \
out00 /= SKIPSMImagePixelType(SCALE_OUT00); \
out01 /= SKIPSMImagePixelType(SCALE_OUT01); \
da.set(cf(da(dx), out00), dx); \
da.set(cf(da(dxx), out01), dxx); \
if ((dst_w & 1) == 0) { \
++dx.x; \
++dxx.x; \
out10 += sc0b[srcx]; \
out11 += sc0b[srcx]; \
out10 /= SKIPSMImagePixelType(SCALE_OUT10); \
out11 /= SKIPSMImagePixelType(SCALE_OUT11); \
da.set(cf(da(dx), out10), dx); \
da.set(cf(da(dxx), out11), dxx); \
}
#define IMUL6(A)
Definition: pyramid2.h:58

Definition at line 946 of file pyramid2.h.

Referenced by enblend::expand().

#define SKIPSM_EXPAND_COLUMN_END_WRAPAROUND (   SCALE_OUT00,
  SCALE_OUT10,
  SCALE_OUT01,
  SCALE_OUT11 
)
Value:
out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \
out01 = sc0a[srcx]; \
out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \
out11 = sc0b[srcx]; \
sc1a[srcx] = sc0a[srcx]; \
sc1b[srcx] = sc0b[srcx]; \
sc0a[srcx] = sr1 + IMUL6(sr0) + SKIPSMImagePixelType(sa(sy)); \
sc0b[srcx] = (sr0 + SKIPSMImagePixelType(sa(sy))) * 4; \
out00 += sc0a[srcx]; \
out01 += sc0a[srcx]; \
out00 /= SKIPSMImagePixelType(SCALE_OUT00); \
out01 /= SKIPSMImagePixelType(SCALE_OUT01); \
da.set(cf(da(dx), out00), dx); \
da.set(cf(da(dxx), out01), dxx); \
if ((dst_w & 1) == 0) { \
++dx.x; \
++dxx.x; \
out10 += sc0b[srcx]; \
out11 += sc0b[srcx]; \
out10 /= SKIPSMImagePixelType(SCALE_OUT10); \
out11 /= SKIPSMImagePixelType(SCALE_OUT11); \
da.set(cf(da(dx), out10), dx); \
da.set(cf(da(dxx), out11), dxx); \
}
#define IMUL6(A)
Definition: pyramid2.h:58

Definition at line 974 of file pyramid2.h.

Referenced by enblend::expand().

#define SKIPSM_EXPAND_ROW_COLUMN_END (   SCALE_OUT00,
  SCALE_OUT10,
  SCALE_OUT01,
  SCALE_OUT11 
)
Value:
out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \
out00 /= SKIPSMImagePixelType(SCALE_OUT00); \
da.set(cf(da(dx), out00), dx); \
if ((dst_w & 1) == 0) { \
out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \
out10 /= SKIPSMImagePixelType(SCALE_OUT10); \
++dx.x; \
da.set(cf(da(dx), out10), dx); \
} \
if ((dst_h & 1) == 0) { \
out01 = sc0a[srcx]; \
out01 /= SKIPSMImagePixelType(SCALE_OUT01); \
da.set(cf(da(dxx), out01), dxx); \
if ((dst_w & 1) == 0) { \
out11 = sc0b[srcx]; \
out11 /= SKIPSMImagePixelType(SCALE_OUT11); \
++dxx.x; \
da.set(cf(da(dxx), out11), dxx); \
} \
}
#define IMUL6(A)
Definition: pyramid2.h:58

Definition at line 1002 of file pyramid2.h.

Referenced by enblend::expand().

#define SKIPSM_EXPAND_ROW_END (   SCALE_OUT00,
  SCALE_OUT10,
  SCALE_OUT01,
  SCALE_OUT11 
)
Value:
out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \
out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \
out00 /= SKIPSMImagePixelType(SCALE_OUT00); \
out10 /= SKIPSMImagePixelType(SCALE_OUT10); \
da.set(cf(da(dx), out00), dx); \
++dx.x; \
da.set(cf(da(dx), out10), dx); \
++dx.x; \
if ((dst_h & 1) == 0) { \
out01 = sc0a[srcx]; \
out11 = sc0b[srcx]; \
out01 /= SKIPSMImagePixelType(SCALE_OUT01); \
out11 /= SKIPSMImagePixelType(SCALE_OUT11); \
da.set(cf(da(dxx), out01), dxx); \
++dxx.x; \
da.set(cf(da(dxx), out11), dxx); \
++dxx.x; \
}
#define IMUL6(A)
Definition: pyramid2.h:58

Definition at line 924 of file pyramid2.h.

Referenced by enblend::expand().

#define SKIPSM_EXPAND_SHIFT
Value:
current = SKIPSMImagePixelType(sa(sx)); \
out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \
out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \
out01 = sc0a[srcx]; \
out11 = sc0b[srcx]; \
sc1a[srcx] = sc0a[srcx]; \
sc1b[srcx] = sc0b[srcx]; \
sc0a[srcx] = sr1 + IMUL6(sr0) + current; \
sc0b[srcx] = (sr0 + current) * 4; \
sr1 = sr0; \
sr0 = current; \
out00 += sc0a[srcx]; \
out10 += sc0b[srcx]; \
out01 += sc0a[srcx]; \
out11 += sc0b[srcx]; \
out00 /= 64; \
out10 /= 64; \
out01 /= 16; \
out11 /= 16; \
da.set(cf(SKIPSMImagePixelType(da(dx)), out00), dx); \
++dx.x; \
da.set(cf(SKIPSMImagePixelType(da(dx)), out10), dx); \
++dx.x; \
da.set(cf(SKIPSMImagePixelType(da(dxx)), out01), dxx); \
++dxx.x; \
da.set(cf(SKIPSMImagePixelType(da(dxx)), out11), dxx); \
++dxx.x;
#define IMUL6(A)
Definition: pyramid2.h:58

Definition at line 894 of file pyramid2.h.

Referenced by enblend::expand().