Thread: [Wavelet-commit] Wavelet ImageResizer.cc, NONE, 1.1 AviReader.cc, 1.5, 1.6 AviWriter.cc, 1.7, 1.8 C
Status: Beta
Brought to you by:
herbert
Update of /cvsroot/wavelet/Wavelet In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6566 Modified Files: AviReader.cc AviWriter.cc CoeffInformation.cc ColorBuffer.cc ColorImage.cc ColorVideo.cc FileName.cc Filter.cc GreymapWriter.cc Histogram.cc Image.cc ImageArray.cc ImageComparison.cc ImageDenoiser.cc ImageInformation.cc ImageVector.cc JpgReader.cc JpgWriter.cc Makefile.in Makefile.mdd Makefile.msc Makefile.watcomc MirrorPosition.cc NTree.cc PfcReader.cc PfcWriter.cc PfgReader.cc PfgWriter.cc PgmReader.cc PgmWriter.cc PixmapFile.cc PixmapWriter.cc PpmReader.cc PpmWriter.cc PyramidTransform.cc PyramidTree.cc RawReader.cc RawWriter.cc StillImage.cc VidReader.cc VidWriter.cc VideoArray.cc VideoFrame.cc VideoWriter.cc Wavelet.cc configure configure.in debug.cc ppmlib.cc tools.cc wave_version.h Added Files: ImageResizer.cc Log Message: Various bugfixes, added ImageResizer tool class which allows smart cropping of color images (not very sophisticated yet). Index: ImageVector.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ImageVector.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ImageVector.cc 10 Aug 2005 09:35:23 -0000 1.3 --- ImageVector.cc 7 Aug 2007 17:00:58 -0000 1.4 *************** *** 14,17 **** --- 14,18 ---- #endif #include <stdexcept> + #include <cmath> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) *************** *** 50,51 **** --- 51,62 ---- } + coeff + ImageVector::weight(void) + { + coeff rc = 0; + for (int i = 0; i < size(); i++) { + rc += fabs (this->at(i)); + } + return rc; + } + --- NEW FILE: ImageResizer.cc --- /* * Implementation of class ImageResizer * * $Date: 2007/08/07 17:00:58 $ * $Revision: 1.1 $ * */ #include "Wave/PyramidTransform.hh" #include "WTools/ImageResizer.hh" #ifdef _WIN32_WCE #undef DELETE #endif #include <cmath> #include <cassert> #include <iostream> #include <iomanip> #include "WImage/miscdefs.h" #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) using namespace std; #endif ImageResizer::ImageResizer(const ColorImage &img, FilterSet &flt, int *fill, coeff threshold, int scalingStrategy) : m_image (img), m_resized (NULL), m_filter (flt), m_transform (NULL), m_qRows (0), m_qCols (0), m_factor (0), m_useRows (0), m_useCols (0), m_scalingStrategy (scalingStrategy), m_innerAvgPerSize (0), m_innerSDeviation (0), m_threshold (threshold) { if (fill == NULL) { m_fill = fill; } else { m_fill = new int [m_image.colors ()]; for (int i = 0; i < m_image.colors (); i++) { m_fill[i] = fill[i]; } } } ImageResizer::~ImageResizer(void) { DELETENOTNULL (m_resized); DELETENOTNULLAR (m_fill); } void ImageResizer::calcDimensions (int rows, int cols) { /* find the best fit: we want either the rows or the cols to * fit exactly so that the remaining dimension can be cropped */ m_useRows = (int)floor (m_image.rows () * m_qCols + 0.5); m_useCols = (int)floor (m_image.cols () * m_qRows + 0.5); if (m_useRows >= rows) { m_factor = m_qCols; m_useCols = cols; m_cropWhat = CROP_ROWS; } else { m_factor = m_qRows; m_useRows = rows; m_cropWhat = CROP_COLS; } } // TODO: calculate image quality heuristics here! Image * ImageResizer::prepareImage (int rows, int cols, int steps) { /* m_factor delivers us an image of same size or larger than * specified by rows/cols */ m_resized = m_image.scale (m_factor, m_scalingStrategy); assert (m_resized->rows() >= rows); assert (m_resized->cols() >= cols); Image *channel; ColorImage *tmp = m_resized->clone (); Image *maxDetail = NULL; int oldY = tmp->rows(); int oldX = tmp->cols(); /* perform a wavelet transform on all channels and from this calculate the * image containing the max values from all channels' detail areas */ for (int i = 0; i < tmp->colors (); i++) { DELETENOTNULL (m_transform); m_transform = NEW (PyramidTransform (tmp->channel (i), m_filter)); m_transform->expandImage (); m_transform->analysis (steps); channel = m_transform->highMax (steps); if (i == 0) { maxDetail = channel->clone (); } else { for (int j = 0; j < channel->size(); j++) { if (channel->at (j) > maxDetail->at (j)) { maxDetail->to (j, channel->at (j)); } } } DELETE (channel); } /* now restore the old image's ratio for the one produced from the max * coefficients in the detail areas */ maxDetail->resize(maxDetail->rows() * oldY / tmp->rows(), maxDetail->cols() * oldX / tmp->cols()); DELETE(tmp); DELETE (m_transform); return maxDetail; } void ImageResizer::doResizeImage(int rows, int cols, int nDiscardEach) { ColorImage *tmp = NULL; if (nDiscardEach > 0) { int fromY = m_cropWhat == CROP_COLS? 0: nDiscardEach; int fromX = m_cropWhat == CROP_ROWS? 0: nDiscardEach; int sizeY = m_cropWhat == CROP_COLS? m_resized->rows (): m_resized->rows () - 2 * nDiscardEach; int sizeX = m_cropWhat == CROP_ROWS? m_resized->cols (): m_resized->cols () - 2 * nDiscardEach; // TOOD this is far from optimal, but let's just see how it works first tmp = m_resized->crop (fromY, fromX, sizeY, sizeX); DELETE (m_resized); } else { tmp = m_resized; } m_resized = tmp->fitInto (rows, cols, m_fill, m_scalingStrategy); DELETE (tmp); } static coeff absVariance (int fromY, int fromX, int toY, int toX, Image &img, coeff avg) { int nVals = 0; int lower = (toY < 0)? img.rows (): toY; int right = (toX < 0)? img.cols (): toX; coeff ret = 0.0; coeff tmp; for (int y = (fromY < 0? 0: fromY); y < lower && y < img.rows (); y++) { for (int x = (fromX < 0? 0: fromX); x < right && x < img.cols (); x++) { ++nVals; tmp = fabs (img.at (y, x)); tmp -= avg; ret += SQUARE (tmp); } } return ret / nVals; } void ImageResizer::calcStats(Image &img, int nVecs, coeff &outerAvg, coeff &outerSDev, coeff &innerAvg, coeff &innerSDev) { // we're not calculating the *REAL* standard deviation here since we have // independent regions on which we calculate the averages which are used // for calculating the standard deviation, but what we get here will // normally come close enough to the real thing // OPTIMIZE ME: the calculation of the average is duplicate here coeff outerVariance; coeff innerVariance; if (m_cropWhat == CROP_COLS) { int top = 0; int bottom = -1; int firstLeft = 0; int firstRight = nVecs; int secondLeft = img.cols () - nVecs; int secondRight = -1; outerAvg = (img.aaverage (top, firstLeft, bottom, firstRight) + img.aaverage (top, secondLeft, bottom, secondRight)) / 2.0; outerVariance = (absVariance (top, firstLeft, bottom, firstRight, img, outerAvg) + absVariance (top, secondLeft, bottom, secondRight, img, outerAvg)) / 2; innerAvg = img.aaverage (top, firstRight, bottom, secondLeft); innerVariance = absVariance (top, firstRight, bottom, secondLeft, img, innerAvg); } else { int left = 0; int right = -1; int firstTop = 0; int firstBottom = nVecs; int secondTop = img.rows () - nVecs; int secondBottom = -1; outerAvg = (img.aaverage (firstTop, left, firstBottom, right) + img.aaverage (secondTop, left, secondBottom, right)) / 2.0; outerVariance = (absVariance (firstTop, left, firstBottom, right, img, outerAvg) + absVariance (secondTop, left, secondBottom, right, img, outerAvg)) / 2.0; innerAvg = img.aaverage (firstBottom, left, secondTop, right); innerVariance = absVariance (firstBottom, left, secondTop, right, img, innerAvg); } outerSDev = sqrt (outerVariance); innerSDev = sqrt (innerVariance); } ColorImage* ImageResizer::resize(int rows, int cols, int steps) { if (rows <= 0 || cols <= 0) { throw invalid_argument ("rows or columns arg is <= zero"); } m_qRows = (float)rows / m_image.rows(); m_qCols = (float)cols / m_image.cols(); m_factor = m_qRows; /* no dimension change necessary? do the job and go away */ if (fabs (m_qRows - m_qCols) < COEFF_EPSILON) { return m_image.scale (m_factor, m_scalingStrategy); } calcDimensions (rows, cols); Image *maxDetail = prepareImage (rows, cols, steps); coeff outerAvg; coeff outerSDev; coeff innerAvg; coeff innerSDev; // maxDetail->rows () / maxDetali->cols () == ratio; double ratio = (double)rows / (double)cols; double mapping; int maxI = 0; if (m_cropWhat == CROP_COLS) { //std::cout << "cropping columns..." << std::endl; // ratio = maxDetail->rows () / (maxDetail->cols () - 2 * maxI) // ratio * (maxDetail->cols () - 2 * maxI) = maxDetail->rows () // maxDetail->cols () - 2 * maxI = maxDetail->rows () / ratio maxI = - (int)(maxDetail->rows () / ratio - maxDetail->cols () + 0.5); mapping = m_resized->cols () / maxDetail->cols (); assert (maxI <= maxDetail->cols ()); } else { //std::cout << "cropping rows..." << std::endl; // ratio = (maxDetail->rows () - 2 * maxI) / maxDetail->cols () // ratio * maxDetail->cols () = maxDetail->rows () - 2 * maxI maxI = - (int)(maxDetail->cols () * ratio - maxDetail->rows () + 0.5); mapping = m_resized->rows () / maxDetail->rows (); assert (maxI <= maxDetail->rows ()); } maxI /= 2; //std::cout << "maxI: " << maxI << ", ratio: " << ratio << std::endl; int nDiscardEach = 0; double outerByInner; cout.setf (ios::fixed, ios::floatfield); for (int i = 1; i < maxI && nDiscardEach == 0; i++) { calcStats(*maxDetail, i, outerAvg, outerSDev, innerAvg, innerSDev); outerByInner = outerAvg / innerAvg; cout.setf (ios::fixed, ios::floatfield); /*cout << "i: " << std::setw (2) << i << std::setw (2) << ", oa: " << outerAvg << std::setw (2) << ", os: " << outerSDev << std::setw (2) << ", ia: " << innerAvg << std::setw (2) << ", is: " << innerSDev << std::setw (2) << ", o / i: " << outerByInner << endl;*/ m_innerAvgPerSize = innerAvg / maxDetail->size (); m_innerSDeviation = innerSDev; if (outerByInner > m_threshold) { nDiscardEach = (i > 0)? (int)(mapping * (i - 1)) : 0; } } doResizeImage(rows, cols, nDiscardEach); DELETE (maxDetail); ColorImage *ret = m_resized; m_resized = NULL; return ret; } Index: configure.in =================================================================== RCS file: /cvsroot/wavelet/Wavelet/configure.in,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configure.in 8 Dec 2004 11:53:01 -0000 1.2 --- configure.in 7 Aug 2007 17:00:59 -0000 1.3 *************** *** 97,100 **** --- 97,108 ---- AC_SUBST(JPEG_LIB) + CHECK_PFI="yes" + dnl Checks if we are going to enable the pfi library + AC_ARG_ENABLE(debug, + [--disable-pfi Turn off pfi support], + CHECK_PFI="no", + CHECK_PFI="yes" + ) + dnl Checks for pfi header. AC_CHECK_HEADER(pfi.h, *************** *** 107,110 **** --- 115,121 ---- ) + test "$CHECK_PFI" = "no" && PFI_DEF="" + test "$CHECK_PFI" = "no" && PFI_LIB="" + AC_SUBST(PFI_DEF) AC_SUBST(PFI_LIB) Index: Makefile.in =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Makefile.in,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile.in 15 Aug 2005 17:09:41 -0000 1.10 --- Makefile.in 7 Aug 2007 17:00:58 -0000 1.11 *************** *** 49,53 **** OBJ9 = ImageInformation$O ImageComparison$O Histogram$O ImageDenoiser$O OBJA = VideoFrame$O ColorVideo$O VideoFile$O VideoReader$O VidReader$O ! OBJB = VideoWriter$O VidWriter$O AviReader$O AviWriter$O ifneq (@PFI_DEF@,) PFIO = PfgReader$O PfgWriter$O PfcReader$O PfcWriter$O --- 49,53 ---- OBJ9 = ImageInformation$O ImageComparison$O Histogram$O ImageDenoiser$O OBJA = VideoFrame$O ColorVideo$O VideoFile$O VideoReader$O VidReader$O ! OBJB = VideoWriter$O VidWriter$O AviReader$O AviWriter$O ImageResizer$O ifneq (@PFI_DEF@,) PFIO = PfgReader$O PfgWriter$O PfcReader$O PfcWriter$O *************** *** 140,150 **** tar: Wavelet-$(VERSION).tar.gz ! Wavelet-$(VERSION).tar.gz: *.cc *.hh *.h configure.in configure config.guess \ ! config.sub install-sh latex/*.* images/*.* Makefile.in test/*.cc ! test/*.vid test/Makefile.in test/*.raw test/*.pgm test/*.pfi \ ! test/*.ppm test/*.jpg W*/*.hh W*/*.h tools/*.cc tools/Makefile.in \ ! man/*.1 COPYING INSTALL INSTALL.W32 README Makefile.msc \ ! tools/Makefile.msc Makefile.mdd test/Makefile.msc Makefile.watcomc \ ! tools/Makefile.watcomc test/Makefile.watcomc ChangeLog Doxyfile.in $(MAKE) clean tar -C .. -czvpf $@ $(addprefix Wavelet/, $^) --- 140,151 ---- tar: Wavelet-$(VERSION).tar.gz ! Wavelet-$(VERSION).tar.gz: *.c *.cc *.hh *.h \ ! configure.in configure config.guess config.sub install-sh \ ! images/*.* test/*.cc test/*.h W*/*.hh W*/*.h tools/*.cc \ ! test/*.vid test/*.raw test/*.pgm test/*.pfi test/*.ppm test/*.jpg \ ! test/tw*.avi man/*.1 COPYING INSTALL INSTALL.W32 README ChangeLog \ ! Makefile.in Makefile.msc Makefile.watcomc Makefile.mdd Doxyfile.in \ ! tools/Makefile.in tools/Makefile.msc tools/Makefile.watcomc \ ! test/Makefile.in test/Makefile.msc test/Makefile.watcomc $(MAKE) clean tar -C .. -czvpf $@ $(addprefix Wavelet/, $^) *************** *** 276,280 **** %.dd: %.cc ! @$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $< \ | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ [ -s $@ ] || rm -f $@' --- 277,281 ---- %.dd: %.cc ! @$(SHELL) -ec '$(CXX) -MM $(CPPFLAGS) $< \ | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ [ -s $@ ] || rm -f $@' Index: PgmReader.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PgmReader.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PgmReader.cc 8 Mar 2006 17:14:57 -0000 1.3 --- PgmReader.cc 7 Aug 2007 17:00:58 -0000 1.4 *************** *** 10,14 **** #include "WImage/PgmReader.hh" #include "WImage/debug.h" ! #include <stdio.h> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) --- 10,14 ---- #include "WImage/PgmReader.hh" #include "WImage/debug.h" ! #include <cstdio> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) Index: PpmReader.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PpmReader.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PpmReader.cc 8 Mar 2006 17:14:57 -0000 1.5 --- PpmReader.cc 7 Aug 2007 17:00:59 -0000 1.6 *************** *** 11,15 **** #include "WImage/debug.h" #include "ppmlib.h" ! #include <stdio.h> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) --- 11,15 ---- #include "WImage/debug.h" #include "ppmlib.h" ! #include <cstdio> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) Index: RawReader.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/RawReader.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RawReader.cc 8 Mar 2006 17:14:57 -0000 1.4 --- RawReader.cc 7 Aug 2007 17:00:59 -0000 1.5 *************** *** 10,14 **** #include "WImage/RawReader.hh" #include "WImage/debug.h" ! #include <stdio.h> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) --- 10,14 ---- #include "WImage/RawReader.hh" #include "WImage/debug.h" ! #include <cstdio> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) Index: ImageComparison.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ImageComparison.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ImageComparison.cc 8 Mar 2006 17:14:57 -0000 1.7 --- ImageComparison.cc 7 Aug 2007 17:00:58 -0000 1.8 *************** *** 13,18 **** #undef DELETE #endif ! #include <math.h> ! #include <assert.h> #include "WImage/miscdefs.h" --- 13,18 ---- #undef DELETE #endif ! #include <cmath> ! #include <cassert> #include "WImage/miscdefs.h" Index: tools.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tools.cc 13 Jul 2005 12:13:23 -0000 1.6 --- tools.cc 7 Aug 2007 17:00:59 -0000 1.7 *************** *** 8,16 **** #include "WImage/tools.h" ! #include <float.h> ! #include <math.h> ! #include <ctype.h> ! #include <string.h> ! #include <stdio.h> #include <stdexcept> --- 8,16 ---- #include "WImage/tools.h" ! #include <cfloat> ! #include <cmath> ! #include <cctype> ! #include <cstring> ! #include <cstdio> #include <stdexcept> Index: PixmapWriter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PixmapWriter.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PixmapWriter.cc 10 Aug 2005 09:35:23 -0000 1.2 --- PixmapWriter.cc 7 Aug 2007 17:00:58 -0000 1.3 *************** *** 12,21 **** #include "WImage/debug.h" #include "WImage/tools.h" ! #include <math.h> #include <iostream> #include <stdexcept> #include <fstream> ! #include <assert.h> ! #include <float.h> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) --- 12,21 ---- #include "WImage/debug.h" #include "WImage/tools.h" ! #include <cmath> #include <iostream> #include <stdexcept> #include <fstream> ! #include <cassert> ! #include <cfloat> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) Index: VidWriter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/VidWriter.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** VidWriter.cc 8 Mar 2006 17:14:57 -0000 1.3 --- VidWriter.cc 7 Aug 2007 17:00:59 -0000 1.4 *************** *** 10,14 **** #include "WImage/debug.h" #include "WImage/tools.h" ! #include <stdio.h> int --- 10,14 ---- #include "WImage/debug.h" #include "WImage/tools.h" ! #include <cstdio> int Index: StillImage.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/StillImage.cc,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** StillImage.cc 22 May 2007 14:55:44 -0000 1.11 --- StillImage.cc 7 Aug 2007 17:00:59 -0000 1.12 *************** *** 22,27 **** #endif #include <stdexcept> ! #include <string.h> ! #include <assert.h> #ifndef _WIN32_WCE #include <iostream> --- 22,27 ---- #endif #include <stdexcept> ! #include <cstring> ! #include <cassert> #ifndef _WIN32_WCE #include <iostream> *************** *** 37,41 **** StillImage::mkImage (int rows, int cols) const { ! return NEW (StillImage (rows, cols)); } --- 37,44 ---- StillImage::mkImage (int rows, int cols) const { ! //return NEW (StillImage (rows, cols)); ! Image *ret = NEW (StillImage (rows, cols)); ! //std::cout << "mkImage: " << ret << std::endl; ! return ret; } Index: Filter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Filter.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Filter.cc 10 Aug 2005 09:35:23 -0000 1.3 --- Filter.cc 7 Aug 2007 17:00:58 -0000 1.4 *************** *** 25,34 **** /*---------------------------------------------------------------------------*/ #include <stdexcept> ! #include <stdio.h> ! #include <stdarg.h> ! #include <stdlib.h> ! #include <string.h> ! #include <math.h> ! #include <assert.h> #include "Wave/Filter.hh" --- 25,34 ---- /*---------------------------------------------------------------------------*/ #include <stdexcept> ! #include <cstdio> ! #include <cstdarg> ! #include <cstdlib> ! #include <cstring> ! #include <cmath> ! #include <cassert> #include "Wave/Filter.hh" Index: ImageDenoiser.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ImageDenoiser.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ImageDenoiser.cc 8 Mar 2006 17:14:57 -0000 1.7 --- ImageDenoiser.cc 7 Aug 2007 17:00:58 -0000 1.8 *************** *** 12,18 **** #undef DELETE #endif ! #include <assert.h> #include <stdexcept> ! #include <math.h> #include "WImage/miscdefs.h" --- 12,18 ---- #undef DELETE #endif ! #include <cassert> #include <stdexcept> ! #include <cmath> #include "WImage/miscdefs.h" Index: Makefile.mdd =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Makefile.mdd,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.mdd 14 Jan 2005 13:51:15 -0000 1.5 --- Makefile.mdd 7 Aug 2007 17:00:58 -0000 1.6 *************** *** 1 **** ! # # MSC Makefile for Wave -- (c) 2002 by Herbert # # This Makefile is used for creating object files with the -MDd switch # to avoid library conflicts when using it in MFC apps. # # No dependency checking done! # SHELL = cmd.exe /c # # The program's main version... # VERSION = 0.9a MAJOR = 0 # # tools used for compiling / installing... # CXX = cl -nologo AR = lib O = .obj E = .exe A = .lib # # Name of target object files: # OBJ1 = debug$O tools$O avilib$O OBJ2 = ImageVector$O RowVector$O ColumnVector$O FullVector$O OBJ3 = GreymapFile$O GreymapReader$O GreymapWriter$O PgmReader$O PgmWriter$O OBJ4 = RawReader$O RawWriter$O FileName$O Image$O StillImage$O ppmlib$O OBJ5 = ColorImage$O PixmapFile$O PixmapReader$O PixmapWriter$O PpmReader$O OBJ6 = PpmWriter$O CoeffInformation$O PyramidTree$O ColorBuffer$O OBJ7 = Wavelet$O WaveletTransform$O PyramidTransform$O StandardTransform$O OBJ8 = Filter$O VectorPosition$O MirrorPosition$O PeriodicPosition$O OBJ9 = ImageInformation$O ImageComparison$O Histogram$O ImageDenoiser$O OBJA = VideoFrame$O ColorVideo$O VideoFile$O VideoReader$O VidReader$O OBJB = VideoWriter$O VidWriter$O AviReader$O AviWriter$O JPEG0 = JpgReader$O JpgWriter$O LIBS = .PHONY: all clean _test _tools tar zip # # Main target and file dependencies: # all: wavelet$A # # Flags passed to the compiler # CPPFLAGS = -I. -I../vc6/include -DJPEG -I../jpeg-6b CXXDEBUG = -DDPRINTF="" CXXOPT = -Ox CFLAGS = $(CXXDEBUG) $(CPPFLAGS) $(CXXOPT) -W3 -WX CXXFLAGS = $(CFLAGS) -TP -GX -GR -MDd # # Flags passed to the lib utility # ARFLAGS = /nologo /out: # # Automatic stuff, should not be changed: # OBJS = $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(OBJ7) $(OBJ8) \ $(OBJ9) $(OBJA) $(OBJB) $(JPEGO) # # rules: # zip: Wavelet-$(VERSION)-win32-bin.zip Wavelet-$(VERSION)-win32-bin.zip: $(MAKE) all _test -f Makefile.msc cd .. & zip $@ Wavelet/*.h Wavelet/*.hh Wavelet/COPYING \ Wavelet/INSTALL Wavelet/README Wavelet/INSTALL.W32 Wavelet/ChangeLog \ Wavelet/ImageArray.cc Wavelet/VideoArray.cc Wavelet/NTree.cc \ Wavelet/W*/*.h Wavelet/W*/*.hh Wavelet/wavelet$A Wavelet/tools/*$E Wavelet/man/*.1 Wavelet/images/*.* Wavelet/test/*$E \ Wavelet/test/*.ppm Wavelet/test/*.pgm Wavelet/test/*.raw \ Wavelet/test/*.pfi move ..\\$@ . tar: Wavelet-$(VERSION)-win32-bin.tar.gz Wavelet-$(VERSION)-win32-bin.tar.gz: $(MAKE) all _test -f Makefile.msc cd .. & tar -czvpf $@ Wavelet/*.h Wavelet/*.hh Wavelet/COPYING \ Wavelet/INSTALL Wavelet/README Wavelet/INSTALL.W32 Wavelet/ChangeLog \ Wavelet/ImageArray.cc Wavelet/VideoArray.cc Wavelet/NTree.cc \ Wavelet/W*/*.h Wavelet/W*/*.hh Wavelet/wavelet$A Wavelet/tools/*$E Wavelet/man/*.1 Wavelet/images/*.* Wavelet/test/*$E Wavelet/test/*.ppm \ Wavelet/test/*.pgm Wavelet/test/*.raw Wavelet/test/*.pfi move ../$@ . wavelet$A: $(OBJS) $(AR) $(ARFLAGS)$@ $(OBJS) clean: -del $(OBJS) Wave\\*~ *~ wavelet$A Wavelet-$(VERSION)-win32-bin.tar.gz -cd test & $(MAKE) -nologo -f Makefile.msc clean -cd tools & $(MAKE) -nologo -f Makefile.msc clean # # Automatic targets and rules: # .SUFFIXES: $O .cc .cc$O: $(CXX) -c $(CXXFLAGS) $< .c$O: $(CXX) -c $(CFLAGS) $< \ No newline at end of file --- 1 ---- ! # # MSC Makefile for Wave -- (c) 2002 by Herbert # # This Makefile is used for creating object files with the -MDd switch # to avoid library conflicts when using it in MFC apps. # # No dependency checking done! # SHELL = cmd.exe /c # # The program's main version... # VERSION = 0.9a MAJOR = 0 # # tools used for compiling / installing... # CXX = cl -nologo AR = lib O = .obj E = .exe A = .lib # # Name of target object files: # OBJ1 = debug$O tools$O avilib$O OBJ2 = ImageVector$O RowVector$O ColumnVector$O FullVector$O OBJ3 = GreymapFile$O GreymapReader$O GreymapWriter$O PgmReader$O PgmWriter$O OBJ4 = RawReader$O RawWriter$O FileName$O Image$O StillImage$O ppmlib$O OBJ5 = ColorImage$O PixmapFile$O PixmapReader$O PixmapWriter$O PpmReader$O OBJ6 = PpmWriter$O CoeffInformation$O PyramidTree$O ColorBuffer$O OBJ7 = Wavelet$O WaveletTransform$O PyramidTransform$O StandardTransform$O OBJ8 = Filter$O VectorPosition$O MirrorPosition$O PeriodicPosition$O OBJ9 = ImageInformation$O ImageComparison$O Histogram$O ImageDenoiser$O OBJA = VideoFrame$O ColorVideo$O VideoFile$O VideoReader$O VidReader$O OBJB = VideoWriter$O VidWriter$O AviReader$O AviWriter$O ImageResizer$O JPEG0 = JpgReader$O JpgWriter$O LIBS = .PHONY: all clean _test _tools tar zip # # Main target and file dependencies: # all: wavelet$A # # Flags passed to the compiler # CPPFLAGS = -I. -I../vc6/include -DJPEG -I../jpeg-6b CXXDEBUG = -DDPRINTF="" CXXOPT = -Ox CFLAGS = $(CXXDEBUG) $(CPPFLAGS) $(CXXOPT) -W3 -WX CXXFLAGS = $(CFLAGS) -TP -GX -GR -MDd # # Flags passed to the lib utility # ARFLAGS = /nologo /out: # # Automatic stuff, should not be changed: # OBJS = $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(OBJ7) $(OBJ8) \ $(OBJ9) $(OBJA) $(OBJB) $(JPEGO) # # rules: # zip: Wavelet-$(VERSION)-win32-bin.zip Wavelet-$(VERSION)-win32-bin.zip: $(MAKE) all _test -f Makefile.msc cd .. & zip $@ Wavelet/*.h Wavelet/*.hh Wavelet/COPYING \ Wavelet/INSTALL Wavelet/README Wavelet/INSTALL.W32 Wavelet/ChangeLog \ Wavelet/ImageArray.cc Wavelet/VideoArray.cc Wavelet/NTree.cc \ Wavelet/W*/*.h Wavelet/W*/*.hh Wavelet/wavelet$A Wavelet/tools/*$E Wavelet/man/*.1 Wavelet/images/*.* Wavelet/test/*$E \ Wavelet/test/*.ppm Wavelet/test/*.pgm Wavelet/test/*.raw \ Wavelet/test/*.pfi move ..\\$@ . tar: Wavelet-$(VERSION)-win32-bin.tar.gz Wavelet-$(VERSION)-win32-bin.tar.gz: $(MAKE) all _test -f Makefile.msc cd .. & tar -czvpf $@ Wavelet/*.h Wavelet/*.hh Wavelet/COPYING \ Wavelet/INSTALL Wavelet/README Wavelet/INSTALL.W32 Wavelet/ChangeLog \ Wavelet/ImageArray.cc Wavelet/VideoArray.cc Wavelet/NTree.cc \ Wavelet/W*/*.h Wavelet/W*/*.hh Wavelet/wavelet$A Wavelet/tools/*$E Wavelet/man/*.1 Wavelet/images/*.* Wavelet/test/*$E Wavelet/test/*.ppm \ Wavelet/test/*.pgm Wavelet/test/*.raw Wavelet/test/*.pfi move ../$@ . wavelet$A: $(OBJS) $(AR) $(ARFLAGS)$@ $(OBJS) clean: -del $(OBJS) Wave\\*~ *~ wavelet$A Wavelet-$(VERSION)-win32-bin.tar.gz -cd test & $(MAKE) -nologo -f Makefile.msc clean -cd tools & $(MAKE) -nologo -f Makefile.msc clean # # Automatic targets and rules: # .SUFFIXES: $O .cc .cc$O: $(CXX) -c $(CXXFLAGS) $< .c$O: $(CXX) -c $(CFLAGS) $< \ No newline at end of file Index: Wavelet.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Wavelet.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Wavelet.cc 10 Aug 2005 09:35:23 -0000 1.4 --- Wavelet.cc 7 Aug 2007 17:00:59 -0000 1.5 *************** *** 9,13 **** //#undef DPRINTF ! #include <stdio.h> #ifndef _WIN32_WCE #include <iostream> --- 9,13 ---- //#undef DPRINTF ! #include <cstdio> #ifndef _WIN32_WCE #include <iostream> *************** *** 15,20 **** #endif #include <stdexcept> ! #include <assert.h> ! #include <math.h> #include "Wave/Wavelet.hh" #include "Wave/MirrorPosition.hh" --- 15,20 ---- #endif #include <stdexcept> ! #include <cassert> ! #include <cmath> #include "Wave/Wavelet.hh" #include "Wave/MirrorPosition.hh" Index: JpgWriter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/JpgWriter.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JpgWriter.cc 8 Mar 2006 17:14:57 -0000 1.3 --- JpgWriter.cc 7 Aug 2007 17:00:58 -0000 1.4 *************** *** 10,14 **** #include "WImage/debug.h" #include "WImage/tools.h" ! #include <stdio.h> extern "C" { #include <jpeglib.h> --- 10,14 ---- #include "WImage/debug.h" #include "WImage/tools.h" ! #include <cstdio> extern "C" { #include <jpeglib.h> Index: NTree.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/NTree.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NTree.cc 22 Mar 2005 17:28:20 -0000 1.4 --- NTree.cc 7 Aug 2007 17:00:58 -0000 1.5 *************** *** 11,15 **** #include "WTools/NTree.hh" ! #include <assert.h> #ifdef _WIN32_WCE #include "WImage/miscdefs.h" --- 11,15 ---- #include "WTools/NTree.hh" ! #include <cassert> #ifdef _WIN32_WCE #include "WImage/miscdefs.h" Index: PgmWriter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PgmWriter.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PgmWriter.cc 8 Mar 2006 17:14:57 -0000 1.2 --- PgmWriter.cc 7 Aug 2007 17:00:58 -0000 1.3 *************** *** 9,13 **** #include "WImage/PgmWriter.hh" #include "WImage/debug.h" ! #include <stdio.h> int --- 9,13 ---- #include "WImage/PgmWriter.hh" #include "WImage/debug.h" ! #include <cstdio> int Index: AviWriter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/AviWriter.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AviWriter.cc 8 Mar 2006 17:14:57 -0000 1.7 --- AviWriter.cc 7 Aug 2007 17:00:58 -0000 1.8 *************** *** 10,14 **** #include "WImage/debug.h" #include "WImage/tools.h" ! #include <stdio.h> #include <iostream> --- 10,14 ---- #include "WImage/debug.h" #include "WImage/tools.h" ! #include <cstdio> #include <iostream> Index: ColorVideo.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ColorVideo.cc,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ColorVideo.cc 8 Mar 2006 17:14:57 -0000 1.15 --- ColorVideo.cc 7 Aug 2007 17:00:58 -0000 1.16 *************** *** 22,26 **** #include <iostream> #endif ! #include <assert.h> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) --- 22,26 ---- #include <iostream> #endif ! #include <cassert> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) Index: VidReader.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/VidReader.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** VidReader.cc 8 Mar 2006 17:14:57 -0000 1.7 --- VidReader.cc 7 Aug 2007 17:00:59 -0000 1.8 *************** *** 11,15 **** #include "WImage/debug.h" #include "WImage/tools.h" ! #include <stdio.h> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) --- 11,15 ---- #include "WImage/debug.h" #include "WImage/tools.h" ! #include <cstdio> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) Index: Image.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Image.cc,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Image.cc 15 Aug 2005 10:18:08 -0000 1.23 --- Image.cc 7 Aug 2007 17:00:58 -0000 1.24 *************** *** 13,19 **** #undef DELETE #endif ! #include <assert.h> ! #include <math.h> ! #include <stdlib.h> #include <stdexcept> #ifndef _WIN32_WCE --- 13,19 ---- #undef DELETE #endif [...1129 lines suppressed...] assert (alpha <= 1); --- 1232,1236 ---- // .. coeff alpha; ! alpha = (px - (int)px); assert (alpha <= 1); *************** *** 1177,1181 **** v1 = img.at (iy, (int)px); v2 = img.at (iy, px1); ! return (v2 - v1) * alpha + v1; } --- 1240,1244 ---- v1 = img.at (iy, (int)px); v2 = img.at (iy, px1); ! return (v2 - v1) * alpha + v1; } Index: Makefile.watcomc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Makefile.watcomc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.watcomc 25 Mar 2005 09:55:48 -0000 1.7 --- Makefile.watcomc 7 Aug 2007 17:00:58 -0000 1.8 *************** *** 15,19 **** PyramidTree$O ImageDenoiser$O VideoFrame$O ColorVideo$O & VideoFile$O VideoReader$O VidReader$O VideoWriter$O VidWriter$O & ! AviReader$O AviWriter$O TARGET = wavelet$A --- 15,19 ---- PyramidTree$O ImageDenoiser$O VideoFrame$O ColorVideo$O & VideoFile$O VideoReader$O VidReader$O VideoWriter$O VidWriter$O & ! AviReader$O AviWriter$O ImageResizer$O TARGET = wavelet$A *************** *** 67,77 **** ARCHIVE = Wavelet/*.h Wavelet/*.hh Wavelet/COPYING Wavelet/INSTALL & ! Wavelet/README Wavelet/INSTALL.W32 Wavelet/ChangeLog & Wavelet/ImageArray.cc Wavelet/VideoArray.cc Wavelet/NTree.cc & ! Wavelet/WImage/*.h Wavelet/Wave/*.hh Wavelet/WImage/*.hh & ! Wavelet/WTools/*.hh Wavelet/wavelet$A Wavelet/tools/*$E & ! Wavelet/man/*.1 Wavelet/images/*.* Wavelet/test/*$E & ! Wavelet/test/*.ppm Wavelet/test/*.pgm Wavelet/test/*.raw & ! Wavelet/test/*.pfi Wavelet-$(VERSION)-watcom-bin.zip: --- 67,77 ---- ARCHIVE = Wavelet/*.h Wavelet/*.hh Wavelet/COPYING Wavelet/INSTALL & ! Wavelet/README Wavelet/INSTALL.W32 Wavelet/ChangeLog & Wavelet/ImageArray.cc Wavelet/VideoArray.cc Wavelet/NTree.cc & ! Wavelet/WImage/*.h Wavelet/Wave/*.hh Wavelet/WImage/*.hh & ! Wavelet/WTools/*.hh Wavelet/wavelet$A Wavelet/tools/*$E & ! Wavelet/man/*.1 Wavelet/images/*.* Wavelet/test/*$E & ! Wavelet/test/*.ppm Wavelet/test/*.pgm Wavelet/test/*.raw & ! Wavelet/test/*.pfi Wavelet-$(VERSION)-watcom-bin.zip: Index: CoeffInformation.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/CoeffInformation.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CoeffInformation.cc 10 Aug 2005 09:35:23 -0000 1.4 --- CoeffInformation.cc 7 Aug 2007 17:00:58 -0000 1.5 *************** *** 8,12 **** #include "WImage/CoeffInformation.hh" ! #include <math.h> #ifndef _WIN32_WCE #include <fstream> --- 8,12 ---- #include "WImage/CoeffInformation.hh" ! #include <cmath> #ifndef _WIN32_WCE #include <fstream> Index: PfcWriter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PfcWriter.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PfcWriter.cc 10 Aug 2005 09:35:23 -0000 1.4 --- PfcWriter.cc 7 Aug 2007 17:00:58 -0000 1.5 *************** *** 9,13 **** #include "WImage/PfcWriter.hh" #include "WImage/debug.h" ! #include <stdio.h> #include <pfi.h> --- 9,13 ---- #include "WImage/PfcWriter.hh" #include "WImage/debug.h" ! #include <cstdio> #include <pfi.h> Index: PyramidTree.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PyramidTree.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyramidTree.cc 18 Feb 2005 12:12:24 -0000 1.4 --- PyramidTree.cc 7 Aug 2007 17:00:59 -0000 1.5 *************** *** 8,12 **** #include "WTools/PyramidTree.hh" ! #include <assert.h> PyramidTree::PyramidTree (PyramidTransform &t, int y, int x, int position, --- 8,12 ---- #include "WTools/PyramidTree.hh" ! #include <cassert> PyramidTree::PyramidTree (PyramidTransform &t, int y, int x, int position, Index: ppmlib.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ppmlib.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ppmlib.cc 8 Mar 2006 17:14:57 -0000 1.4 --- ppmlib.cc 7 Aug 2007 17:00:59 -0000 1.5 *************** *** 9,14 **** #include "ppmlib.h" #include "WImage/miscdefs.h" ! #include <ctype.h> ! #include <assert.h> static int --- 9,14 ---- #include "ppmlib.h" #include "WImage/miscdefs.h" ! #include <cctype> ! #include <cassert> static int Index: GreymapWriter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/GreymapWriter.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GreymapWriter.cc 22 May 2007 14:55:44 -0000 1.3 --- GreymapWriter.cc 7 Aug 2007 17:00:58 -0000 1.4 *************** *** 12,21 **** #include "WImage/debug.h" #include "WImage/tools.h" ! #include <math.h> #include <iostream> #include <stdexcept> #include <fstream> ! #include <assert.h> ! #include <float.h> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) --- 12,21 ---- #include "WImage/debug.h" #include "WImage/tools.h" ! #include <cmath> #include <iostream> #include <stdexcept> #include <fstream> ! #include <cassert> ! #include <cfloat> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) Index: configure =================================================================== RCS file: /cvsroot/wavelet/Wavelet/configure,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configure 8 Dec 2004 11:53:01 -0000 1.2 --- configure 7 Aug 2007 17:00:59 -0000 1.3 *************** *** 1,7 **** #! /bin/sh # Guess values for system-dependent variables and create Makefiles. ! # Generated by GNU Autoconf 2.59. # ! # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. --- 1,8 ---- #! /bin/sh # Guess values for system-dependent variables and create Makefiles. [...8267 lines suppressed...] ! { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' ! which seems to be undefined. Please make sure it is defined." >&5 ! echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' ! which seems to be undefined. Please make sure it is defined." >&2;} ! ! rm -f "$tmp/stdin" ! case $ac_file in ! -) cat "$tmp/out"; rm -f "$tmp/out";; ! *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; ! esac ! ;; ! ! ! ! esac ! ! done # for ac_tag { (exit 0); exit 0; } Index: JpgReader.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/JpgReader.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JpgReader.cc 8 Mar 2006 17:14:57 -0000 1.4 --- JpgReader.cc 7 Aug 2007 17:00:58 -0000 1.5 *************** *** 10,19 **** #include "WImage/JpgReader.hh" #include "WImage/debug.h" ! #include <stdio.h> extern "C" { #include <jpeglib.h> } #include <setjmp.h> ! #include <assert.h> #include <stdexcept> #include <iostream> --- 10,19 ---- #include "WImage/JpgReader.hh" #include "WImage/debug.h" ! #include <cstdio> extern "C" { #include <jpeglib.h> } #include <setjmp.h> ! #include <cassert> #include <stdexcept> #include <iostream> *************** *** 23,35 **** #endif ! static pixel *readJpegFile (FILE *inFile, int &ysize, int &xsize, int &channels); ! int JpgReader::readfmt (void) { FILE *inFile = NULL; ! ! int xsize = 0; int ysize = 0; int xysize = 0; --- 23,35 ---- #endif ! static pixel *readJpegFile (FILE *inFile, int &ysize, int &xsize, int &channels); ! int JpgReader::readfmt (void) { FILE *inFile = NULL; ! ! int xsize = 0; int ysize = 0; int xysize = 0; *************** *** 40,44 **** inFile = stdin; } ! else { /* --- 40,44 ---- inFile = stdin; } ! else { /* *************** *** 47,54 **** inFile = fopen (m_fname, "rb"); } ! /* initialization */ pixel * allpixels = readJpegFile (inFile, ysize, xsize, channels); ! if (channels != 3 && channels != 1) { --- 47,54 ---- inFile = fopen (m_fname, "rb"); } ! /* initialization */ pixel * allpixels = readJpegFile (inFile, ysize, xsize, channels); ! if (channels != 3 && channels != 1) { *************** *** 71,75 **** "than initially expected."); } ! fclose (inFile); if (allpixels == NULL) --- 71,75 ---- "than initially expected."); } ! fclose (inFile); if (allpixels == NULL) *************** *** 78,82 **** } xysize = xsize * ysize; ! for (int i = 0; i < m_channels; i++) { --- 78,82 ---- } xysize = xsize * ysize; ! for (int i = 0; i < m_channels; i++) { *************** *** 86,90 **** } } ! /* import */ for (int i = 0; i < xysize; i++) --- 86,90 ---- } } ! /* import */ for (int i = 0; i < xysize; i++) *************** *** 98,102 **** /* cleanup */ DELETEAR (allpixels); ! return 0; } --- 98,102 ---- /* cleanup */ DELETEAR (allpixels); ! return 0; } *************** *** 104,108 **** /* * The following code is derived from the example.c file shipping with ! * the JPEG-lib distribution. */ --- 104,108 ---- /* * The following code is derived from the example.c file shipping with ! * the JPEG-lib distribution. */ *************** *** 147,161 **** static pixel * ! readJpegFile (FILE *inFile, int &ysize, int &xsize, int &channels) { assert (inFile != NULL); ! ! /* * This struct contains the JPEG decompression parameters and pointers to * working space (which is allocated as needed by the JPEG library). */ struct jpeg_decompress_struct cinfo; ! /* * We use our private extension JPEG error handler. * Note that this struct must live as long as the main JPEG parameter --- 147,161 ---- static pixel * ! readJpegFile (FILE *inFile, int &ysize, int &xsize, int &channels) { assert (inFile != NULL); ! ! /* * This struct contains the JPEG decompression parameters and pointers to * working space (which is allocated as needed by the JPEG library). */ struct jpeg_decompress_struct cinfo; ! /* * We use our private extension JPEG error handler. * Note that this struct must live as long as the main JPEG parameter *************** *** 176,183 **** ret = NULL; /* Establish the setjmp return context for jpgErrorHandler to use. */ ! if (setjmp (jerr.setjmpBuffer)) { /* If we get here, the JPEG code has signaled an error. ! * We need to clean up the JPEG object, close the input file, and * return. */ jpeg_destroy_decompress (&cinfo); --- 176,183 ---- ret = NULL; /* Establish the setjmp return context for jpgErrorHandler to use. */ ! if (setjmp (jerr.setjmpBuffer)) { /* If we get here, the JPEG code has signaled an error. ! * We need to clean up the JPEG object, close the input file, and * return. */ jpeg_destroy_decompress (&cinfo); *************** *** 195,210 **** jpeg_stdio_src (&cinfo, inFile); ! /* ! * Step 3: read file parameters with jpeg_read_header() * * We can ignore the return value from jpeg_read_header since * (a) suspension is not possible with the stdio data source, and * (b) we passed TRUE to reject a tables-only JPEG file as an error. ! * See libjpeg.doc for more info. */ (void)jpeg_read_header (&cinfo, TRUE); ! /* ! * Step 4: set parameters for decompression * * In this example, we don't need to change any of the defaults set by --- 195,210 ---- jpeg_stdio_src (&cinfo, inFile); ! /* ! * Step 3: read file parameters with jpeg_read_header() * * We can ignore the return value from jpeg_read_header since * (a) suspension is not possible with the stdio data source, and * (b) we passed TRUE to reject a tables-only JPEG file as an error. ! * See libjpeg.doc for more info. */ (void)jpeg_read_header (&cinfo, TRUE); ! /* ! * Step 4: set parameters for decompression * * In this example, we don't need to change any of the defaults set by *************** *** 224,233 **** // << channels << ", size: " << xsize * ysize * channels << endl; ret = NEW (pixel [xsize * ysize * channels]); ! /* We may need to do some setup of our own at this point before reading * the data. After jpeg_start_decompress() we have the correct scaled * output image dimensions available, as well as the output colormap * if we asked for color quantization. ! * In this case, we need to make an output work buffer of the right size. */ /* JSAMPLEs per row in output buffer */ --- 224,233 ---- // << channels << ", size: " << xsize * ysize * channels << endl; ret = NEW (pixel [xsize * ysize * channels]); ! /* We may need to do some setup of our own at this point before reading * the data. After jpeg_start_decompress() we have the correct scaled * output image dimensions available, as well as the output colormap * if we asked for color quantization. ! * In this case, we need to make an output work buffer of the right size. */ /* JSAMPLEs per row in output buffer */ *************** *** 238,249 **** ((j_common_ptr) &cinfo, JPOOL_IMAGE, rowStride, 1); ! /* ! * Step 6: while (scan lines remain to be read) ! * jpeg_read_scanlines(...); */ /* Here we use the library's state variable cinfo.output_scanline as the * loop counter, so that we don't have to keep track ourselves. */ ! while (cinfo.output_scanline < cinfo.output_height) { /* jpeg_read_scanlines expects an array of pointers to scanlines. --- 238,249 ---- ((j_common_ptr) &cinfo, JPOOL_IMAGE, rowStride, 1); ! /* ! * Step 6: while (scan lines remain to be read) ! * jpeg_read_scanlines(...); */ /* Here we use the library's state variable cinfo.output_scanline as the * loop counter, so that we don't have to keep track ourselves. */ ! while (cinfo.output_scanline < cinfo.output_height) { /* jpeg_read_scanlines expects an array of pointers to scanlines. *************** *** 254,258 **** //cout << cinfo.output_scanline - 1 << " * " << rowStride << endl; /* Assume put_scanline_someplace wants a pointer and sample count. */ ! memcpy(&(ret[(cinfo.output_scanline - 1) * rowStride]), buffer[0], rowStride); //cout << "done" << endl; --- 254,258 ---- //cout << cinfo.output_scanline - 1 << " * " << rowStride << endl; /* Assume put_scanline_someplace wants a pointer and sample count. */ ! memcpy(&(ret[(cinfo.output_scanline - 1) * rowStride]), buffer[0], rowStride); //cout << "done" << endl; *************** *** 262,266 **** (void)jpeg_finish_decompress (&cinfo); ! /* * We can ignore the return value since suspension is not possible * with the stdio data source. --- 262,266 ---- (void)jpeg_finish_decompress (&cinfo); ! /* * We can ignore the return value since suspension is not possible * with the stdio data source. *************** *** 272,276 **** jpeg_destroy_decompress (&cinfo); ! /* * At this point you may want to check to see whether any corrupt-data * warnings occurred (test whether jerr.pub.num_warnings is nonzero). --- 272,276 ---- jpeg_destroy_decompress (&cinfo); ! /* * At this point you may want to check to see whether any corrupt-data * warnings occurred (test whether jerr.pub.num_warnings is nonzero). Index: Histogram.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Histogram.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Histogram.cc 10 Aug 2005 09:35:23 -0000 1.5 --- Histogram.cc 7 Aug 2007 17:00:58 -0000 1.6 *************** *** 12,17 **** #endif #include <stdexcept> ! #include <math.h> ! #include <assert.h> #ifndef _WIN32_WCE #include <iostream> --- 12,17 ---- #endif #include <stdexcept> ! #include <cmath> ! #include <cassert> #ifndef _WIN32_WCE #include <iostream> Index: VideoArray.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/VideoArray.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** VideoArray.cc 8 Apr 2005 08:17:46 -0000 1.5 --- VideoArray.cc 7 Aug 2007 17:00:59 -0000 1.6 *************** *** 18,22 **** #endif #include <stdexcept> ! #include <assert.h> #include "WImage/miscdefs.h" --- 18,22 ---- #endif #include <stdexcept> ! #include <cassert> #include "WImage/miscdefs.h" Index: wave_version.h =================================================================== RCS file: /cvsroot/wavelet/Wavelet/wave_version.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wave_version.h 15 Aug 2005 16:33:47 -0000 1.4 --- wave_version.h 7 Aug 2007 17:00:59 -0000 1.5 *************** *** 12,16 **** #define __VERSION_H ! #define WAVE_VERSION "1.1" #endif --- 12,16 ---- #define __VERSION_H ! #define WAVE_VERSION "1.2-cvs" #endif Index: PfcReader.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PfcReader.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PfcReader.cc 8 Mar 2006 17:14:57 -0000 1.6 --- PfcReader.cc 7 Aug 2007 17:00:58 -0000 1.7 *************** *** 11,15 **** #include "WImage/debug.h" #include <pfi.h> ! #include <stdio.h> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) --- 11,15 ---- #include "WImage/debug.h" #include <pfi.h> ! #include <cstdio> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) Index: AviReader.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/AviReader.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AviReader.cc 10 Aug 2005 09:35:23 -0000 1.5 --- AviReader.cc 7 Aug 2007 17:00:58 -0000 1.6 *************** *** 10,14 **** #include "WImage/AviReader.hh" #include "WImage/debug.h" ! #include <stdio.h> extern "C" { --- 10,14 ---- #include "WImage/AviReader.hh" #include "WImage/debug.h" ! #include <cstdio> extern "C" { Index: PixmapFile.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PixmapFile.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PixmapFile.cc 10 Aug 2005 09:35:23 -0000 1.3 --- PixmapFile.cc 7 Aug 2007 17:00:58 -0000 1.4 *************** *** 26,30 **** PixmapFile::~PixmapFile (void) { ! DELETE (m_images); } --- 26,30 ---- PixmapFile::~PixmapFile (void) { ! DELETEAR (m_images); } *************** *** 35,39 **** { m_images = NEW (Image* [m_channels]); ! for (int i = 0; i < m_channels; i++) { --- 35,39 ---- { m_images = NEW (Image* [m_channels]); ! for (int i = 0; i < m_channels; i++) { Index: debug.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/debug.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** debug.cc 18 Oct 2004 11:20:19 -0000 1.1 --- debug.cc 7 Aug 2007 17:00:59 -0000 1.2 *************** *** 9,14 **** //#if !defined (NDEBUG) && !defined (DPRINTF) #include "WImage/debug.h" ! #include <stdio.h> ! #include <stdarg.h> --- 9,14 ---- //#if !defined (NDEBUG) && !defined (DPRINTF) #include "WImage/debug.h" ! #include <cstdio> ! #include <cstdarg> Index: PfgWriter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PfgWriter.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PfgWriter.cc 10 Aug 2005 09:35:23 -0000 1.4 --- PfgWriter.cc 7 Aug 2007 17:00:58 -0000 1.5 *************** *** 9,13 **** #include "WImage/PfgWriter.hh" #include "WImage/debug.h" ! #include <stdio.h> #include <pfi.h> --- 9,13 ---- #include "WImage/PfgWriter.hh" #include "WImage/debug.h" ! #include <cstdio> #include <pfi.h> Index: ImageArray.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ImageArray.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ImageArray.cc 22 Mar 2005 17:28:20 -0000 1.6 --- ImageArray.cc 7 Aug 2007 17:00:58 -0000 1.7 *************** *** 53,57 **** { DELETENOTNULLAR (m_ar); ! DELETENOTNULL (m_rows); } --- 53,57 ---- { DELETENOTNULLAR (m_ar); ! DELETENOTNULLAR (m_rows); } Index: Makefile.msc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Makefile.msc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.msc 30 Nov 2004 16:39:05 -0000 1.8 --- Makefile.msc 7 Aug 2007 17:00:58 -0000 1.9 *************** *** 35,39 **** OBJ9 = ImageInformation$O ImageComparison$O Histogram$O ImageDenoiser$O OBJA = VideoFrame$O ColorVideo$O VideoFile$O VideoReader$O VidReader$O ! OBJB = VideoWriter$O VidWriter$O AviReader$O AviWriter$O JPEG0 = JpgReader$O JpgWriter$O !ifdef PFIDEF --- 35,39 ---- OBJ9 = ImageInformation$O ImageComparison$O Histogram$O ImageDenoiser$O OBJA = VideoFrame$O ColorVideo$O VideoFile$O VideoReader$O VidReader$O ! OBJB = VideoWriter$O VidWriter$O AviReader$O AviWriter$O ImageResizer$O JPEG0 = JpgReader$O JpgWriter$O !ifdef PFIDEF Index: PpmWriter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PpmWriter.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PpmWriter.cc 8 Mar 2006 17:14:57 -0000 1.4 --- PpmWriter.cc 7 Aug 2007 17:00:59 -0000 1.5 *************** *** 11,15 **** #include "WImage/tools.h" #include "ppmlib.h" ! #include <stdio.h> int --- 11,15 ---- #include "WImage/tools.h" #include "ppmlib.h" ! #include <cstdio> int Index: VideoFrame.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/VideoFrame.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VideoFrame.cc 10 Aug 2005 09:35:23 -0000 1.4 --- VideoFrame.cc 7 Aug 2007 17:00:59 -0000 1.5 *************** *** 26,31 **** #include <iostream> #endif ! #include <string.h> ! #include <assert.h> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) --- 26,31 ---- #include <iostream> #endif ! #include <cstring> ! #include <cassert> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) Index: ColorBuffer.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ColorBuffer.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ColorBuffer.cc 8 Mar 2006 17:14:57 -0000 1.8 --- ColorBuffer.cc 7 Aug 2007 17:00:58 -0000 1.9 *************** *** 15,22 **** #endif #include <stdexcept> ! #include <assert.h> #ifndef _WIN32_WCE #include <iostream> ! #include <stdio.h> #else #include "WImage/miscdefs.h" --- 15,22 ---- #endif #include <stdexcept> ! #include <cassert> #ifndef _WIN32_WCE #include <iostream> ! #include <cstdio> #else #include "WImage/miscdefs.h" *************** *** 28,32 **** ! ColorBuffer::ColorBuffer (int colors, clrmodel cmodel) { m_colors = 0; --- 28,32 ---- ! ColorBuffer::ColorBuffer (int colors, clrmodel cmodel) { m_colors = 0; *************** *** 40,44 **** destroy (); } ! void ColorBuffer::init (int colors, clrmodel cmodel) { --- 40,44 ---- destroy (); } ! void ColorBuffer::init (int colors, clrmodel cmodel) { *************** *** 49,53 **** { m_images = NEW (Image* [m_colors]); ! for (int i = 0; i < m_colors; i++) { --- 49,53 ---- { m_images = NEW (Image* [m_colors]); ! for (int i = 0; i < m_colors; i++) { *************** *** 62,66 **** #ifndef _WIN32_WCE ! int ColorBuffer::fileSize (char const *fname) const { --- 62,66 ---- #ifndef _WIN32_WCE ! int ColorBuffer::fileSize (char const *fname) const { *************** *** 87,92 **** } } ! DELETE (m_images); ! } } --- 87,92 ---- } } ! DELETEAR (m_images); ! } } *************** *** 103,107 **** } ! coeff ColorBuffer::averageColor (int fromY, int fromX, int toY, int toX) { --- 103,107 ---- } ! coeff ColorBuffer::averageColor (int fromY, int fromX, int toY, int toX) { *************** *** 114,118 **** } ! void ColorBuffer::colormodel (clrmodel model) { --- 114,118 ---- } ! void ColorBuffer::colormodel (clrmodel model) { *************** *** 127,131 **** } ! /* This is from * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html */ --- 127,131 ---- } ! /* This is from * http://www.neuro.sfc.keio.ac.jp/~aly/polygon/info/color-space-faq.html */ *************** *** 168,172 **** throw invalid_argument ("colormodel: unsupported format."); } ! coeff src[3]; coeff dest; --- 168,172 ---- throw invalid_argument ("colormodel: unsupported format."); } ! coeff src[3]; coeff dest; *************** *** 197,201 **** throw invalid_argument ("smin: empty image."); } ! coeff result = m_images[0]->smin (); for (int i = 1; i < m_colors; i++) --- 197,201 ---- throw invalid_argument ("smin: empty image."); } ! coeff result = m_images[0]->smin (); for (int i = 1; i < m_colors; i++) *************** *** 217,221 **** throw invalid_argument ("smax: empty image."); } ! coeff result = m_images[0]->smax (); for (int i = 1; i < m_colors; i++) --- 217,221 ---- throw invalid_argument ("smax: empty image."); } ! coeff result = m_images[0]->smax (); for (int i = 1; i < m_colors; i++) *************** *** 230,234 **** } ! void ColorBuffer::valadjust (void) { --- 230,234 ---- } ! void ColorBuffer::valadjust (void) { *************** *** 236,242 **** coeff cmax = smax (); coeff norm = 1.0; ! DPRINTF (("old max: %.2f, min: %.2f\n", cmax, cmin)); ! if (cmax - cmin > 255.0) { --- 236,242 ---- coeff cmax = smax (); coeff norm = 1.0; ! DPRINTF (("old max: %.2f, min: %.2f\n", cmax, cmin)); ! if (cmax - cmin > 255.0) { *************** *** 257,261 **** cmax = cmin = 0; } ! DPRINTF (("new max: %.2f, min: %.2f\n", cmax, cmin)); for (int i = 0; i < m_images[0]->size (); i++) --- 257,261 ---- cmax = cmin = 0; } ! DPRINTF (("new max: %.2f, min: %.2f\n", cmax, cmin)); for (int i = 0; i < m_images[0]->size (); i++) *************** *** 273,277 **** ! void ColorBuffer::truncate (coeff min, coeff max) { --- 273,277 ---- ! void ColorBuffer::truncate (coeff min, coeff max) { *************** *** 297,301 **** ColorBuffer::equals (ColorBuffer &buf) const { ! return this->epsilons (buf, COEFF_EPSILON); } --- 297,301 ---- ColorBuffer::equals (ColorBuffer &buf) const { ! return this->epsilons (buf, COEFF_EPSILON); ... [truncated message content] |