SOURCES: waili-debian.patch (NEW) - Debian patch (-16) with some j...
qboosh
qboosh at pld-linux.org
Sat Feb 4 20:10:57 CET 2006
Author: qboosh Date: Sat Feb 4 19:10:56 2006 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- Debian patch (-16) with some junk removed
---- Files affected:
SOURCES:
waili-debian.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/waili-debian.patch
diff -u /dev/null SOURCES/waili-debian.patch:1.1
--- /dev/null Sat Feb 4 20:10:56 2006
+++ SOURCES/waili-debian.patch Sat Feb 4 20:10:51 2006
@@ -0,0 +1,10746 @@
+--- waili-19990723.orig/Makefile
++++ waili-19990723/Makefile
+@@ -25,14 +25,14 @@
+ SUBDIRS += man
+ endif
+
+-All: Rules.config .depend
++All: Rules.config depend-stamp
+ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done
+
+ Rules.config:
+ $(MAKE) -C config
+
+ clean:
+- rm -f .depend
++ rm -f depend-stamp .wailiDemo_history
+ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i clean; done
+
+ distclean: clean
+@@ -42,12 +42,17 @@
+ rm -f Rules.config
+ $(MAKE) Rules.config
+
+-.depend:
++depend-stamp:
+ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i depend; done
+- touch .depend
++ touch depend-stamp
+
+ depend:
+- rm -f .depend
+- $(MAKE) .depend
++ rm -f depend-stamp
++ $(MAKE) depend-stamp
+
+ dummy:
++
++#added for Debian
++install: All
++ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
++
+--- waili-19990723.orig/Rules.make
++++ waili-19990723/Rules.make
+@@ -20,8 +20,17 @@
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ #
+
++#changed for Debian
++# also, removed the '-o $@' part
+ %.o: %.C
+- $(CXX) $(CFLAGS) -c $< -o $@
++ $(LIBTOOLCXX) $(CXX) $(CPPFLAGS) $(CFLAGS) -c $<
++
++%.lo: %.C
++ $(LIBTOOLCXX) $(CXX) $(CPPFLAGS) $(CFLAGS) -c $<
++
++%.d: %.C Makefile
++ $(CXX) $(CPPFLAGS) -MM -E $(CPPFLAGS) $< > $@
++
+
+
+ ifeq (.depend,$(wildcard .depend))
+--- waili-19990723.orig/include/Makefile
++++ waili-19990723/include/Makefile
+@@ -37,3 +37,10 @@
+
+
+ include ../Rules.make
++
++# ----------------------------------------- Installation
++#added for Debian
++# You're going to have to be root to do this!
++install: All
++ set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
++
+--- waili-19990723.orig/include/waili/Makefile
++++ waili-19990723/include/waili/Makefile
+@@ -39,7 +39,8 @@
+ Timer.h \
+ Types.h \
+ Util.h \
+- Wavelet.h
++ Wavelet.h \
++ Wavelet_bin.h
+
+ All: $(RCSOBJS)
+
+@@ -48,3 +49,10 @@
+ clean:
+
+ include ../../Rules.make
++
++# ----------------------------------------- Installation
++#added for Debian
++# You're going to have to be root to do this!
++install: All
++ $(INSTALL) -d $(DESTDIR)$(PREFIX)/include/waili
++ $(INSTALL) -m 644 $(RCSOBJS) $(DESTDIR)$(PREFIX)/include/waili
+--- waili-19990723.orig/include/waili/Lifting.h
++++ waili-19990723/include/waili/Lifting.h
+@@ -35,6 +35,10 @@
+ public:
+ virtual ~Lifting();
+
++
++ virtual void Lift_bin(int type) const = 0;
++ virtual void ILift_bin(int type) const = 0;
++
+ // Lifting Steps (Full Rounding)
+ virtual void Lift_L1R1_FR(int primal, const s16 b[2], const u16 a)
+ const = 0;
+@@ -109,6 +113,12 @@
+ LiftChannelR(NTChannel *lowpass, NTChannel *highpass);
+ virtual ~LiftChannelR();
+
++
++
++ virtual void Lift_bin(int type) const ;
++ virtual void ILift_bin(int type) const ;
++
++
+ // Lifting Steps (Full Rounding)
+ virtual void Lift_L1R1_FR(int primal, const s16 b[2], const u16 a)
+ const;
+@@ -179,6 +189,14 @@
+ LiftChannelC(NTChannel *lowpass, NTChannel *highpass);
+ virtual ~LiftChannelC();
+
++
++
++
++ virtual void Lift_bin(int type) const;
++ virtual void ILift_bin(int type) const;
++
++
++
+ // Lifting Steps (Full Rounding)
+ virtual void Lift_L1R1_FR(int primal, const s16 b[2], const u16 a)
+ const;
+--- waili-19990723.orig/include/waili/Types.h
++++ waili-19990723/include/waili/Types.h
+@@ -58,5 +58,8 @@
+
+ typedef s16 PixType;
+
++#ifdef __WIN32__
++typedef unsigned int u_int;
++#endif
+
+ #endif // WAILI_TYPES_H
+--- waili-19990723.orig/include/waili/Channel.h
++++ waili-19990723/include/waili/Channel.h
+@@ -34,8 +34,8 @@
+ };
+
+ struct TransformDescriptor {
+- u8 type; // TransformType
+- u8 filter; // Wavelet_IDs
++ TransformType type; // TransformType
++ Wavelet_ID filter; // Wavelet_IDs
+ };
+
+
+@@ -62,13 +62,16 @@
+
+ // Properties
+ u_int GetCols(void) const;
+- u_int GetRows(void) const;
++ u_int GetRows(void) const;
+ int GetOffsetX(void) const;
+ int GetOffsetY(void) const;
+ virtual void GetMask(u_int &maskx, u_int &masky) const = 0;
+ virtual u_int GetDepth(void) const = 0;
++ virtual u_int GetSubbands(void) const = 0;
+ virtual double Psnr(const Channel &channel, PixType maxval = 255)
+ const;
++ virtual double MSE(const Channel &channel)
++ const;
+ virtual u64 *FullHistogram(PixType &min, PixType &max, u64 &numpixels)
+ const = 0;
+ double Entropy(void) const;
+@@ -76,6 +79,7 @@
+ // Manipulation
+ virtual PixType &operator()(u_int c, u_int r) = 0;
+ virtual PixType operator()(u_int c, u_int r) const = 0;
++ virtual PixType *pixaddr(u_int c, u_int r) = 0;
+ virtual void Clear(void) = 0;
+ virtual void Resize(u_int cols, u_int rows);
+ virtual Channel *Clone(void) const = 0;
+--- waili-19990723.orig/include/waili/LChannelR.h
++++ waili-19990723/include/waili/LChannelR.h
+@@ -49,6 +49,8 @@
+ // Manipulation
+ virtual PixType &operator()(u_int c, u_int r);
+ virtual PixType operator()(u_int c, u_int r) const;
++ PixType *pixaddr(u_int c, u_int r);
++
+ virtual void Resize(u_int cols, u_int rows);
+ virtual LChannelR *Clone(void) const;
+ virtual void SetOffsetX(int offx);
+@@ -156,6 +158,27 @@
+ return((*channel)(c, r));
+ }
+
++
++inline PixType *LChannelR::pixaddr(u_int c, u_int r)
++{
++ Channel *channel;
++#ifdef BOUNDS_CHECK
++ assert(c < Cols);
++ assert(r < Rows);
++#endif // BOUNDS_CHECK
++ if (c < GetClow())
++ channel = SubBands[0];
++ else {
++ c -= GetClow();
++ channel = SubBands[1];
++ }
++#ifdef BOUNDS_CHECK
++ assert(channel != NULL);
++#endif // BOUNDS_CHECK
++ return channel->pixaddr(c, r);
++}
++
++
+ inline LChannelR *LChannelR::Clone(void) const
+ {
+ return(new LChannelR(*this));
+--- waili-19990723.orig/include/waili/LChannelCR.h
++++ waili-19990723/include/waili/LChannelCR.h
+@@ -53,6 +53,8 @@
+ // Manipulation
+ virtual PixType &operator()(u_int c, u_int r);
+ virtual PixType operator()(u_int c, u_int r) const;
++ PixType *pixaddr(u_int c, u_int r);
++
+ virtual void Resize(u_int cols, u_int rows);
+ virtual LChannelCR *Clone(void) const;
+ virtual void SetOffsetX(int offx);
+@@ -184,6 +186,29 @@
+ return((*channel)(c, r));
+ }
+
++inline PixType *LChannelCR::pixaddr(u_int c, u_int r)
++{
++ u_int band = SubBand_LL;
++ Channel *channel;
++#ifdef BOUNDS_CHECK
++ assert(c < Cols);
++ assert(r < Rows);
++#endif // BOUNDS_CHECK
++ if (r >= GetRlow()) {
++ r -= GetRlow();
++ band += SubBand_HL;
++ }
++ if (c >= GetClow()) {
++ c -= GetClow();
++ band += SubBand_LH;
++ }
++ channel = SubBands[band];
++#ifdef BOUNDS_CHECK
++ assert(channel != NULL);
++#endif // BOUNDS_CHECK
++ return channel->pixaddr(c, r);
++}
++
+ inline LChannelCR *LChannelCR::Clone(void) const
+ {
+ return(new LChannelCR(*this));
+--- waili-19990723.orig/include/waili/LChannelC.h
++++ waili-19990723/include/waili/LChannelC.h
+@@ -49,6 +49,8 @@
+ // Manipulation
+ virtual PixType &operator()(u_int c, u_int r);
+ virtual PixType operator()(u_int c, u_int r) const;
++ PixType *pixaddr(u_int c, u_int r);
++
+ virtual void Resize(u_int cols, u_int rows);
+ virtual LChannelC *Clone(void) const;
+ virtual void SetOffsetX(int offx);
+@@ -156,6 +158,25 @@
+ return((*channel)(c, r));
+ }
+
++inline PixType *LChannelC::pixaddr(u_int c, u_int r)
++{
++ Channel *channel;
++#ifdef BOUNDS_CHECK
++ assert(c < Cols);
++ assert(r < Rows);
++#endif // BOUNDS_CHECK
++ if (r < GetRlow())
++ channel = SubBands[0];
++ else {
++ r -= GetRlow();
++ channel = SubBands[1];
++ }
++#ifdef BOUNDS_CHECK
++ assert(channel != NULL);
++#endif // BOUNDS_CHECK
++ return channel->pixaddr(c, r);
++}
++
+ inline LChannelC *LChannelC::Clone(void) const
+ {
+ return(new LChannelC(*this));
+--- waili-19990723.orig/include/waili/Blit.h
++++ waili-19990723/include/waili/Blit.h
+@@ -102,7 +102,7 @@
+
+ template <class Type>
+ inline void FillRect(Type *dst, u_int dw, u_int dx, u_int dy, u_int cols,
+- u_int rows, Type value)
++ u_int rows, Type value )
+ {
+ FillRect(dst+dy*dw+dx, dw, cols, rows, value);
+ }
+@@ -121,7 +121,7 @@
+
+ template <class Type>
+ inline void ClearRect(Type *dst, u_int dw, u_int dx, u_int dy, u_int cols,
+- u_int rows)
++ u_int rows, Type value)
+ {
+ ClearRect(dst+dy*dw+dx, dw, cols, rows, value);
+ }
+--- waili-19990723.orig/include/waili/Util.h
++++ waili-19990723/include/waili/Util.h
+@@ -63,7 +63,7 @@
+ template <class Type>
+ inline Type Min(Type x, Type y)
+ {
+-#ifdef __GNUG__
++#ifdef __GNUG_DEPRECATED__
+ return(x <? y);
+ #else /* !__GNUG__ */
+ return(x < y ? x : y);
+@@ -73,7 +73,7 @@
+ template <class Type>
+ inline Type Max(Type x, Type y)
+ {
+-#ifdef __GNUG__
++#ifdef __GNUG_DEPRECATED__
+ return(x >? y);
+ #else /* !__GNUG__ */
+ return(x > y ? x : y);
+--- waili-19990723.orig/include/waili/Wavelet_gain.h
++++ waili-19990723/include/waili/Wavelet_gain.h
+@@ -0,0 +1,7 @@
++
++double *wavelet_gaussian_variance_gain_by_type(TransformType type);
++
++double *wavelet_gaussian_variance_gain(Channel *C);
++
++double *wavelet_uniform_maximum_gain_by_type(int type);
++
+--- waili-19990723.orig/include/waili/LChannel.h
++++ waili-19990723/include/waili/LChannel.h
+@@ -54,6 +54,7 @@
+
+ // Properties
+ virtual u_int GetDepth(void) const;
++ u_int GetSubbands(void) const;
+ virtual TransformType GetTransformType(void) const = 0;
+ TransformDescriptor *GetTransform(void) const;
+ virtual u64 *FullHistogram(PixType &min, PixType &max, u64 &numpixels)
+@@ -64,7 +65,7 @@
+ // Manipulation
+ virtual void Clear(void);
+ Channel* &operator[](SubBand band);
+- const Channel* &operator[](SubBand band) const;
++ Channel* &operator[](SubBand band) const;
+ virtual LChannel *Clone(void) const = 0;
+
+ // Wavelet Transforms
+@@ -140,6 +141,11 @@
+ return(1+SubBands[0]->GetDepth());
+ }
+
++inline u_int LChannel::GetSubbands(void) const
++{
++ return NumSubBands;
++}
++
+ inline int LChannel::GetShift(SubBand band)
+ {
+ assert((u_int)band < NumSubBands);
+@@ -149,14 +155,14 @@
+ inline Channel* &LChannel::operator[](SubBand band)
+ {
+ assert((u_int)band < NumSubBands);
+- assert(SubBands[band] != NULL);
++ //assert(SubBands[band] != NULL);
+ return(SubBands[band]);
+ }
+
+-inline const Channel* &LChannel::operator[](SubBand band) const
++inline Channel* &LChannel::operator[](SubBand band) const
+ {
+ assert((u_int)band < NumSubBands);
+- assert(SubBands[band] != NULL);
++ //assert(SubBands[band] != NULL);
+ return(SubBands[band]);
+ }
+
+--- waili-19990723.orig/include/waili/Wavelet_bin.h
++++ waili-19990723/include/waili/Wavelet_bin.h
+@@ -0,0 +1,15 @@
++
++
++class Wavelet_Binary : public Wavelet {
++public:
++ Wavelet_Binary();
++
++ // Lifting steps on Channels
++ void CakeWalk(Lifting &lifting) const ;
++ void ICakeWalk(Lifting &lifting) const ;
++ Wavelet_Binary *Clone(void) const;
++
++private:
++ static const char *rcsid;
++};
++
+--- waili-19990723.orig/include/waili/Wavelet.h
++++ waili-19990723/include/waili/Wavelet.h
+@@ -34,6 +34,16 @@
+ #define LIFTING_OPTIMIZE_STEPS 1 // Use optimized lifting steps
+
+
++// Unique private IDs
++enum Wavelet_ID {
++ ID_Lazy = 0,
++ ID_CDF_1_1 = 1, ID_CDF_1_3 = 2, ID_CDF_1_5 = 3,
++ ID_CDF_2_2 = 4, ID_CDF_2_4 = 5, ID_CDF_2_6 = 6,
++ ID_CDF_4_2 = 7, ID_CDF_4_4 = 8, ID_CDF_4_6 = 9,
++ ID_CRF_13_7 = 100, ID_SWE_13_7 = 101
++};
++
++
+
+ // ----------------------------------------------------------------------------
+ //
+@@ -62,29 +72,21 @@
+ int GetShiftH(void) const;
+
+ // Unique private IDs for different Wavelets
+- u8 GetID(void) const;
+- static Wavelet *CreateFromID(u8 id);
++ Wavelet_ID GetID(void) const { return ID; };
++
++ static Wavelet *CreateFromID(Wavelet_ID id);
+
+ protected:
+ int GStart, GEnd, HStart, HEnd;
+ // Normalization
+ int ShiftL, ShiftH;
+
+- // Unique private IDs
+- enum Wavelet_IDs {
+- ID_Lazy = 0,
+- ID_CDF_1_1 = 1, ID_CDF_1_3 = 2, ID_CDF_1_5 = 3,
+- ID_CDF_2_2 = 4, ID_CDF_2_4 = 5, ID_CDF_2_6 = 6,
+- ID_CDF_4_2 = 7, ID_CDF_4_4 = 8, ID_CDF_4_6 = 9,
+- ID_CRF_13_7 = 100, ID_SWE_13_7 = 101
+- };
+- u8 ID;
++ Wavelet_ID ID;
+
+ private:
+ static const char *rcsid;
+ };
+
+-
+ // ----------------------------------------------------------------------------
+
+
+@@ -337,7 +339,6 @@
+ // Lifting steps on Channels
+ virtual void CakeWalk(Lifting &lifting) const;
+ virtual void ICakeWalk(Lifting &lifting) const;
+-
+ protected:
+ static const s16 D1b[4];
+ static const u16 D1a;
+@@ -367,6 +368,9 @@
+ static const char *rcsid;
+ };
+
++/////////////////////////////////////////////////////////////
++
++#include "waili/Wavelet_bin.h"
+
+ /////////////////////////////////////////////////////////////////////////////
+ //
+@@ -405,11 +409,6 @@
+ return(ShiftH);
+ }
+
+-inline u8 Wavelet::GetID(void) const
+-{
+- return ID;
+-}
+-
+ inline Wavelet_Lazy::Wavelet_Lazy()
+ {
+ HStart = 0;
+--- waili-19990723.orig/include/waili/gtk.h
++++ waili-19990723/include/waili/gtk.h
+@@ -0,0 +1,67 @@
++
++#ifndef __WAILI_GTK_H__
++#define __WAILI_GTK_H__
++
++#include <waili/Image.h>
++
++#ifndef GDK_PIXBUF_MAJOR
++#error you need to install gtk 2.0 or gdk-pixbuf, and include <gdk-pixbuf/gdk-pixbuf.h> to use this header
++#endif
++
++Image *gdk_to_waili(GdkPixbuf *src)
++{
++ gchar * data = gdk_pixbuf_get_pixels(src);
++ int ch,channels=gdk_pixbuf_get_n_channels(src),
++ stride=gdk_pixbuf_get_rowstride(src),
++ w= gdk_pixbuf_get_width(src), h=gdk_pixbuf_get_height(src), c ,r ;
++
++ Image * dst = new Image(w,h,ch);
++ for (r = 0; r < h; r++)
++ for (c = 0; c < w; c++)
++ for (ch = 0; ch < channels; ch++) {
++ (*dst)(c, r, ch) = (PixType)
++ ( data[ch+ c*channels + stride*r]-128);
++ }
++ return dst;
++}
++GdkPixbuf *waili_to_gdk(Image *src)
++{
++ int ch,channels=src->GetChannels(),
++ w=src->GetCols(), h=src->GetRows(), c ,r ;
++ GdkPixbuf *dst=gdk_pixbuf_new
++ (GDK_COLORSPACE_RGB,//GdkColorspace colorspace,
++ (channels==4?1:0),//gboolean has_alpha,
++ 8,//int bits_per_sample,
++ w,//int width,
++ h);//int height);
++ gchar * data = gdk_pixbuf_get_pixels(dst);
++
++ int stride=gdk_pixbuf_get_rowstride(src);
++
++ switch(channels) {
++ case 1:
++ for (r = 0; r < h; r++)
++ for (c = 0; c < w; c++) {
++ data[ c + stride*r]=
++ data[ c + stride*r+1]=
++ data[ c + stride*r+2]=
++ CLAMP((*src)(c, r, 0) +128,0,255);
++ }
++ break;
++ case 3:
++ case 4:
++
++ for (r = 0; r < h; r++)
++ for (c = 0; c < w; c++)
++ for (ch = 0; ch < channels; ch++) {
++ data[ch+ c*channels + stride*r]=
++ CLAMP((*src)(c, r, ch) +128,0,255);
++
++ }
++ break;
++ default: abort();
++ }
++ return dst;
++}
++
++#endif // __WAILI_GTK_H__
+--- waili-19990723.orig/include/waili/Image.h
++++ waili-19990723/include/waili/Image.h
+@@ -24,7 +24,7 @@
+ #define WAILI_IMAGE_H
+
+ #include <assert.h>
+-#include <stream.h>
++#include <sstream>
+
+ #include "Channel.h"
+ #include "Util.h"
+@@ -76,7 +76,7 @@
+
+ // Manipulation
+ Channel*& operator[](u_int channel);
<<Diff was trimmed, longer than 597 lines>>
More information about the pld-cvs-commit
mailing list