wavelet-commit Mailing List for Wavelet (Page 2)
Status: Beta
Brought to you by:
herbert
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(16) |
Aug
(16) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
|
Jul
|
Aug
(17) |
Sep
(3) |
Oct
|
Nov
|
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
|
Apr
(10) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
(2) |
Mar
|
Apr
(12) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
(3) |
Oct
(5) |
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
From: Herbert M. D. <he...@us...> - 2009-05-28 13:15:53
|
Update of /cvsroot/wavelet/Wavelet/WImage In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2712/WImage Modified Files: ColorImage.hh Image.hh Log Message: fixed bug in mirror extend function for resizing, added another fill strategy Index: Image.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage/Image.hh,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Image.hh 28 May 2009 09:07:13 -0000 1.21 --- Image.hh 28 May 2009 12:21:32 -0000 1.22 *************** *** 59,62 **** --- 59,68 ---- /** + * Enumeration on built-in extension functions (implementations of the + * ResizeFillFunc type above). + */ + enum ExtendFunc { ef_mirror, ef_outerBorder }; + + /** * An image (abstract). A (grey-scale) more-than-one-dimensional image. */ *************** *** 598,601 **** --- 604,608 ---- * given color or alternatively the resulting image will be smaller * than the target dimensions keeping its aspect ratio. + * This method is deprecad. Use the one with the enumeration ar instead. * @exception invalid_argument * the factor is negative or the function argument is invalid *************** *** 608,612 **** * @param function interpolation function (0: bilinear interpolation, * 1: average, 2: nearest neighbour). ! * @return a new rescaled image */ virtual Image *fitInto (int rows, int cols, bool mirrorExtend, int function = 0) const; --- 615,620 ---- * @param function interpolation function (0: bilinear interpolation, * 1: average, 2: nearest neighbour). ! * @return a new rescaled image ! */ virtual Image *fitInto (int rows, int cols, bool mirrorExtend, int function = 0) const; *************** *** 621,624 **** --- 629,651 ---- * @param rows the target number of rows * @param cols the target number of columns + * @param extend the type of extension function used if the aspect + * ratio does not match + * (else the a smaller image size will be chosen if the aspect ratio + * does not match) + * @param function interpolation function (0: bilinear interpolation, + * 1: average, 2: nearest neighbour). + * @return a new rescaled image */ + virtual Image *fitInto (int rows, int cols, ExtendFunc extend, + int function = 0) const; + + /** Produce a scaled version of the image which just fits into + * the given dimensions. If the aspect ratio does not fit into + * the new dimensions the remaining areas can be filled with a + * given color or alternatively the resulting image will be smaller + * than the target dimensions keeping its aspect ratio. + * @exception invalid_argument + * the factor is negative or the function argument is invalid + * @param rows the target number of rows + * @param cols the target number of columns * @param fillFunc if not NULL a function for filling otherwise empty regions * (else the a smaller image size will be chosen if the aspect ratio Index: ColorImage.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage/ColorImage.hh,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ColorImage.hh 12 Apr 2009 16:57:53 -0000 1.9 --- ColorImage.hh 28 May 2009 12:21:31 -0000 1.10 *************** *** 253,256 **** --- 253,275 ---- * @param rows the target number of rows * @param cols the target number of columns + * @param extend the type of extension function used if the aspect + * ratio does not match + * (else the a smaller image size will be chosen if the aspect ratio + * does not match) + * @param function interpolation function (0: bilinear interpolation, + * 1: average, 2: nearest neighbour). + * @return a new rescaled image */ + virtual ColorImage *fitInto (int rows, int cols, ExtendFunc extend, + int function = 0) const; + + /** Produce a scaled version of the image which just fits into + * the given dimensions. If the aspect ratio does not fit into + * the new dimensions the remaining areas can be filled with a + * given color or alternatively the resulting image will be smaller + * than the target dimensions keeping its aspect ratio. + * @exception invalid_argument + * the factor is negative or the function argument is invalid + * @param rows the target number of rows + * @param cols the target number of columns * @param fillFunc if not NULL a function for filling otherwise empty regions * (else the a smaller image size will be chosen if the aspect ratio |
From: Herbert M. D. <he...@us...> - 2009-05-28 13:15:31
|
Update of /cvsroot/wavelet/Wavelet In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv2712 Modified Files: ColorImage.cc Image.cc Log Message: fixed bug in mirror extend function for resizing, added another fill strategy Index: ColorImage.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ColorImage.cc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ColorImage.cc 13 Apr 2009 01:35:47 -0000 1.12 --- ColorImage.cc 28 May 2009 12:21:28 -0000 1.13 *************** *** 479,482 **** --- 479,496 ---- ColorImage * + ColorImage::fitInto (int rows, int cols, ExtendFunc extend, int function) const + { + Image **channels = NEW (Image* [m_colors]); + for (int i = 0; i < m_colors; i++) + { + channels[i] = m_images[i]->fitInto (rows, cols, extend, function); + } + ColorImage *ret = NEW (ColorImage (m_colors, m_cmodel, channels, + false, true)); + DELETEAR (channels); + return ret; + } + + ColorImage * ColorImage::fitInto (int rows, int cols, ResizeFillFunc *fillFunc, int function) const Index: Image.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Image.cc,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Image.cc 13 Apr 2009 19:29:38 -0000 1.31 --- Image.cc 28 May 2009 12:21:30 -0000 1.32 *************** *** 842,851 **** col = 2 * (xOffset + newCols - 1) - x; } ! if (row < 0 || row >= scaled.rows () || col < 0 || col >= scaled.cols ()) { return doit (scaled, factor, row, col, newRows, newCols, yOffset, xOffset); } - return g_calc[m_resizeFunc] (m_image, row - yOffset, col - xOffset, factor); } --- 842,851 ---- col = 2 * (xOffset + newCols - 1) - x; } ! if ((row - yOffset) < 0 || (row - yOffset) / factor >= m_image.rows () ! || (col - xOffset) < 0 || (col - xOffset) / factor >= m_image.cols ()) { return doit (scaled, factor, row, col, newRows, newCols, yOffset, xOffset); } return g_calc[m_resizeFunc] (m_image, row - yOffset, col - xOffset, factor); } *************** *** 854,857 **** --- 854,902 ---- }; + class OuterBorderFill : public ResizeFillFunc { + public: + OuterBorderFill (const Image &image) + : m_image (image) {} + virtual ~OuterBorderFill (void) {} + virtual coeff operator() (const Image &scaled, double factor, int y, int x, + int newRows, int newCols, + int yOffset, int xOffset) { + return doit (scaled, factor, y, x, newRows, newCols, yOffset, xOffset); + } + private: + virtual coeff doit (const Image &scaled, double factor, int y, int x, + int newRows, int newCols, int yOffset, int xOffset) { + int row; + int col; + + if (y < yOffset) + { + row = 0; + } + else if (y >= yOffset + newRows) + { + row = m_image.rows () - 1; + } + else + { + row = (int)((double)y / factor + 0.5); + } + if (x < xOffset) + { + col = 0; + } + else if (x >= xOffset + newCols) + { + col = m_image.cols () - 1; + } + else + { + col = (int)((double)x / factor + 0.5); + } + return m_image.at (row, col); + } + const Image &m_image; + }; + Image * *************** *** 870,873 **** --- 915,937 ---- Image * + Image::fitInto (int rows, int cols, ExtendFunc extend, int function) const + { + MirrorFill mirrorFunc (*this, function); + OuterBorderFill outerBorderFunc (*this); + switch (extend) + { + case ef_mirror: + return fitInto (rows, cols, &mirrorFunc, function); + break; + case ef_outerBorder: + return fitInto (rows, cols, &outerBorderFunc, function); + break; + default: + assert (0); + } + return NULL; + } + + Image * Image::fitInto (int rows, int cols, ResizeFillFunc *fillFunc, int function) const |
From: Herbert M. D. <he...@us...> - 2009-05-28 09:07:24
|
Update of /cvsroot/wavelet/Wavelet/WImage In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv3804/WImage Modified Files: Image.hh Log Message: added virtual destructor to Image::ResizeFunc Index: Image.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage/Image.hh,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Image.hh 12 Apr 2009 16:57:53 -0000 1.20 --- Image.hh 28 May 2009 09:07:13 -0000 1.21 *************** *** 32,35 **** --- 32,39 ---- public: /** + * Destructor, does nothing. + */ + virtual ~ResizeFillFunc (void) {} + /** * Calculate the falue for an otherwise empty position. * @param scaled |
From: Herbert M. D. <he...@us...> - 2009-04-13 19:29:48
|
Update of /cvsroot/wavelet/Wavelet/WTools In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19015/WTools Modified Files: ImageComparison.hh Log Message: Fixed a minor bug in the ColorImage's fitInto() method. Index: ImageComparison.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WTools/ImageComparison.hh,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ImageComparison.hh 12 Apr 2009 16:57:53 -0000 1.6 --- ImageComparison.hh 13 Apr 2009 19:29:38 -0000 1.7 *************** *** 12,15 **** --- 12,16 ---- #include "WImage/Image.hh" #include "Wave/Filter.hh" + #include "WTools/ImageInformation.hh" /** *************** *** 126,130 **** * the relative number of Wavelet coefficients to keep * @param flt ! * the filter to use */ static Image *truncateForLq (const Image &image, double percent, FilterSet &flt); --- 127,132 ---- * the relative number of Wavelet coefficients to keep * @param flt ! * the filter to use ! * @return an image of overall average and truncated coeffs */ static Image *truncateForLq (const Image &image, double percent, FilterSet &flt); *************** *** 136,142 **** * the absolute number of Wavelet coefficients to keep * @param flt ! * the filter to use */ static Image *truncateForLq (const Image &image, int nKeptCoeffs, FilterSet &flt); protected: /** Number of rows. */ --- 138,157 ---- * the absolute number of Wavelet coefficients to keep * @param flt ! * the filter to use ! * @return an image of overall average and truncated coeffs */ static Image *truncateForLq (const Image &image, int nKeptCoeffs, FilterSet &flt); + /** + * Calculates a feature vector for the $L^q$ and $L^qd$ metrics. + * @param image + * the image + * @param nKeptCoeffs + * the absolute number of Wavelet coefficients to keep + * @param flt + * the filter to use + * @return an image information of overall average the n most significant + * coeffs sorted by absolute */ + static ImageInformation *imageInfoForLq (const Image &image, + int nKeptCoeffs, FilterSet &flt); protected: /** Number of rows. */ |
From: Herbert M. D. <he...@us...> - 2009-04-13 19:29:43
|
Update of /cvsroot/wavelet/Wavelet In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19015 Modified Files: Image.cc ImageComparison.cc Log Message: Fixed a minor bug in the ColorImage's fitInto() method. Index: Image.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Image.cc,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Image.cc 12 Apr 2009 16:57:53 -0000 1.30 --- Image.cc 13 Apr 2009 19:29:38 -0000 1.31 *************** *** 859,863 **** { SimpleFill fillFunc (fill); ! return fitInto (rows, cols, &fillFunc, function); } --- 859,863 ---- { SimpleFill fillFunc (fill); ! return fitInto (rows, cols, fill < 0? NULL: &fillFunc, function); } Index: ImageComparison.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ImageComparison.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ImageComparison.cc 12 Apr 2009 16:57:53 -0000 1.9 --- ImageComparison.cc 13 Apr 2009 19:29:38 -0000 1.10 *************** *** 9,13 **** #include "Wave/StandardTransform.hh" #include "WTools/ImageComparison.hh" - #include "WTools/ImageInformation.hh" #ifdef _WIN32_WCE #undef DELETE --- 9,12 ---- *************** *** 37,41 **** } ! m_lqcachesize = MAX(m_ysize, m_xsize); m_lqcache = NEW (logvals [m_lqcachesize]); --- 36,40 ---- } ! m_lqcachesize = MAX (m_ysize, m_xsize); m_lqcache = NEW (logvals [m_lqcachesize]); *************** *** 284,285 **** --- 283,322 ---- return result; } + + ImageInformation * + ImageComparison::imageInfoForLq (const Image &image, + int nKeptCoeffs, FilterSet &flt) + { + + Image *tmp = image.clone (); + WaveletTransform *transform = NEW (StandardTransform (*tmp, flt)); + transform->analysis (0); + DELETE (transform); + + ImageInformation *ii = NEW (ImageInformation (*tmp)); + DELETE (tmp); + CoeffInformation atZero; + + bool found = false; + for (int i = 0; ! found && i < ii->size (); ++i) + { + // make sure there's nothing to truncate on the overall average + if (PII_YPOS (ii, i) == 0 && PII_XPOS (ii, i) == 0) + { + atZero = ii->at (i); + ii->at(i).val (0.0); + found = true; + } + } + + ii->asort (); + ii->shrink (nKeptCoeffs, false); + ImageInformation *result = new ImageInformation (nKeptCoeffs + 1); + result->to (atZero, 0); + for (int i = 0; i < nKeptCoeffs; ++i) + { + result->to (ii->at (i), i + 1); + } + DELETE (ii); + return result; + } |
From: Herbert M. D. <he...@us...> - 2009-04-13 02:15:39
|
Update of /cvsroot/wavelet/Wavelet/WImage In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15459/WImage Modified Files: ColorBuffer.hh Log Message: Fixed critical bug in ColorImage, ColorVideo, ColorBuffer: the size (rows * cols) was not always initialised properly, this could lead to crashes in some cases. Index: ColorBuffer.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage/ColorBuffer.hh,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ColorBuffer.hh 7 Aug 2007 17:01:00 -0000 1.7 --- ColorBuffer.hh 13 Apr 2009 01:35:47 -0000 1.8 *************** *** 24,32 **** public: /** Constructor. Creates objects and sets actual start values. * @param colors * the number of colors, and therefore the array's length * @param cmodel * the color model */ ! ColorBuffer (int colors = 3, clrmodel cmodel = cm_rgb); /** Destructor. Frees allocated objects. */ --- 24,34 ---- public: /** Constructor. Creates objects and sets actual start values. + * @param xysize + * the overall size of each channel (rows * cols) * @param colors * the number of colors, and therefore the array's length * @param cmodel * the color model */ ! ColorBuffer (int xysize, int colors = 3, clrmodel cmodel = cm_rgb); /** Destructor. Frees allocated objects. */ |
From: Herbert M. D. <he...@us...> - 2009-04-13 02:15:29
|
Update of /cvsroot/wavelet/Wavelet In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15459 Modified Files: ColorBuffer.cc ColorImage.cc ColorVideo.cc Log Message: Fixed critical bug in ColorImage, ColorVideo, ColorBuffer: the size (rows * cols) was not always initialised properly, this could lead to crashes in some cases. Index: ColorBuffer.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ColorBuffer.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ColorBuffer.cc 7 Aug 2007 17:00:58 -0000 1.9 --- ColorBuffer.cc 13 Apr 2009 01:35:47 -0000 1.10 *************** *** 28,33 **** ! ColorBuffer::ColorBuffer (int colors, clrmodel cmodel) { m_colors = 0; m_images = NULL; --- 28,34 ---- ! ColorBuffer::ColorBuffer (int xysize, int colors, clrmodel cmodel) { + this->m_xysize = xysize; m_colors = 0; m_images = NULL; Index: ColorImage.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ColorImage.cc,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ColorImage.cc 12 Apr 2009 16:57:53 -0000 1.11 --- ColorImage.cc 13 Apr 2009 01:35:47 -0000 1.12 *************** *** 50,54 **** ColorImage::ColorImage (int colors, clrmodel cmodel, Image **images, bool references, bool isMine) ! : ColorBuffer (colors, cmodel) { init (images, references, isMine); --- 50,54 ---- ColorImage::ColorImage (int colors, clrmodel cmodel, Image **images, bool references, bool isMine) ! : ColorBuffer (images == NULL? 0: images[0]->size (), colors, cmodel) { init (images, references, isMine); *************** *** 56,60 **** ColorImage::ColorImage (int rows, int cols, int colors, clrmodel cmodel) ! : ColorBuffer (colors, cmodel) { for (int i = 0; i < m_colors; i++) --- 56,60 ---- ColorImage::ColorImage (int rows, int cols, int colors, clrmodel cmodel) ! : ColorBuffer (rows * cols, colors, cmodel) { for (int i = 0; i < m_colors; i++) Index: ColorVideo.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ColorVideo.cc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ColorVideo.cc 7 Aug 2007 17:00:58 -0000 1.16 --- ColorVideo.cc 13 Apr 2009 01:35:47 -0000 1.17 *************** *** 30,34 **** ColorVideo::ColorVideo (const ColorVideo &cv) ! : ColorBuffer (cv.colors (), cv.colormodel ()) { m_arrays = NULL; --- 30,34 ---- ColorVideo::ColorVideo (const ColorVideo &cv) ! : ColorBuffer (cv.rows () * cv.cols (), cv.colors (), cv.colormodel ()) { m_arrays = NULL; *************** *** 50,54 **** ColorVideo::ColorVideo (int colors, clrmodel colormodel, int rows, int cols, ! int frames) : ColorBuffer (colors, colormodel) { m_frameRate = 0; --- 50,54 ---- ColorVideo::ColorVideo (int colors, clrmodel colormodel, int rows, int cols, ! int frames) : ColorBuffer (rows * cols, colors, colormodel) { m_frameRate = 0; *************** *** 58,62 **** } ! ColorVideo::ColorVideo (void) : ColorBuffer (0, cm_unknown) { m_frameRate = 0; --- 58,62 ---- } ! ColorVideo::ColorVideo (void) : ColorBuffer (0, 0, cm_unknown) { m_frameRate = 0; |
From: Herbert M. D. <he...@us...> - 2009-04-12 16:58:03
|
Update of /cvsroot/wavelet/Wavelet In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19809 Modified Files: ColorImage.cc Image.cc ImageComparison.cc Log Message: Added option for mirror extension when resizing an image using fitInto(), made method for calculating the Lq feature vector static in ImageComparison. Index: ImageComparison.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ImageComparison.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ImageComparison.cc 7 Aug 2007 17:00:58 -0000 1.8 --- ImageComparison.cc 12 Apr 2009 16:57:53 -0000 1.9 *************** *** 21,26 **** #endif - static void truncate_and_quantize (Image*, double); - ImageComparison::ImageComparison (const Image &img1, const Image &img2) { --- 21,24 ---- *************** *** 121,139 **** lq score = { 0.0, 0.0 }; - WaveletTransform *transforms[2]; Image *origs[2]; for (int i = 0; i < 2; i++) { ! origs[i] = m_images[i]->clone (); ! transforms[i] = NEW (StandardTransform (*m_images[i], flt)); ! transforms[i]->analysis (0); ! DELETE (transforms[i]); } score.colors = m_weights[type][0] * fabs (m_images[0]->at (0, 0) - m_images[1]->at (0, 0)); - truncate_and_quantize (m_images[0], percent); - truncate_and_quantize (m_images[1], percent); /* create a normalized details measure */ --- 119,132 ---- lq score = { 0.0, 0.0 }; Image *origs[2]; for (int i = 0; i < 2; i++) { ! origs[i] = m_images[i]; ! m_images[i] = truncateForLq (*origs[i], percent, flt); } score.colors = m_weights[type][0] * fabs (m_images[0]->at (0, 0) - m_images[1]->at (0, 0)); /* create a normalized details measure */ *************** *** 145,149 **** m_images[i] = origs[i]; } ! return score; } --- 138,142 ---- m_images[i] = origs[i]; } ! return score; } *************** *** 154,171 **** double sum1, sum2; - WaveletTransform *transforms[2]; Image *origs[2]; for (int i = 0; i < 2; i++) { ! origs[i] = m_images[i]->clone (); ! transforms[i] = NEW (StandardTransform (*m_images[i], flt)); ! transforms[i]->analysis (0); ! DELETE (transforms[i]); } - truncate_and_quantize (m_images[0], percent); - truncate_and_quantize (m_images[1], percent); - sum1 = lq_sum (type, true, true); sum2 = lq_sum (type, false, true); --- 147,158 ---- double sum1, sum2; Image *origs[2]; for (int i = 0; i < 2; i++) { ! origs[i] = m_images[i]; ! m_images[i] = truncateForLq (*origs[i], percent, flt); } sum1 = lq_sum (type, true, true); sum2 = lq_sum (type, false, true); *************** *** 247,269 **** } ! static void ! truncate_and_quantize (Image *img, double percent) { CoeffInformation *ci = NULL; ! ImageInformation *ii = NEW (ImageInformation (*img)); ii->asort (); ! ii->shrink ((int)((double)(img->size () * percent) / 100.0), false); ! for (int i = 0; i < img->size (); i++) { ! img->to (i, 0.0); } ! for (int i = 0; i < ii->size (); i++) { ci = &ii->at (i); ! img->to (ci->ypos (), ci->xpos (), ci->val () > 0? 1: -1); } DELETE (ii); } --- 234,285 ---- } ! Image * ! ImageComparison::truncateForLq (const Image &image, double percent, ! FilterSet &flt) ! { ! int nKeptCoeffs = (int)((double)(image.size () * percent) / 100.0); ! return truncateForLq (image, nKeptCoeffs, flt); ! } ! ! Image * ! ImageComparison::truncateForLq (const Image &image, ! int nKeptCoeffs, FilterSet &flt) { + + Image *result = image.clone (); + WaveletTransform *transform = NEW (StandardTransform (*result, flt)); + transform->analysis (0); + DELETE (transform); + coeff overAverage = result->at (0, 0); + CoeffInformation *ci = NULL; ! ImageInformation *ii = NEW (ImageInformation (*result)); ! ! bool found = false; ! for (int i = 0; ! found && i < ii->size (); ++i) ! { ! // make sure there's nothing to truncate on the overall average ! if (PII_YPOS (ii, i) == 0 && PII_XPOS (ii, i) == 0) ! { ! ii->at(i).val (0.0); ! found = true; ! } ! } ii->asort (); ! ii->shrink (nKeptCoeffs + 1, false); ! for (int i = 0; i < result->size (); i++) { ! result->to (i, 0.0); } ! for (int i = 0; i < ii->size (); i++) { ci = &ii->at (i); ! result->to (ci->ypos (), ci->xpos (), ci->val () > 0? 1: -1); } DELETE (ii); + result->to (0, 0, overAverage); + return result; } Index: ColorImage.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ColorImage.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ColorImage.cc 24 Aug 2007 15:24:27 -0000 1.10 --- ColorImage.cc 12 Apr 2009 16:57:53 -0000 1.11 *************** *** 465,468 **** --- 465,497 ---- ColorImage * + ColorImage::fitInto (int rows, int cols, bool mirrorExtend, int function) const + { + Image **channels = NEW (Image* [m_colors]); + for (int i = 0; i < m_colors; i++) + { + channels[i] = m_images[i]->fitInto (rows, cols, mirrorExtend, function); + } + ColorImage *ret = NEW (ColorImage (m_colors, m_cmodel, channels, + false, true)); + DELETEAR (channels); + return ret; + } + + ColorImage * + ColorImage::fitInto (int rows, int cols, ResizeFillFunc *fillFunc, + int function) const + { + Image **channels = NEW (Image* [m_colors]); + for (int i = 0; i < m_colors; i++) + { + channels[i] = m_images[i]->fitInto (rows, cols, fillFunc, function); + } + ColorImage *ret = NEW (ColorImage (m_colors, m_cmodel, channels, + false, true)); + DELETEAR (channels); + return ret; + } + + ColorImage * ColorImage::scale (double factor, int function) const { Index: Image.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Image.cc,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Image.cc 23 Feb 2009 17:26:41 -0000 1.29 --- Image.cc 12 Apr 2009 16:57:53 -0000 1.30 *************** *** 796,802 **** --- 796,876 ---- } + class SimpleFill : public ResizeFillFunc { + public: + SimpleFill (int c) : m_coeff ((coeff)c) {} + virtual ~SimpleFill (void) {} + virtual coeff operator() (const Image &scaled, double factor, int y, int x, + int newRows, int newCols, + int yOffset, int xOffset) { + return m_coeff; + } + private: + coeff m_coeff; + }; + + + class MirrorFill : public ResizeFillFunc { + public: + MirrorFill (const Image &image, int resizeFunc) + : m_image (image), m_resizeFunc (resizeFunc) {} + virtual ~MirrorFill (void) {} + virtual coeff operator() (const Image &scaled, double factor, int y, int x, + int newRows, int newCols, + int yOffset, int xOffset) { + return doit (scaled, factor, y, x, newRows, newCols, yOffset, xOffset); + } + private: + virtual coeff doit (const Image &scaled, double factor, int y, int x, + int newRows, int newCols, int yOffset, int xOffset) { + int row = y; + int col = x; + + if (y < yOffset) + { + row = 2 * yOffset - y; + } + else if (y >= yOffset + newRows) + { + row = 2 * (yOffset + newRows - 1) - y; + } + if (x < xOffset) + { + col = 2 * xOffset - x; + } + else if (x >= xOffset + newCols) + { + col = 2 * (xOffset + newCols - 1) - x; + } + if (row < 0 || row >= scaled.rows () || col < 0 || col >= scaled.cols ()) + { + return doit (scaled, factor, row, col, + newRows, newCols, yOffset, xOffset); + } + + return g_calc[m_resizeFunc] (m_image, row - yOffset, col - xOffset, factor); + } + const Image &m_image; + int m_resizeFunc; + }; + + Image * Image::fitInto (int rows, int cols, int fill, int function) const { + SimpleFill fillFunc (fill); + return fitInto (rows, cols, &fillFunc, function); + } + + Image * + Image::fitInto (int rows, int cols, bool mirrorExtend, int function) const + { + MirrorFill fillFunc (*this, function); + return fitInto (rows, cols, mirrorExtend? &fillFunc : NULL, function); + } + + Image * + Image::fitInto (int rows, int cols, + ResizeFillFunc *fillFunc, int function) const + { checkCalcFuncArg (function); *************** *** 815,820 **** assert (scaleCols <= cols); ! int theRows = fill < 0? scaleRows: rows; ! int theCols = fill < 0? scaleCols: cols; int rowOffset = (theRows - scaleRows); --- 889,894 ---- assert (scaleCols <= cols); ! int theRows = fillFunc == NULL? scaleRows: rows; ! int theCols = fillFunc == NULL? scaleCols: cols; int rowOffset = (theRows - scaleRows); *************** *** 832,836 **** || x < colOffset || x >= scaleCols + colOffset) { ! image->to (y, x, (coeff)fill); } else --- 906,912 ---- || x < colOffset || x >= scaleCols + colOffset) { ! image->to (y, x, (*fillFunc) (*image, theFactor, y, x, ! scaleRows, scaleCols, ! rowOffset, colOffset)); } else |
From: Herbert M. D. <he...@us...> - 2009-04-12 16:57:58
|
Update of /cvsroot/wavelet/Wavelet/WImage In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19809/WImage Modified Files: ColorImage.hh Image.hh Log Message: Added option for mirror extension when resizing an image using fitInto(), made method for calculating the Lq feature vector static in ImageComparison. Index: Image.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage/Image.hh,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Image.hh 17 Apr 2008 07:27:35 -0000 1.19 --- Image.hh 12 Apr 2009 16:57:53 -0000 1.20 *************** *** 23,26 **** --- 23,57 ---- * @{ */ + class Image; + + /** + * An abstract functor for filling empty regions when resizing images. + */ + /* abstract */ + class ResizeFillFunc { + public: + /** + * Calculate the falue for an otherwise empty position. + * @param scaled + * the scaled image (yet to fill with values) + * @param factor + * the factor + * @param y + * the row in the image + * @param x + * the column in the image + * @param newRows + * the number of rows in the scaled image + * @param newCols + * the number of columns in the scaled image + * @param yOffset + * the empty region to the image's top (if any) + * @param xOffset + * the empty region to the image's left (if any) + */ + virtual coeff operator() (const Image &scaled, double factor, int y, int x, + int newY, int newX, int yOffset, int xOffset) = 0; + }; + /** * An image (abstract). A (grey-scale) more-than-one-dimensional image. *************** *** 558,561 **** --- 589,629 ---- int fill = -1, int function = 0) const; + /** Produce a scaled version of the image which just fits into + * the given dimensions. If the aspect ratio does not fit into + * the new dimensions the remaining areas can be filled with a + * given color or alternatively the resulting image will be smaller + * than the target dimensions keeping its aspect ratio. + * @exception invalid_argument + * the factor is negative or the function argument is invalid + * @param rows the target number of rows + * @param cols the target number of columns + * @param mirrorExtend if true, the otherwise empty regions of the image + * are extended by a mirroring function + * (else the a smaller image size will be chosen if the aspect ratio + * does not match) + * @param function interpolation function (0: bilinear interpolation, + * 1: average, 2: nearest neighbour). + * @return a new rescaled image */ + virtual Image *fitInto (int rows, int cols, bool mirrorExtend, + int function = 0) const; + + /** Produce a scaled version of the image which just fits into + * the given dimensions. If the aspect ratio does not fit into + * the new dimensions the remaining areas can be filled with a + * given color or alternatively the resulting image will be smaller + * than the target dimensions keeping its aspect ratio. + * @exception invalid_argument + * the factor is negative or the function argument is invalid + * @param rows the target number of rows + * @param cols the target number of columns + * @param fillFunc if not NULL a function for filling otherwise empty regions + * (else the a smaller image size will be chosen if the aspect ratio + * does not match) + * @param function interpolation function (0: bilinear interpolation, + * 1: average, 2: nearest neighbour). + * @return a new rescaled image */ + virtual Image *fitInto (int rows, int cols, ResizeFillFunc *fillFunc, + int function = 0) const; + /** Produce a scaled version of the image. The aspect ratio will remain * the same. Index: ColorImage.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage/ColorImage.hh,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ColorImage.hh 17 Apr 2008 07:27:35 -0000 1.8 --- ColorImage.hh 12 Apr 2009 16:57:53 -0000 1.9 *************** *** 225,228 **** --- 225,265 ---- int *fill = NULL, int function = 0) const; + /** Produce a scaled version of the image which just fits into + * the given dimensions. If the aspect ratio does not fit into + * the new dimensions the remaining areas can be filled with a + * given color or alternatively the resulting image will be smaller + * than the target dimensions keeping its aspect ratio. + * @exception invalid_argument + * the factor is negative or the function argument is invalid + * @param rows the target number of rows + * @param cols the target number of columns + * @param mirrorExtend if true, the otherwise empty regions of the image + * are extended by a mirroring function + * (else the a smaller image size will be chosen if the aspect ratio + * does not match) + * @param function interpolation function (0: bilinear interpolation, + * 1: average, 2: nearest neighbour). + * @return a new rescaled image */ + virtual ColorImage *fitInto (int rows, int cols, bool mirrorExtend, + int function = 0) const; + + /** Produce a scaled version of the image which just fits into + * the given dimensions. If the aspect ratio does not fit into + * the new dimensions the remaining areas can be filled with a + * given color or alternatively the resulting image will be smaller + * than the target dimensions keeping its aspect ratio. + * @exception invalid_argument + * the factor is negative or the function argument is invalid + * @param rows the target number of rows + * @param cols the target number of columns + * @param fillFunc if not NULL a function for filling otherwise empty regions + * (else the a smaller image size will be chosen if the aspect ratio + * does not match) + * @param function interpolation function (0: bilinear interpolation, + * 1: average, 2: nearest neighbour). + * @return a new rescaled image */ + virtual ColorImage *fitInto (int rows, int cols, ResizeFillFunc *fillFunc, + int function = 0) const; + /** Produce a scaled version of the image. The aspect ratio will remain * the same. |
From: Herbert M. D. <he...@us...> - 2009-04-12 16:57:58
|
Update of /cvsroot/wavelet/Wavelet/WTools In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19809/WTools Modified Files: ImageComparison.hh Log Message: Added option for mirror extension when resizing an image using fitInto(), made method for calculating the Lq feature vector static in ImageComparison. Index: ImageComparison.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WTools/ImageComparison.hh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ImageComparison.hh 7 Aug 2007 17:01:00 -0000 1.5 --- ImageComparison.hh 12 Apr 2009 16:57:53 -0000 1.6 *************** *** 119,122 **** --- 119,142 ---- double distlqd (double percent, FilterSet &flt, imgtype type); + /** + * Calculates a feature vector for the $L^q$ and $L^qd$ metrics. + * @param image + * the image + * @param percent + * the relative number of Wavelet coefficients to keep + * @param flt + * the filter to use */ + static Image *truncateForLq (const Image &image, + double percent, FilterSet &flt); + /** + * Calculates a feature vector for the $L^q$ and $L^qd$ metrics. + * @param image + * the image + * @param nKeptCoeffs + * the absolute number of Wavelet coefficients to keep + * @param flt + * the filter to use */ + static Image *truncateForLq (const Image &image, + int nKeptCoeffs, FilterSet &flt); protected: /** Number of rows. */ |
From: Herbert M. D. <he...@us...> - 2009-04-08 19:50:12
|
Update of /cvsroot/wavelet/Wavelet In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv32379 Modified Files: FileName.cc Log Message: added mimetype guessing function to filetype class Index: FileName.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/FileName.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FileName.cc 8 Apr 2009 19:34:47 -0000 1.8 --- FileName.cc 8 Apr 2009 19:49:56 -0000 1.9 *************** *** 164,165 **** --- 164,190 ---- } + const char * + FileName::guessedMimeType (void) const + { + switch (m_ftype) + { + case fn_pgm: + return "image/x-portable-graymap"; + case fn_ppm: + return "image/x-portable-pixmap"; + case fn_jpg: + return "image/jpeg"; + break; + case fn_png: + return "image/png"; + break; + case fn_gif: + return "image/gif"; + break; + case fn_avi: + return "video/x-msvideo"; + default: + return ""; + } + } + |
From: Herbert M. D. <he...@us...> - 2009-04-08 19:50:02
|
Update of /cvsroot/wavelet/Wavelet/WImage In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv32379/WImage Modified Files: FileName.hh Log Message: added mimetype guessing function to filetype class Index: FileName.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage/FileName.hh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileName.hh 8 Apr 2009 19:34:48 -0000 1.5 --- FileName.hh 8 Apr 2009 19:49:56 -0000 1.6 *************** *** 58,61 **** --- 58,65 ---- * the file type */ inline filetype guess (void) const { return m_ftype; } + /** Return a mime type for the guessed type. + * @return + * the mime type, empty string if none was found */ + const char * guessedMimeType (void) const; /** Return the file name. * @return |
From: Herbert M. D. <he...@us...> - 2009-04-08 19:35:01
|
Update of /cvsroot/wavelet/Wavelet/test In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31376/test Modified Files: filename.cc histogram.cc image.cc imagearray.cc imagefile.cc ntree.cc vectors.cc videos.cc Log Message: some more correct includes in test files, added symbolic names for png and gif file types Index: ntree.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/ntree.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ntree.cc 10 Aug 2005 09:35:23 -0000 1.5 --- ntree.cc 8 Apr 2009 19:34:48 -0000 1.6 *************** *** 11,14 **** --- 11,16 ---- #endif /* NDEBUG */ + #include <cstring> + #include "WTools/PyramidTree.hh" #include "WImage/StillImage.hh" Index: imagefile.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/imagefile.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** imagefile.cc 7 Aug 2007 17:01:00 -0000 1.4 --- imagefile.cc 8 Apr 2009 19:34:48 -0000 1.5 *************** *** 17,20 **** --- 17,22 ---- #include <cmath> + #include <cstring> + #include <cstdlib> #include <cassert> #include <iostream> Index: videos.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/videos.cc,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** videos.cc 17 Apr 2008 07:27:36 -0000 1.11 --- videos.cc 8 Apr 2009 19:34:48 -0000 1.12 *************** *** 20,23 **** --- 20,24 ---- #include <iomanip> #include <cmath> + #include <cstring> #include "WImage/debug.h" #include "WImage/VideoFrame.hh" Index: image.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/image.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** image.cc 7 Aug 2007 17:01:00 -0000 1.6 --- image.cc 8 Apr 2009 19:34:48 -0000 1.7 *************** *** 17,20 **** --- 17,21 ---- #include <cmath> #include <cfloat> + #include <cstring> #include "WImage/StillImage.hh" Index: imagearray.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/imagearray.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** imagearray.cc 7 Aug 2007 17:01:00 -0000 1.5 --- imagearray.cc 8 Apr 2009 19:34:48 -0000 1.6 *************** *** 17,20 **** --- 17,21 ---- #include <cassert> + #include <cstring> #include <iostream> #include <iomanip> Index: filename.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/filename.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** filename.cc 7 Aug 2007 17:01:00 -0000 1.5 --- filename.cc 8 Apr 2009 19:34:48 -0000 1.6 *************** *** 14,17 **** --- 14,18 ---- #include "WImage/miscdefs.h" #include <cassert> + #include <cstring> #include <iostream> Index: histogram.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/histogram.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** histogram.cc 7 Aug 2007 17:01:00 -0000 1.4 --- histogram.cc 8 Apr 2009 19:34:48 -0000 1.5 *************** *** 14,17 **** --- 14,18 ---- #include "WImage/StillImage.hh" #include <cassert> + #include <cstring> #include <iostream> #include <iomanip> Index: vectors.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/vectors.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** vectors.cc 7 Aug 2007 17:01:00 -0000 1.4 --- vectors.cc 8 Apr 2009 19:34:48 -0000 1.5 *************** *** 17,20 **** --- 17,21 ---- #include <cassert> + #include <cstring> #include <iostream> #include <iomanip> |
From: Herbert M. D. <he...@us...> - 2009-04-08 19:34:53
|
Update of /cvsroot/wavelet/Wavelet/WImage In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31376/WImage Modified Files: FileName.hh Log Message: some more correct includes in test files, added symbolic names for png and gif file types Index: FileName.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage/FileName.hh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FileName.hh 12 Jul 2005 14:52:18 -0000 1.4 --- FileName.hh 8 Apr 2009 19:34:48 -0000 1.5 *************** *** 19,23 **** typedef enum { fn_pgm, fn_raw, fn_pfi, fn_ppm, fn_jpg, ! fn_vid, fn_avi, fn_unknown } filetype; --- 19,23 ---- typedef enum { fn_pgm, fn_raw, fn_pfi, fn_ppm, fn_jpg, ! fn_vid, fn_avi, fn_png, fn_gif, fn_unknown } filetype; |
From: Herbert M. D. <he...@us...> - 2009-04-08 19:34:53
|
Update of /cvsroot/wavelet/Wavelet In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31376 Modified Files: FileName.cc Log Message: some more correct includes in test files, added symbolic names for png and gif file types Index: FileName.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/FileName.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FileName.cc 7 Aug 2007 17:00:58 -0000 1.7 --- FileName.cc 8 Apr 2009 19:34:47 -0000 1.8 *************** *** 126,129 **** --- 126,137 ---- m_ftype = fn_avi; } + else if (isext (".png")) + { + m_ftype = fn_png; + } + else if (isext (".gif")) + { + m_ftype = fn_png; + } else { |
From: Herbert M. D. <he...@us...> - 2009-02-23 17:26:48
|
Update of /cvsroot/wavelet/Wavelet In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8899 Modified Files: Image.cc JpgReader.cc MagickInter.cc tools.cc Log Message: sanified the temp file creation in MagickInter.cc Index: JpgReader.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/JpgReader.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JpgReader.cc 7 Aug 2007 17:00:58 -0000 1.5 --- JpgReader.cc 23 Feb 2009 17:26:41 -0000 1.6 *************** *** 18,21 **** --- 18,22 ---- #include <stdexcept> #include <iostream> + #include <cstring> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) Index: tools.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tools.cc 17 Apr 2008 07:27:34 -0000 1.9 --- tools.cc 23 Feb 2009 17:26:41 -0000 1.10 *************** *** 37,41 **** tools_epsilons (double d1, double d2, double epsilon) { ! return !((d1 > d2) && (d1 - d2 > epsilon) || (d2 - d1 > epsilon)); } --- 37,41 ---- tools_epsilons (double d1, double d2, double epsilon) { ! return !(((d1 > d2) && (d1 - d2 > epsilon)) || (d2 - d1 > epsilon)); } Index: Image.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Image.cc,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Image.cc 17 Apr 2008 07:27:34 -0000 1.28 --- Image.cc 23 Feb 2009 17:26:41 -0000 1.29 *************** *** 418,422 **** bool lifted = false; ! if (lifted = (startH < 0)) { for (int y = yoffs; y < toY; y++) --- 418,422 ---- bool lifted = false; ! if ((lifted = (startH < 0))) { for (int y = yoffs; y < toY; y++) Index: MagickInter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/MagickInter.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MagickInter.cc 17 Apr 2008 07:27:34 -0000 1.1 --- MagickInter.cc 23 Feb 2009 17:26:41 -0000 1.2 *************** *** 12,15 **** --- 12,16 ---- #include <cstring> #include <iostream> + #include <cerrno> #include <Magick++/Image.h> #include <Magick++/Color.h> *************** *** 26,30 **** #include <fcntl.h> ! static int tempFileName (char *templ, const char *extension); static std::string --- 27,33 ---- #include <fcntl.h> ! static std::string tempFilePrefixFromEnv (std::string paddern, ! std::string delim); ! static int tempFileName (char *templ, const char *extension, unsigned int seed); static std::string *************** *** 34,41 **** static char buf[64] = { '\0' }; pid_t pid = getpid(); ! snprintf (buf, sizeof buf - 1, "util-tmp-%05d-XXXXXX", (int)pid); ! if (tempFileName (buf, theExtension.c_str ()) < 0) { ! throw std::invalid_argument ("Could not create temp file"); } return std::string (buf); --- 37,73 ---- static char buf[64] = { '\0' }; pid_t pid = getpid(); ! int rc = -1; ! std::string paddern = "wavelet-tmp-%05d-XXXXXX"; ! std::string paddernWithPrefix = tempFilePrefixFromEnv (paddern, "/"); ! unsigned seed = (unsigned)pid; ! ! if (paddernWithPrefix.size () > 0) { ! /* if we found a matching environment variable, then use it. */ ! snprintf (buf, sizeof buf - 1, paddernWithPrefix.c_str (), (int)pid); ! rc = tempFileName (buf, theExtension.c_str (), seed); ! } ! else ! { ! /* we found no matching environment variable, we try /tmp/ first. */ ! paddernWithPrefix = "/tmp/" + paddern; ! snprintf (buf, sizeof buf - 1, paddernWithPrefix.c_str (), (int)pid); ! rc = tempFileName (buf, theExtension.c_str (), seed); ! if (rc < 0) ! { ! snprintf (buf, sizeof buf - 1, paddern.c_str (), (int)pid); ! rc = tempFileName (buf, theExtension.c_str (), seed); ! } ! } ! ! ! if (rc < 0) ! { ! char ctemp[64]; ! snprintf(ctemp, sizeof ctemp, "%d", rc); ! throw std::invalid_argument ("Could not create temp file, rc: " ! + std::string(ctemp) + ", system error is: " ! + std::string (strerror (errno)).c_str () ! + ", could it be that the current directory is not writable?"); } return std::string (buf); *************** *** 319,323 **** // lib to depend on it... static int ! tempFileName (char *templ, const char *extension) { static char letters[] --- 351,355 ---- // lib to depend on it... static int ! tempFileName (char *templ, const char *extension, unsigned int seed) { static char letters[] *************** *** 328,332 **** int extenlen = strlen (extension); ! if(templen < 6) { return -1; --- 360,364 ---- int extenlen = strlen (extension); ! if (templen < 6) { return -1; *************** *** 340,344 **** } ! srand ((unsigned)time (NULL)); int fd; char *fname = NEW (char [templen + extenlen + 1]); --- 372,383 ---- } ! if (seed == 0) ! { ! srand ((unsigned)time (NULL)); ! } ! else ! { ! srand (seed); ! } int fd; char *fname = NEW (char [templen + extenlen + 1]); *************** *** 373,374 **** --- 412,434 ---- return 0; } + + + static std::string + tempFilePrefixFromEnv (std::string paddern, std::string delim = "/") + { + std::string rv; + + if (::getenv ("TMP") != NULL) + { + rv = ::getenv ("TMP") + delim + paddern; + } + else if (::getenv ("TEMP") != NULL) + { + rv = ::getenv ("TEMP") + delim + paddern; + } + else + { + rv = ""; + } + return rv; + } |
From: Herbert M. D. <he...@us...> - 2009-02-23 17:26:48
|
Update of /cvsroot/wavelet/Wavelet/tools In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv8899/tools Modified Files: pgmcompare.cc ppm2grey.cc vid2pgm.cc wavepgm.cc waveppm.cc Log Message: sanified the temp file creation in MagickInter.cc Index: pgmcompare.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/pgmcompare.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pgmcompare.cc 7 Aug 2007 17:01:00 -0000 1.6 --- pgmcompare.cc 23 Feb 2009 17:26:41 -0000 1.7 *************** *** 13,16 **** --- 13,17 ---- #include <cstdio> #include <cmath> + #include <cstring> #include <WTools.hh> Index: vid2pgm.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/vid2pgm.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** vid2pgm.cc 7 Aug 2007 17:01:01 -0000 1.7 --- vid2pgm.cc 23 Feb 2009 17:26:41 -0000 1.8 *************** *** 12,15 **** --- 12,16 ---- #include <stdexcept> #include <iomanip> + #include <cstring> #include <WImage.hh> Index: ppm2grey.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/ppm2grey.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ppm2grey.cc 10 Aug 2005 09:35:23 -0000 1.3 --- ppm2grey.cc 23 Feb 2009 17:26:41 -0000 1.4 *************** *** 9,12 **** --- 9,13 ---- #include <iostream> #include <stdexcept> + #include <cstring> #include <Wave.hh> Index: wavepgm.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/wavepgm.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wavepgm.cc 7 Aug 2007 17:01:01 -0000 1.5 --- wavepgm.cc 23 Feb 2009 17:26:41 -0000 1.6 *************** *** 12,15 **** --- 12,16 ---- #include <cstdio> #include <cmath> + #include <cstring> #include <Wave.hh> Index: waveppm.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/waveppm.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** waveppm.cc 15 Aug 2007 13:13:58 -0000 1.6 --- waveppm.cc 23 Feb 2009 17:26:41 -0000 1.7 *************** *** 12,15 **** --- 12,16 ---- #include <cstdio> #include <cmath> + #include <cstring> #include <Wave.hh> |
From: Herbert M. D. <he...@us...> - 2008-04-17 11:52:34
|
Update of /cvsroot/wavelet/Wavelet In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11655 Modified Files: ChangeLog wave_version.h Log Message: new version number, minor fixes to debianisation Index: wave_version.h =================================================================== RCS file: /cvsroot/wavelet/Wavelet/wave_version.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wave_version.h 7 Aug 2007 17:00:59 -0000 1.5 --- wave_version.h 17 Apr 2008 11:29:04 -0000 1.6 *************** *** 12,16 **** #define __VERSION_H ! #define WAVE_VERSION "1.2-cvs" #endif --- 12,16 ---- #define __VERSION_H ! #define WAVE_VERSION "1.2" #endif Index: ChangeLog =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ChangeLog,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ChangeLog 17 Apr 2008 09:47:17 -0000 1.26 --- ChangeLog 17 Apr 2008 11:29:04 -0000 1.27 *************** *** 2,5 **** --- 2,6 ---- * Optional support for using ImageMagick's Magick++ classes for reading and writing images + * New version is 1.2. 2007-08-07 Herbert <he...@sp...> |
From: Herbert M. D. <he...@us...> - 2008-04-17 11:29:11
|
Update of /cvsroot/wavelet/Wavelet/debian In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11655/debian Modified Files: control rules Log Message: new version number, minor fixes to debianisation Index: rules =================================================================== RCS file: /cvsroot/wavelet/Wavelet/debian/rules,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rules 15 Aug 2005 17:09:41 -0000 1.3 --- rules 17 Apr 2008 11:29:05 -0000 1.4 *************** *** 115,119 **** # dh_perl # dh_python ! # dh_makeshlibs dh_installdeb dh_shlibdeps -Llibwavelet -l debian/libwavelet/usr/lib --- 115,119 ---- # dh_perl # dh_python ! dh_makeshlibs dh_installdeb dh_shlibdeps -Llibwavelet -l debian/libwavelet/usr/lib Index: control =================================================================== RCS file: /cvsroot/wavelet/Wavelet/debian/control,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** control 27 Jan 2005 13:36:27 -0000 1.6 --- control 17 Apr 2008 11:29:05 -0000 1.7 *************** *** 8,12 **** Section: libdev Architecture: any ! Depends: libwavelet (= ${Source-Version}) libjpeg62-dev Suggests: libwavelet-doc (= ${Source-Version}) Description: Development files for the Wavelet libray --- 8,12 ---- Section: libdev Architecture: any ! Depends: libwavelet (= ${Source-Version}), libjpeg62-dev, libmagick++9-dev Suggests: libwavelet-doc (= ${Source-Version}) Description: Development files for the Wavelet libray *************** *** 32,36 **** Section: libs Architecture: any ! Depends: libjpeg62, libpfi (>= 1.2) Description: Wavelet: a C++ class library for Wavelet transforms on images and videos. --- 32,36 ---- Section: libs Architecture: any ! Depends: libjpeg62, libmagick++9c2a,libpfi (>= 1.2) Description: Wavelet: a C++ class library for Wavelet transforms on images and videos. |
From: Herbert M. D. <he...@us...> - 2008-04-17 09:47:24
|
Update of /cvsroot/wavelet/Wavelet In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1501 Modified Files: ChangeLog config.guess config.sub Log Message: fixed typo in ChangeLog file Index: config.guess =================================================================== RCS file: /cvsroot/wavelet/Wavelet/config.guess,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** config.guess 8 Mar 2006 17:14:57 -0000 1.10 --- config.guess 17 Apr 2008 09:47:17 -0000 1.11 *************** *** 2,8 **** # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ! timestamp='2005-08-03' # This file is free software; you can redistribute it and/or modify it --- 2,9 ---- # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 ! # Free Software Foundation, Inc. ! timestamp='2008-01-23' # This file is free software; you can redistribute it and/or modify it *************** *** 56,61 **** Originally written by Per Bothner. ! Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 ! Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO --- 57,62 ---- Originally written by Per Bothner. ! Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, ! 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO *************** *** 107,111 **** trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; ! { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || --- 108,112 ---- trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; ! { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || *************** *** 161,164 **** --- 162,166 ---- sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac *************** *** 207,212 **** echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) ! echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) --- 209,217 ---- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; macppc:MirBSD:*:*) ! echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) *************** *** 326,330 **** echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; ! i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; --- 331,335 ---- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; ! i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *************** *** 528,532 **** fi exit ;; ! *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then --- 533,537 ---- fi exit ;; ! *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then *************** *** 765,774 **** exit ;; *:FreeBSD:*:*) ! echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; ! i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; --- 770,786 ---- exit ;; *:FreeBSD:*:*) ! case ${UNAME_MACHINE} in ! pc98) ! echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ! amd64) ! echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ! *) ! echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ! esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; ! *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *************** *** 780,786 **** echo ${UNAME_MACHINE}-pc-pw32 exit ;; ! x86:Interix*:[34]*) ! echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' ! exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks --- 792,807 ---- echo ${UNAME_MACHINE}-pc-pw32 exit ;; ! *:Interix*:[3456]*) ! case ${UNAME_MACHINE} in ! x86) ! echo i586-pc-interix${UNAME_RELEASE} ! exit ;; ! EM64T | authenticamd) ! echo x86_64-unknown-interix${UNAME_RELEASE} ! exit ;; ! IA64) ! echo ia64-unknown-interix${UNAME_RELEASE} ! exit ;; ! esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks *************** *** 816,819 **** --- 837,850 ---- exit ;; arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; *************** *** 852,856 **** #endif EOF ! eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; --- 883,891 ---- #endif EOF ! eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' ! /^CPU/{ ! s: ::g ! p ! }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; *************** *** 871,875 **** #endif EOF ! eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; --- 906,914 ---- #endif EOF ! eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' ! /^CPU/{ ! s: ::g ! p ! }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; *************** *** 920,926 **** --- 959,971 ---- echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so *************** *** 965,969 **** # endif #else ! #ifdef __INTEL_COMPILER LIBC=gnu #else --- 1010,1014 ---- # endif #else ! #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else *************** *** 975,979 **** #endif EOF ! eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" --- 1020,1028 ---- #endif EOF ! eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' ! /^LIBC/{ ! s: ::g ! p ! }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" *************** *** 1177,1180 **** --- 1226,1238 ---- echo sx6-nec-superux${UNAME_RELEASE} exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} *************** *** 1186,1190 **** UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in - *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac --- 1244,1247 ---- *************** *** 1265,1268 **** --- 1322,1328 ---- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; esac *************** *** 1425,1431 **** download the most up to date version of the config scripts from ! http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess and ! http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub If the version you run ($0) is already up to date, please --- 1485,1491 ---- download the most up to date version of the config scripts from ! http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and ! http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please Index: config.sub =================================================================== RCS file: /cvsroot/wavelet/Wavelet/config.sub,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** config.sub 8 Mar 2006 17:14:57 -0000 1.10 --- config.sub 17 Apr 2008 09:47:17 -0000 1.11 *************** *** 2,8 **** # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ! timestamp='2005-07-08' # This file is (in principle) common to ALL GNU software. --- 2,9 ---- # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 ! # Free Software Foundation, Inc. ! timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. *************** *** 72,77 **** GNU config.sub ($timestamp) ! Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 ! Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO --- 73,78 ---- GNU config.sub ($timestamp) ! Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, ! 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO *************** *** 120,125 **** maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in ! nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ ! kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` --- 121,127 ---- maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in ! nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ ! uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ ! storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` *************** *** 172,175 **** --- 174,181 ---- os=-hiuxwe2 ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco5) os=-sco3.2v5 *************** *** 188,191 **** --- 194,201 ---- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; -sco*) os=-sco3.2v2 *************** *** 232,244 **** | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ ! | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ ! | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ ! | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ --- 242,255 ---- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ ! | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ ! | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ ! | m32c | m32r | m32rle | m68000 | m68k | m88k \ ! | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ *************** *** 258,263 **** | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ ! | ms1 \ | msp430 \ | ns16k | ns32k \ | or32 \ --- 269,275 ---- | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ ! | mt \ | msp430 \ + | nios | nios2 \ | ns16k | ns32k \ | or32 \ *************** *** 265,283 **** | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ ! | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ ! | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ ! | sparcv8 | sparcv9 | sparcv9b \ ! | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ ! | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; - m32c) - basic_machine=$basic_machine-unknown - ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. --- 277,293 ---- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ ! | score \ ! | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ ! | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ ! | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ ! | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ ! | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. *************** *** 287,290 **** --- 297,303 ---- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; + ms1) + basic_machine=mt-unknown + ;; # We use `pc' rather than `unknown' *************** *** 306,310 **** | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ ! | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ --- 319,323 ---- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ ! | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ *************** *** 312,321 **** | d10v-* | d30v-* | dlx-* \ | elxsi-* \ ! | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ ! | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ --- 325,334 ---- | d10v-* | d30v-* | dlx-* \ | elxsi-* \ ! | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ ! | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ *************** *** 337,342 **** | mipstx39-* | mipstx39el-* \ | mmix-* \ ! | ms1-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ --- 350,356 ---- | mipstx39-* | mipstx39el-* \ | mmix-* \ ! | mt-* \ | msp430-* \ + | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ *************** *** 345,353 **** | pyramid-* \ | romp-* | rs6000-* \ ! | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ ! | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ ! | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ --- 359,367 ---- | pyramid-* \ | romp-* | rs6000-* \ ! | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ ! | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ ! | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ *************** *** 355,364 **** | v850-* | v850e-* | vax-* \ | we32k-* \ ! | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ ! | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; ! m32c-*) ;; # Recognize the various machine names and aliases which stand --- 369,380 ---- | v850-* | v850e-* | vax-* \ | we32k-* \ ! | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ ! | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; ! # Recognize the basic CPU types without company name, with glob match. ! xtensa*) ! basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand *************** *** 432,435 **** --- 448,459 ---- os=-dynix ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; c90) basic_machine=c90-cray *************** *** 464,469 **** os=-unicosmp ;; ! cr16c) ! basic_machine=cr16c-unknown os=-elf ;; --- 488,493 ---- os=-unicosmp ;; ! cr16) ! basic_machine=cr16-unknown os=-elf ;; *************** *** 657,660 **** --- 681,692 ---- os=-sysv ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; m88k-omron*) basic_machine=m88k-omron *************** *** 672,675 **** --- 704,711 ---- os=-mingw32 ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; miniframe) basic_machine=m68000-convergent *************** *** 697,700 **** --- 733,739 ---- os=-msdos ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; mvs) basic_machine=i370-ibm *************** *** 795,798 **** --- 834,845 ---- os=-osf ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; pbd) basic_machine=sparc-tti *************** *** 804,807 **** --- 851,860 ---- basic_machine=ns32k-pc532 ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc *************** *** 860,863 **** --- 913,920 ---- os=-pw32 ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; rom68k) basic_machine=m68k-rom68k *************** *** 886,889 **** --- 943,950 ---- basic_machine=mipsisa64sb1el-unknown ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; sei) basic_machine=mips-sei *************** *** 897,900 **** --- 958,964 ---- os=-hms ;; + sh5el) + basic_machine=sh5le-unknown + ;; sh64) basic_machine=sh64-unknown *************** *** 986,989 **** --- 1050,1057 ---- os=-coff ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; tx39) basic_machine=mipstx39-unknown *************** *** 1102,1106 **** basic_machine=sh-unknown ;; ! sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; --- 1170,1174 ---- basic_machine=sh-unknown ;; ! sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; *************** *** 1175,1179 **** | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ ! | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ --- 1243,1248 ---- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ ! | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ ! | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ *************** *** 1182,1186 **** | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ ! | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ --- 1251,1256 ---- | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ ! | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ ! | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ *************** *** 1189,1193 **** | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ ! | -skyos* | -haiku*) # Remember, each alternative MUST END IN *, to match a version number. ;; --- 1259,1263 ---- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ ! | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; *************** *** 1341,1344 **** --- 1411,1420 ---- case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; *-acorn) os=-riscix1.2 *************** *** 1350,1356 **** os=-aout ;; ! c4x-* | tic4x-*) ! os=-coff ! ;; # This must come before the *-dec entry. pdp10-*) --- 1426,1432 ---- os=-aout ;; ! c4x-* | tic4x-*) ! os=-coff ! ;; # This must come before the *-dec entry. pdp10-*) *************** *** 1378,1381 **** --- 1454,1460 ---- os=-aout ;; + mep-*) + os=-elf + ;; mips*-cisco) os=-elf Index: ChangeLog =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ChangeLog,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ChangeLog 17 Apr 2008 07:27:34 -0000 1.25 --- ChangeLog 17 Apr 2008 09:47:17 -0000 1.26 *************** *** 1,7 **** ! 2008-04-16 Herbert <he...@sp...> * Optional support for using ImageMagick's Magick++ classes for reading and writing images ! 2007-08-07 Herbert <he...@sp...> * Various bugfixes, added ImageResizer tool class which allows smart cropping of color images (not very sophisticated yet). --- 1,7 ---- ! 2008-04-16 Herbert <he...@sp...> * Optional support for using ImageMagick's Magick++ classes for reading and writing images ! 2007-08-07 Herbert <he...@sp...> * Various bugfixes, added ImageResizer tool class which allows smart cropping of color images (not very sophisticated yet). |
From: Herbert M. D. <he...@us...> - 2008-04-17 07:35:00
|
Update of /cvsroot/wavelet/Wavelet/test In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16092/test Modified Files: magickinter.cc Log Message: removed accidentally commited test code in magickinter test Index: magickinter.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/magickinter.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** magickinter.cc 17 Apr 2008 07:27:36 -0000 1.1 --- magickinter.cc 17 Apr 2008 07:34:55 -0000 1.2 *************** *** 33,40 **** std::auto_ptr<ColorImage> ip1 (NEW (ColorImage ())); TEST_NO_EXCEPTION (ip1->read ("christina57.jpg")); // 594x448 ! TEST_NO_EXCEPTION (MagickInter::writeColorImageWithTransparency (*ip1, "out.png")); std::auto_ptr<ColorImage> ip2 = MagickInter::obtainColorImage ("out.png"); - ip1->write ("out1.ppm"); - ip2->write ("out2.ppm"); TEST_ASSERT(ip1->epsilons (*ip2, 0.01)); --- 33,38 ---- std::auto_ptr<ColorImage> ip1 (NEW (ColorImage ())); TEST_NO_EXCEPTION (ip1->read ("christina57.jpg")); // 594x448 ! TEST_NO_EXCEPTION (MagickInter::writeColorImage (*ip1, "out.png")); std::auto_ptr<ColorImage> ip2 = MagickInter::obtainColorImage ("out.png"); TEST_ASSERT(ip1->epsilons (*ip2, 0.01)); |
From: Herbert M. D. <he...@us...> - 2008-04-17 07:27:43
|
Update of /cvsroot/wavelet/Wavelet In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13454 Modified Files: ChangeLog Image.cc ImageArray.cc ImageInformation.cc Makefile.in Makefile.msc PixmapReader.cc PpmReader.cc PyramidTransform.cc WImage.hh Wavelet.cc configure configure.in tools.cc Added Files: MagickInter.cc Log Message: Optional support for using ImageMagick's Magick++ classes for reading and writing images, also some minor additions. Index: configure =================================================================== RCS file: /cvsroot/wavelet/Wavelet/configure,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** configure 15 Aug 2007 13:13:57 -0000 1.4 --- configure 17 Apr 2008 07:27:34 -0000 1.5 *************** *** 673,676 **** --- 673,679 ---- PFI_DEF PFI_LIB + CXXCPP + MAGICK_INTER_DEF + MAGICK_INTER_LIB CXXOPT CXXDEBUG *************** *** 711,715 **** CC CFLAGS ! CPP' --- 714,719 ---- CC CFLAGS ! CPP ! CXXCPP' *************** *** 1299,1302 **** --- 1303,1307 ---- CFLAGS C compiler flags CPP C preprocessor + CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help *************** *** 4556,4559 **** --- 4561,4941 ---- + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 + echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } + if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false + for ac_cxx_preproc_warn_flag in '' yes + do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + #ifdef __STDC__ + # include <limits.h> + #else + # include <assert.h> + #endif + Syntax error + _ACEOF + if { (ac_try="$ac_cpp conftest.$ac_ext" + case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; + esac + eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. + continue + fi + + rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + #include <ac_nonexistent.h> + _ACEOF + if { (ac_try="$ac_cpp conftest.$ac_ext" + case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; + esac + eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. + continue + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. + ac_preproc_ok=: + break + fi + + rm -f conftest.err conftest.$ac_ext + + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. + rm -f conftest.err conftest.$ac_ext + if $ac_preproc_ok; then + break + fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + + fi + CXXCPP=$ac_cv_prog_CXXCPP + else + ac_cv_prog_CXXCPP=$CXXCPP + fi + { echo "$as_me:$LINENO: result: $CXXCPP" >&5 + echo "${ECHO_T}$CXXCPP" >&6; } + ac_preproc_ok=false + for ac_cxx_preproc_warn_flag in '' yes + do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + #ifdef __STDC__ + # include <limits.h> + #else + # include <assert.h> + #endif + Syntax error + _ACEOF + if { (ac_try="$ac_cpp conftest.$ac_ext" + case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; + esac + eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. + continue + fi + + rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + #include <ac_nonexistent.h> + _ACEOF + if { (ac_try="$ac_cpp conftest.$ac_ext" + case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; + esac + eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. + continue + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. + ac_preproc_ok=: + break + fi + + rm -f conftest.err conftest.$ac_ext + + done + # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. + rm -f conftest.err conftest.$ac_ext + if $ac_preproc_ok; then + : + else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check + See \`config.log' for more details." >&5 + echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check + See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + if test "${ac_cv_header_Magickpp_Image_h+set}" = set; then + { echo "$as_me:$LINENO: checking for Magick++/Image.h" >&5 + echo $ECHO_N "checking for Magick++/Image.h... $ECHO_C" >&6; } + if test "${ac_cv_header_Magickpp_Image_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + fi + { echo "$as_me:$LINENO: result: $ac_cv_header_Magickpp_Image_h" >&5 + echo "${ECHO_T}$ac_cv_header_Magickpp_Image_h" >&6; } + else + # Is the header compilable? + { echo "$as_me:$LINENO: checking Magick++/Image.h usability" >&5 + echo $ECHO_N "checking Magick++/Image.h usability... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + $ac_includes_default + #include <Magick++/Image.h> + _ACEOF + rm -f conftest.$ac_objext + if { (ac_try="$ac_compile" + case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; + esac + eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no + fi + + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 + echo "${ECHO_T}$ac_header_compiler" >&6; } + + # Is the header present? + { echo "$as_me:$LINENO: checking Magick++/Image.h presence" >&5 + echo $ECHO_N "checking Magick++/Image.h presence... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + #include <Magick++/Image.h> + _ACEOF + if { (ac_try="$ac_cpp conftest.$ac_ext" + case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; + esac + eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no + fi + + rm -f conftest.err conftest.$ac_ext + { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 + echo "${ECHO_T}$ac_header_preproc" >&6; } + + # So? What about this header? + case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: Magick++/Image.h: accepted by the compiler, rejected by the preprocessor!" >&5 + echo "$as_me: WARNING: Magick++/Image.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: Magick++/Image.h: proceeding with the compiler's result" >&5 + echo "$as_me: WARNING: Magick++/Image.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: Magick++/Image.h: present but cannot be compiled" >&5 + echo "$as_me: WARNING: Magick++/Image.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: Magick++/Image.h: check for missing prerequisite headers?" >&5 + echo "$as_me: WARNING: Magick++/Image.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: Magick++/Image.h: see the Autoconf documentation" >&5 + echo "$as_me: WARNING: Magick++/Image.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: Magick++/Image.h: section \"Present But Cannot Be Compiled\"" >&5 + echo "$as_me: WARNING: Magick++/Image.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: Magick++/Image.h: proceeding with the preprocessor's result" >&5 + echo "$as_me: WARNING: Magick++/Image.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: Magick++/Image.h: in the future, the compiler will take precedence" >&5 + echo "$as_me: WARNING: Magick++/Image.h: in the future, the compiler will take precedence" >&2;} + + ;; + esac + { echo "$as_me:$LINENO: checking for Magick++/Image.h" >&5 + echo $ECHO_N "checking for Magick++/Image.h... $ECHO_C" >&6; } + if test "${ac_cv_header_Magickpp_Image_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_cv_header_Magickpp_Image_h=$ac_header_preproc + fi + { echo "$as_me:$LINENO: result: $ac_cv_header_Magickpp_Image_h" >&5 + echo "${ECHO_T}$ac_cv_header_Magickpp_Image_h" >&6; } + + fi + if test $ac_cv_header_Magickpp_Image_h = yes; then + MAGICK_INTER_DEF="-DMAGICK_INTER" + MAGICK_INTER_LIB="-lMagick++" + else + MAGICK_INTER_DEF="" + MAGICK_INTER_LIB="" + + fi + + + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + DEBUG="no" # Check whether --enable-debug was given. *************** *** 5576,5579 **** --- 5958,5964 ---- PFI_DEF!$PFI_DEF$ac_delim PFI_LIB!$PFI_LIB$ac_delim + CXXCPP!$CXXCPP$ac_delim + MAGICK_INTER_DEF!$MAGICK_INTER_DEF$ac_delim + MAGICK_INTER_LIB!$MAGICK_INTER_LIB$ac_delim CXXOPT!$CXXOPT$ac_delim CXXDEBUG!$CXXDEBUG$ac_delim *************** *** 5604,5608 **** _ACEOF ! if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 85; then break elif $ac_last_try; then --- 5989,5993 ---- _ACEOF ! if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 88; then break elif $ac_last_try; then Index: configure.in =================================================================== RCS file: /cvsroot/wavelet/Wavelet/configure.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** configure.in 15 Aug 2007 13:13:57 -0000 1.4 --- configure.in 17 Apr 2008 07:27:34 -0000 1.5 *************** *** 123,126 **** --- 123,137 ---- AC_SUBST(PFI_LIB) + AC_LANG_PUSH(C++) + AC_CHECK_HEADER(Magick++/Image.h, + MAGICK_INTER_DEF="-DMAGICK_INTER" + MAGICK_INTER_LIB="-lMagick++", + MAGICK_INTER_DEF="" + MAGICK_INTER_LIB="" + ) + AC_LANG_POP + AC_SUBST(MAGICK_INTER_DEF) + AC_SUBST(MAGICK_INTER_LIB) + DEBUG="no" dnl Checks if we are going to enable debugging Index: Wavelet.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Wavelet.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Wavelet.cc 7 Aug 2007 17:00:59 -0000 1.5 --- Wavelet.cc 17 Apr 2008 07:27:34 -0000 1.6 *************** *** 28,32 **** #endif ! void Wavelet::init (FilterSet *pfset) { --- 28,32 ---- #endif ! void Wavelet::init (FilterSet *pfset) { *************** *** 37,45 **** m_synhigh = NEW (Filter (pfset->shigh ())); m_symmetric = pfset->issym (); - ! /* ! * amount of space to leave for padding ! * vectors for symmetric extensions */ m_npad = MAX (m_analow->fsize (), m_anahigh->fsize ()); --- 37,45 ---- m_synhigh = NEW (Filter (pfset->shigh ())); m_symmetric = pfset->issym (); ! ! /* ! * amount of space to leave for padding ! * vectors for symmetric extensions */ m_npad = MAX (m_analow->fsize (), m_anahigh->fsize ()); *************** *** 49,53 **** if (m_analow->fsize () % 2 != 0) { ! /* * Odd filter length, no extra mirror axis on low left * or high right --- 49,53 ---- if (m_analow->fsize () % 2 != 0) { ! /* * Odd filter length, no extra mirror axis on low left * or high right *************** *** 67,71 **** m_slpad = NEW (MirrorPosition (lleft, true)); m_shpad = NEW (MirrorPosition (true, hright)); ! /* always symmetric */ ((MirrorPosition*)m_slpad)->setsymm (true); --- 67,71 ---- m_slpad = NEW (MirrorPosition (lleft, true)); m_shpad = NEW (MirrorPosition (true, hright)); ! /* always symmetric */ ((MirrorPosition*)m_slpad)->setsymm (true); *************** *** 86,90 **** m_slpsize = 0; m_shpositions = NULL; ! m_shsigns = NULL; m_shpsize = 0; } --- 86,90 ---- m_slpsize = 0; m_shpositions = NULL; ! m_shsigns = NULL; m_shpsize = 0; } *************** *** 92,101 **** Wavelet::Wavelet (FilterSet &fset) ! { init (&fset); } Wavelet::~Wavelet (void) ! { DELETE (m_analow); DELETE (m_anahigh); --- 92,101 ---- Wavelet::Wavelet (FilterSet &fset) ! { init (&fset); } Wavelet::~Wavelet (void) ! { DELETE (m_analow); DELETE (m_anahigh); *************** *** 114,121 **** Wavelet::analysis (ReferenceVector &dest, ReferenceVector &src, int steps) { ! ReferenceVector *s = &src; ReferenceVector *d = &dest; ReferenceVector *t; ! int loSize = src.size (); int hiSize = 0; --- 114,121 ---- Wavelet::analysis (ReferenceVector &dest, ReferenceVector &src, int steps) { ! ReferenceVector *s = &src; ReferenceVector *d = &dest; ReferenceVector *t; ! int loSize = src.size (); int hiSize = 0; *************** *** 130,134 **** "Low pass subband is too small."); } ! anastep (*d, *s, loSize); --- 130,134 ---- "Low pass subband is too small."); } ! anastep (*d, *s, loSize); *************** *** 138,142 **** */ hiSize = loSize / 2; ! loSize = DIV2 (loSize + 1); if (d == &src) { --- 138,142 ---- */ hiSize = loSize / 2; ! loSize = DIV2 (loSize + 1); if (d == &src) { *************** *** 147,151 **** } } ! /* * If the last write went to src, we must copy a missing bit into --- 147,151 ---- } } ! /* * If the last write went to src, we must copy a missing bit into *************** *** 162,166 **** void ! Wavelet::synthesis (ReferenceVector &dest, ReferenceVector &src, int steps, int prevSteps) { --- 162,166 ---- void ! Wavelet::synthesis (ReferenceVector &dest, ReferenceVector &src, int steps, int prevSteps) { *************** *** 170,178 **** int *loSize = NEW (int [steps]); int *hiSize = NEW (int [steps]); ! loSize[0] = (src.size () + 1) / 2; hiSize[0] = src.size () / 2; ! ! for (int i = 1; i < prevSteps; i++) { loSize[i] = DIV2 (loSize [i - 1] + 1); --- 170,178 ---- int *loSize = NEW (int [steps]); int *hiSize = NEW (int [steps]); ! loSize[0] = (src.size () + 1) / 2; hiSize[0] = src.size () / 2; ! ! for (int i = 1; i < prevSteps; i++) { loSize[i] = DIV2 (loSize [i - 1] + 1); *************** *** 206,210 **** { int ret = 0; ! (void)tools_powerOfTwo (src.size (), ret); --- 206,210 ---- { int ret = 0; ! (void)tools_powerOfTwo (src.size (), ret); *************** *** 233,237 **** m_apositions = NEW (int [size + 2 * m_npad]); } ! m_apad->size (size); --- 233,237 ---- m_apositions = NEW (int [size + 2 * m_npad]); } ! m_apad->size (size); *************** *** 247,260 **** for (int j = 0; j < m_analow->fsize (); j++) { ! DPRINTF (("dst[%2d] = dst[%2d] + src[%2d] * analysisLow [%2d]\n", i, i, m_apositions[basepos1 + j + m_npad], j)); ! DPRINTF (("dst[%2d] = %+7.2f + %+7.2f * %+7.2f =====> %+8.2f\n", ! i, dest.at (i), src.at (m_apositions[basepos1 + j + m_npad]), ! m_analow->at (j), ! dest.at (i) + src.at (m_apositions[basepos1 + j + m_npad]) * m_analow->at (j))); ! dest.to (i, dest.at (i) + src.at (m_apositions[basepos1 + j + m_npad]) * m_analow->at (j)); --- 247,260 ---- for (int j = 0; j < m_analow->fsize (); j++) { ! DPRINTF (("dst[%2d] = dst[%2d] + src[%2d] * analysisLow [%2d]\n", i, i, m_apositions[basepos1 + j + m_npad], j)); ! DPRINTF (("dst[%2d] = %+7.2f + %+7.2f * %+7.2f =====> %+8.2f\n", ! i, dest.at (i), src.at (m_apositions[basepos1 + j + m_npad]), ! m_analow->at (j), ! dest.at (i) + src.at (m_apositions[basepos1 + j + m_npad]) * m_analow->at (j))); ! dest.to (i, dest.at (i) + src.at (m_apositions[basepos1 + j + m_npad]) * m_analow->at (j)); *************** *** 267,271 **** continue; } ! dest.to (halfend+i, 0.0); basepos1 = MUL2 (i) + m_anahigh->first (); --- 267,271 ---- continue; } ! dest.to (halfend+i, 0.0); basepos1 = MUL2 (i) + m_anahigh->first (); *************** *** 273,288 **** for (int j = 0; j < m_anahigh->fsize (); j++) { ! DPRINTF (("dst[%2d] = dst[%2d] + src[%2d] * analysisHigh[%2d]\n", ! basepos2, basepos2, m_apositions[basepos1 + j + m_npad], j)); ! DPRINTF (("dst[%2d] = %+7.2f + %+7.2f * %+7.2f =====> %+8.2f\n", ! i, dest.at (basepos2), src.at (m_apositions[basepos1 + j + m_npad]), ! m_anahigh->at (j), ! dest.at (basepos2) + src.at (m_apositions[basepos1 + j + m_npad]) * m_anahigh->at (j))); ! dest.to (basepos2, dest.at (basepos2) ! + src.at (m_apositions[basepos1 + j + m_npad]) * m_anahigh->at (j)); } --- 273,288 ---- for (int j = 0; j < m_anahigh->fsize (); j++) { ! DPRINTF (("dst[%2d] = dst[%2d] + src[%2d] * analysisHigh[%2d]\n", ! basepos2, basepos2, m_apositions[basepos1 + j + m_npad], j)); ! DPRINTF (("dst[%2d] = %+7.2f + %+7.2f * %+7.2f =====> %+8.2f\n", ! i, dest.at (basepos2), src.at (m_apositions[basepos1 + j + m_npad]), ! m_anahigh->at (j), ! dest.at (basepos2) + src.at (m_apositions[basepos1 + j + m_npad]) * m_anahigh->at (j))); ! dest.to (basepos2, dest.at (basepos2) ! + src.at (m_apositions[basepos1 + j + m_npad]) * m_anahigh->at (j)); } *************** *** 291,295 **** } ! void Wavelet::synstep (ReferenceVector &dest, ReferenceVector &src, int size) { --- 291,295 ---- } ! void Wavelet::synstep (ReferenceVector &dest, ReferenceVector &src, int size) { *************** *** 297,301 **** int hiSize = size/2; ! int first = m_synlow->first (); int last = m_synlow->fsize () - 1 + first; --- 297,301 ---- int hiSize = size/2; ! int first = m_synlow->first (); int last = m_synlow->fsize () - 1 + first; *************** *** 308,312 **** dest.to (x, 0.0); } ! if (m_slpsize < loSize + 2 * m_npad) { --- 308,312 ---- dest.to (x, 0.0); } ! if (m_slpsize < loSize + 2 * m_npad) { *************** *** 314,318 **** m_slpositions = NEW (int [loSize + 2 * m_npad]); } ! if (m_shpsize < hiSize + 2 * m_npad) { --- 314,318 ---- m_slpositions = NEW (int [loSize + 2 * m_npad]); } ! if (m_shpsize < hiSize + 2 * m_npad) { *************** *** 322,326 **** m_shsigns = NEW (int [hiSize + 2 * m_npad]); } ! m_slpad->size (loSize); if (m_symmetric) --- 322,326 ---- m_shsigns = NEW (int [hiSize + 2 * m_npad]); } ! m_slpad->size (loSize); if (m_symmetric) *************** *** 335,343 **** loopend = DIV2 (size-1-first); ! for (int i = -last/2; i <= loopend; i++) { basepos1 = 2 * i + first; coeff value = src.at (m_slpositions[i+m_npad]); ! for (int j = 0; j < m_synlow->fsize (); j++) { cur = basepos1 + j; --- 335,343 ---- loopend = DIV2 (size-1-first); ! for (int i = -last/2; i <= loopend; i++) { basepos1 = 2 * i + first; coeff value = src.at (m_slpositions[i+m_npad]); ! for (int j = 0; j < m_synlow->fsize (); j++) { cur = basepos1 + j; *************** *** 353,357 **** if (m_symmetric) { ! ((MirrorPosition*)m_shpad)->setraxis ((m_analow->fsize () % 2 == 0) == (size % 2 == 0)? true: false); } --- 353,357 ---- if (m_symmetric) { ! ((MirrorPosition*)m_shpad)->setraxis ((m_analow->fsize () % 2 == 0) == (size % 2 == 0)? true: false); } *************** *** 359,371 **** for (int i = -m_npad; i < hiSize + m_npad; i++) { ! m_shpositions[i+m_npad] = m_shpad->pos (i, loSize, hiSize, m_shsigns[i+m_npad]); } ! first = m_synhigh->first (); last = m_synhigh->fsize () - 1 + first; ! loopend = DIV2 (size-1-first); ! for (int i = -last/2; i <= loopend; i++) { basepos1 = 2 * i + first; --- 359,371 ---- for (int i = -m_npad; i < hiSize + m_npad; i++) { ! m_shpositions[i+m_npad] = m_shpad->pos (i, loSize, hiSize, m_shsigns[i+m_npad]); } ! first = m_synhigh->first (); last = m_synhigh->fsize () - 1 + first; ! loopend = DIV2 (size-1-first); ! for (int i = -last/2; i <= loopend; i++) { basepos1 = 2 * i + first; *************** *** 375,383 **** value *= (coeff)m_shsigns[i+m_npad]; } ! ! for (int j = 0; j < m_synhigh->fsize (); j++) { cur = basepos1 + j; ! if (cur >= 0 && cur < size) { --- 375,383 ---- value *= (coeff)m_shsigns[i+m_npad]; } ! ! for (int j = 0; j < m_synhigh->fsize (); j++) { cur = basepos1 + j; ! if (cur >= 0 && cur < size) { Index: ChangeLog =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ChangeLog,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ChangeLog 3 Dec 2007 12:40:51 -0000 1.24 --- ChangeLog 17 Apr 2008 07:27:34 -0000 1.25 *************** *** 1,2 **** --- 1,6 ---- + 2008-04-16 Herbert <he...@sp...> + * Optional support for using ImageMagick's Magick++ classes for + reading and writing images + 2007-08-07 Herbert <he...@sp...> * Various bugfixes, added ImageResizer tool class which allows *************** *** 6,10 **** 2005-08-15 Herbert <he...@sp...> * Fixed a serious memory leak in ColorVideo and a number of minor ! ones in StillImage and avilib (reported by Florian Stumpf and Johan Ehlers). * New version is 1.1. --- 10,14 ---- 2005-08-15 Herbert <he...@sp...> * Fixed a serious memory leak in ColorVideo and a number of minor ! ones in StillImage and avilib (reported by Florian Stumpf and Johan Ehlers). * New version is 1.1. *************** *** 24,33 **** * Added error message for filed `write' operation to video2grey * Fixed an error in ColorVideo::videoDimensions() ! * Made the API more consistent. This includes changing the argument list for these methods: - ColorBuffer::beautify() - Image::beautify() The order of arguments was changed by putting `yoffs' and `xoffs' ! first, followed by `ysize' and `xsize'. * Changed the signature of ColorVideo::videoDimensions(): - the return type is now `void' --- 28,37 ---- * Added error message for filed `write' operation to video2grey * Fixed an error in ColorVideo::videoDimensions() ! * Made the API more consistent. This includes changing the argument list for these methods: - ColorBuffer::beautify() - Image::beautify() The order of arguments was changed by putting `yoffs' and `xoffs' ! first, followed by `ysize' and `xsize'. * Changed the signature of ColorVideo::videoDimensions(): - the return type is now `void' *************** *** 42,46 **** operations are disabled * New version is 1.0 (final) ! 2004-12-08 Herbert <he...@sp...> * Added new Image::histEqualization() method. --- 46,50 ---- operations are disabled * New version is 1.0 (final) ! 2004-12-08 Herbert <he...@sp...> * Added new Image::histEqualization() method. *************** *** 50,54 **** 2004-07-15 Herbert <he...@sp...> ! * renamed version.h to wave_version.h to avoid clashes * New method `Image::scale()' * New shortcut methods for image statistics in WaveletTransform --- 54,58 ---- 2004-07-15 Herbert <he...@sp...> ! * renamed version.h to wave_version.h to avoid clashes * New method `Image::scale()' * New shortcut methods for image statistics in WaveletTransform *************** *** 80,84 **** easier integration into existing code) * Added support for transforming images of any size. ! * Added abstract class ImageVector as immediate base class for RowVector, ColumnVector and FullVector, so that ReferenceVector does no longer contain references to ImageArray. --- 84,88 ---- easier integration into existing code) * Added support for transforming images of any size. ! * Added abstract class ImageVector as immediate base class for RowVector, ColumnVector and FullVector, so that ReferenceVector does no longer contain references to ImageArray. *************** *** 104,120 **** too. This leads to more target platforms, OS/2 just to mention one. * Version is now 0.8c, status now beta. ! 2003-09-09 Herbert <he...@sp...> * Fixed a critical bug in ImageArray<T>::clone() which carried over to Image::clone() and ColorImage::clone(). * Version is now 0.8b. ! 2003-07-01 Herbert <he...@sp...> * Added constructor for ImageInformation object to Histogram. * WaveletTransform::level() is now WaveletTransform::subband() ! * Renamed PfiReader and PfiWriter to PfgReader and PfgWriter * added color PFI support: PfcReader and PfcWriter * Version is now 0.8a. ! 2003-06-17 Herbert <he...@sp...> * Changed the API for color images, some name changes with the --- 108,124 ---- too. This leads to more target platforms, OS/2 just to mention one. * Version is now 0.8c, status now beta. ! 2003-09-09 Herbert <he...@sp...> * Fixed a critical bug in ImageArray<T>::clone() which carried over to Image::clone() and ColorImage::clone(). * Version is now 0.8b. ! 2003-07-01 Herbert <he...@sp...> * Added constructor for ImageInformation object to Histogram. * WaveletTransform::level() is now WaveletTransform::subband() ! * Renamed PfiReader and PfiWriter to PfgReader and PfgWriter * added color PFI support: PfcReader and PfcWriter * Version is now 0.8a. ! 2003-06-17 Herbert <he...@sp...> * Changed the API for color images, some name changes with the *************** *** 123,132 **** * Ported library to IRIX * Version is now 0.8. ! 2003-05-26 Herbert <he...@sp...> * Bugfix release for waveppm and ImageArray crashes * Some name changes (beware: ColorImage is still under construction) * Version is now 0.7a. ! 2003-05-19 Herbert <he...@sp...> * Optimization of pixel/coeff access in class `ImageArray' --- 127,136 ---- * Ported library to IRIX * Version is now 0.8. ! 2003-05-26 Herbert <he...@sp...> * Bugfix release for waveppm and ImageArray crashes * Some name changes (beware: ColorImage is still under construction) * Version is now 0.7a. ! 2003-05-19 Herbert <he...@sp...> * Optimization of pixel/coeff access in class `ImageArray' *************** *** 134,160 **** * Name changes of functions in module `tools' * Version is now 0.7. ! 2003-05-13 Herbert <he...@sp...> ! * Naming convention changes, member variable names are now prefixed by `m_' * Version is now 0.6a. ! 2002-09-06 Herbert <he...@sp...> ! * Fixes to pgmhist, wavepgm, waveppm: support for Standard decomposition * Some new methods in ImageInformation and StillImage Version is now 0.6. ! 2002-05-22 Herbert <he...@sp...> * Moved normalization code from pgmcompare to ImageComparison Version is now 0.5a. ! 2002-04-25 Herbert <he...@sp...> ! * Added a few more methods to ImageInformation. ! * Added new class Histogram. ! * Added new tools pgmhist and pgmstats. * Fixed a bug in wavepgm. Version is now 0.5. ! 2002-01-18 Herbert <he...@sp...> * Moved benchmark from tools to test. --- 138,164 ---- * Name changes of functions in module `tools' * Version is now 0.7. ! 2003-05-13 Herbert <he...@sp...> ! * Naming convention changes, member variable names are now prefixed by `m_' * Version is now 0.6a. ! 2002-09-06 Herbert <he...@sp...> ! * Fixes to pgmhist, wavepgm, waveppm: support for Standard decomposition * Some new methods in ImageInformation and StillImage Version is now 0.6. ! 2002-05-22 Herbert <he...@sp...> * Moved normalization code from pgmcompare to ImageComparison Version is now 0.5a. ! 2002-04-25 Herbert <he...@sp...> ! * Added a few more methods to ImageInformation. ! * Added new class Histogram. ! * Added new tools pgmhist and pgmstats. * Fixed a bug in wavepgm. Version is now 0.5. ! 2002-01-18 Herbert <he...@sp...> * Moved benchmark from tools to test. *************** *** 163,175 **** * Removed references to outdated class diagrams. Version is no 0.4f. ! 2002-01-08 Herbert <he...@sp...> * Demorornized code again, added "for" macro for MSC. * Small fixes for Win32 compatibility. ! * New directory layout. * More tools, unified command line options etc. * Created Makefiles and INSTALL.W32 for MSC. Version is no 0.4. ! 2001-08-29 Herbert <he...@sp...> * Optmized the Wavelet transforms by changing the padding code, --- 167,179 ---- * Removed references to outdated class diagrams. Version is no 0.4f. ! 2002-01-08 Herbert <he...@sp...> * Demorornized code again, added "for" macro for MSC. * Small fixes for Win32 compatibility. ! * New directory layout. * More tools, unified command line options etc. * Created Makefiles and INSTALL.W32 for MSC. Version is no 0.4. ! 2001-08-29 Herbert <he...@sp...> * Optmized the Wavelet transforms by changing the padding code, *************** *** 179,183 **** classes. Version is no 0.3e. ! 2001-08-20 Herbert <he...@sp...> * Completed VC++ port. --- 183,187 ---- classes. Version is no 0.3e. ! 2001-08-20 Herbert <he...@sp...> * Completed VC++ port. *************** *** 187,191 **** loop variables as loop-local. * Version is now 0.3d. ! 2001-08-18 Herbert <he...@sp...> * Changed #include "ImageArray.cc" in tests to "../ImageArray.cc" --- 191,195 ---- loop variables as loop-local. * Version is now 0.3d. ! 2001-08-18 Herbert <he...@sp...> * Changed #include "ImageArray.cc" in tests to "../ImageArray.cc" *************** *** 193,197 **** * Fixed broken Makefile entry in tools/. * Version is now 0.3c. ! 2001-08-16 Herbert <he...@sp...> * Added support for color images (*Wrapper classes) --- 197,201 ---- * Fixed broken Makefile entry in tools/. * Version is now 0.3c. ! 2001-08-16 Herbert <he...@sp...> * Added support for color images (*Wrapper classes) *************** *** 204,208 **** 2001-03-09 Herbert <he...@sp...> * Version is now 0.2. ! 2001-03-09 Herbert <he...@sp...> * Reorganized Headers. --- 208,212 ---- 2001-03-09 Herbert <he...@sp...> * Version is now 0.2. ! 2001-03-09 Herbert <he...@sp...> * Reorganized Headers. Index: PpmReader.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PpmReader.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PpmReader.cc 7 Aug 2007 17:00:59 -0000 1.6 --- PpmReader.cc 17 Apr 2008 07:27:34 -0000 1.7 *************** *** 17,27 **** #endif ! int PpmReader::readfmt (void) { FILE *fhandle = NULL; ! int cmax = 0; ! int xsize = 0; int ysize = 0; int xysize = 0; --- 17,27 ---- #endif ! int PpmReader::readfmt (void) { FILE *fhandle = NULL; ! int cmax = 0; ! int xsize = 0; int ysize = 0; int xysize = 0; *************** *** 31,35 **** fhandle = stdin; } ! else { /* --- 31,35 ---- fhandle = stdin; } ! else { /* *************** *** 38,42 **** fhandle = fopen (m_fname, "rb"); } ! /* initialization */ pixel * allpixels = ppm_fromStream (fhandle, &ysize, &xsize, &cmax); --- 38,42 ---- fhandle = fopen (m_fname, "rb"); } ! /* initialization */ pixel * allpixels = ppm_fromStream (fhandle, &ysize, &xsize, &cmax); *************** *** 47,51 **** } xysize = xsize * ysize; ! for (int i = 0; i < m_channels; i++) { --- 47,51 ---- } xysize = xsize * ysize; ! for (int i = 0; i < m_channels; i++) { *************** *** 55,59 **** } } ! /* import */ for (int i = 0; i < xysize; i++) --- 55,59 ---- } } ! /* import */ for (int i = 0; i < xysize; i++) *************** *** 67,72 **** /* cleanup */ DELETEAR (allpixels); ! return 0; } ! --- 67,72 ---- /* cleanup */ DELETEAR (allpixels); ! return 0; } ! Index: PixmapReader.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PixmapReader.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PixmapReader.cc 10 Aug 2005 09:35:23 -0000 1.2 --- PixmapReader.cc 17 Apr 2008 07:27:34 -0000 1.3 *************** *** 35,39 **** success = readfmt (); } ! switch (success) { --- 35,39 ---- success = readfmt (); } ! switch (success) { Index: tools.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tools.cc 19 Sep 2007 09:35:07 -0000 1.8 --- tools.cc 17 Apr 2008 07:27:34 -0000 1.9 *************** *** 35,38 **** --- 35,44 ---- bool + tools_epsilons (double d1, double d2, double epsilon) + { + return !((d1 > d2) && (d1 - d2 > epsilon) || (d2 - d1 > epsilon)); + } + + bool tools_areaFromString (char a1, char a2, area &result) { Index: Makefile.in =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Makefile.in,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile.in 7 Aug 2007 17:00:58 -0000 1.11 --- Makefile.in 17 Apr 2008 07:27:34 -0000 1.12 *************** *** 53,56 **** --- 53,59 ---- PFIO = PfgReader$O PfgWriter$O PfcReader$O PfcWriter$O endif + ifneq (@MAGICK_INTER_DEF@,) + MIO = MagickInter$O + endif ifneq (@JPEG_DEF@,) JPEGO = JpgReader$O JpgWriter$O *************** *** 115,119 **** # Flags passed to the compiler # ! CPPFLAGS = -I.. -I. @CPPFLAGS@ @PFI_DEF@ @JPEG_DEF@ CXXSHARED = CXXDEBUG = @CXXDEBUG@ --- 118,122 ---- # Flags passed to the compiler # ! CPPFLAGS = -I.. -I. @CPPFLAGS@ @PFI_DEF@ @JPEG_DEF@ @MAGICK_INTER_DEF@ CXXSHARED = CXXDEBUG = @CXXDEBUG@ *************** *** 129,133 **** # OBJS = $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(OBJ7) $(OBJ8) $(OBJ9)\ ! $(OBJA) $(OBJB) $(PFIO) $(JPEGO) SOURCES = $(OBJS:$O=.cc) DEPENDS = $(SOURCES:.cc=.dd) --- 132,136 ---- # OBJS = $(OBJ1) $(OBJ2) $(OBJ3) $(OBJ4) $(OBJ5) $(OBJ6) $(OBJ7) $(OBJ8) $(OBJ9)\ ! $(OBJA) $(OBJB) $(PFIO) $(JPEGO) $(MIO) SOURCES = $(OBJS:$O=.cc) DEPENDS = $(SOURCES:.cc=.dd) Index: PyramidTransform.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/PyramidTransform.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyramidTransform.cc 15 Aug 2007 13:13:57 -0000 1.7 --- PyramidTransform.cc 17 Apr 2008 07:27:34 -0000 1.8 *************** *** 15,19 **** #ifndef _WIN32_WCE #include <iostream> ! #else #include "WImage/miscdefs.h" #endif --- 15,19 ---- #ifndef _WIN32_WCE #include <iostream> ! #else #include "WImage/miscdefs.h" #endif *************** *** 30,34 **** ColumnVector &cv1 = m_image->col (0); ColumnVector &cv2 = m_buffer->col (0); ! int hSize = m_image->cols (); int vSize = m_image->rows (); --- 30,34 ---- ColumnVector &cv1 = m_image->col (0); ColumnVector &cv2 = m_buffer->col (0); ! int hSize = m_image->cols (); int vSize = m_image->rows (); *************** *** 38,42 **** { int level = m_wavelet->level (rv1, rv2, steps); ! if (steps <= 0 || steps > level) { --- 38,42 ---- { int level = m_wavelet->level (rv1, rv2, steps); ! if (steps <= 0 || steps > level) { *************** *** 66,72 **** m_wavelet->anastep (cv1, cv2, vSize); } ! ! vSize = (int)DIV2 (vSize + 1); ! hSize = (int)DIV2 (hSize + 1); } } --- 66,72 ---- m_wavelet->anastep (cv1, cv2, vSize); } ! ! vSize = (int)DIV2 (vSize + 1); ! hSize = (int)DIV2 (hSize + 1); } } *************** *** 97,101 **** } ! for (int i = 1; i < steps; i++) { hSize[i] = DIV2 (hSize[i-1] + 1); --- 97,101 ---- } ! for (int i = 1; i < steps; i++) { hSize[i] = DIV2 (hSize[i-1] + 1); Index: Image.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Image.cc,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Image.cc 24 Aug 2007 15:24:28 -0000 1.27 --- Image.cc 17 Apr 2008 07:27:34 -0000 1.28 *************** *** 36,39 **** --- 36,51 ---- } + bool + Image::epsilonsAt (int abs, coeff value, coeff epsilon) const + { + return tools_epsilons (at (abs), value, epsilon); + } + + bool + Image::epsilonsAt (int y, int x, coeff value, coeff epsilon) const + { + return tools_epsilons (at (y, x), value, epsilon); + } + void Image::valadjust (void) Index: ImageArray.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ImageArray.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ImageArray.cc 7 Aug 2007 17:00:58 -0000 1.7 --- ImageArray.cc 17 Apr 2008 07:27:34 -0000 1.8 *************** *** 18,22 **** #endif #include <stdexcept> ! #include "WImage/miscdefs.h" template <class T> --- 18,22 ---- #endif #include <stdexcept> ! #include "WImage/tools.h" template <class T> *************** *** 178,199 **** for (int col = 0; col < ia.cols (); col++) { ! if (ia.at (row, col) > this->at (row, col)) ! { ! if (ia.at (row, col) - this->at (row, col) > epsilon) ! { ! //cout << "failed1: ia.at (): " << ia.at (row, col) ! // << " - this->at (): " << this->at (row, col) << endl; ! return false; ! } ! } ! else ! { ! if (this->at (row, col) - ia.at (row, col) > epsilon) ! { ! //cout << "failed2: this->at (): " << this->at (row, col) ! // << " - ia.at (): " << ia.at (row, col) << endl; ! return false; ! } ! } } } --- 178,191 ---- for (int col = 0; col < ia.cols (); col++) { ! if (!tools_epsilons (ia.at (row, col), this->at (row, col), epsilon)) ! { ! std::cout << "at " << row << " / " << col ! << ": " ! << "this: " << this->at (row, col) ! << ", that: " << ia.at (row, col) ! << ", diff: " << this->at (row, col) - ia.at (row, col) ! << std::endl; ! return false; ! } } } --- NEW FILE: MagickInter.cc --- /* * Implementation of the image operations utilities * Author: Martin Dietze * * $Date: 2008/04/17 07:27:34 $ * $Revision: 1.1 $ * */ #include "WImage/MagickInter.hh" #include <cstring> #include <iostream> #include <Magick++/Image.h> #include <Magick++/Color.h> #include <Magick++/Geometry.h> using MagickLib::Quantum; #ifdef WIN32 # include <io.h> # define _open open #else # include <unistd.h> #endif #include <fcntl.h> static int tempFileName (char *templ, const char *extension); static std::string tempFileName (const std::string &extension) { std::string theExtension = "." + extension; static char buf[64] = { '\0' }; pid_t pid = getpid(); snprintf (buf, sizeof buf - 1, "util-tmp-%05d-XXXXXX", (int)pid); if (tempFileName (buf, theExtension.c_str ()) < 0) { throw std::invalid_argument ("Could not create temp file"); } return std::string (buf); } static void scaleMagickImage (Magick::Image &img, int rows, int cols) { img.scale (Magick::Geometry ((unsigned)cols, (unsigned)rows)); } static bool isTransparent (const ColorImage &img, int y, int x, coeff *transparentColors) { for (int c = 0; c < img.colors (); ++c) { if (!tools_epsilons (img.channel(c).at (y, x), transparentColors != NULL? transparentColors[c]: -1.0, COEFF_EPSILON)) { return false; } } return true; } static coeff fixCoeff (coeff value, int depth) { return (value < 0? 0: (value > 255.0? 255.0: value)) / depth; } static Magick::ColorRGB colorRGB (const ColorImage &img, int y, int x, int actualColorDepth) { static Magick::ColorRGB color; color.alphaQuantum (0); color.red (fixCoeff (img.channel(0).at (y, x), actualColorDepth)); color.green (fixCoeff (img.channel(1).at (y, x), actualColorDepth)); color.blue (fixCoeff (img.channel(2).at (y, x), actualColorDepth)); return color; } static Magick::ColorGray colorGray (const ColorImage &img, int y, int x, int actualColorDepth) { static Magick::ColorGray color; color.alphaQuantum (0); color.shade (fixCoeff (img.channel(0).at (y, x), actualColorDepth)); return color; } Magick::Image MagickInter::magickImageFromColorImageWithTransparency (ColorImage &img, bool withTransparency, coeff *transparentColors, int colorBytes) { const Magick::Geometry geometry (img.cols (), img.rows ()); const Magick::Color background (0, 0, 0, MaxRGB); Magick::Image image (geometry, background); int actualColorDepth = colorBytes > 0? TWOPOW (8 * colorBytes): TWOPOW (image.depth ()); for (int y = 0; y < img.rows (); ++y) { for (int x = 0; x < img.cols (); ++x) { if (!withTransparency || !isTransparent(img, y, x, transparentColors)) { if (img.colors () == 3) { image.pixelColor (x, y, colorRGB (img, y, x, actualColorDepth)); } else { image.pixelColor (x, y, colorGray (img, y, x, actualColorDepth)); } } } } if (colorBytes > 0) { image.depth (8 * colorBytes); if (img.colors () == 3) { image.quantizeColorSpace (Magick::RGBColorspace); } else { image.quantizeColorSpace (Magick::GRAYColorspace); } image.quantizeColors (actualColorDepth); image.quantize (); } return image; } Magick::Image MagickInter::magickImageFromColorImage (ColorImage &img) { std::string tmp = tempFileName (img.colors () == 1? "pgm": "ppm"); try { img.write (tmp.c_str ()); } catch (const std::ios_base::failure &f) { throw std::ios_base::failure (tmp + ": " + f.what ()); } catch (const std::exception &e) { throw std::invalid_argument (tmp + ": " + e.what ()); } Magick::Image result (tmp); (void)remove (tmp.c_str ()); return result; } std::auto_ptr<ColorImage> MagickInter::colorImageFromMagickImage (Magick::Image &img) { std::string tmp = tempFileName ("ppm"); try { img.write (tmp); std::auto_ptr<ColorImage> result (NEW (ColorImage ())); result->read (tmp.c_str ()); return result; } catch (const std::ios_base::failure &f) { throw std::ios_base::failure (tmp + ": " + f.what ()); } catch (const std::exception &e) { throw std::invalid_argument (tmp + ": " + e.what ()); } throw std::invalid_argument (tmp + ": some other / unknown error."); } std::auto_ptr<ColorImage> MagickInter::obtainColorImage (const std::string &inFile) { std::auto_ptr<ColorImage> img (NEW (ColorImage ())); try { img->read (inFile.c_str ()); } catch (...) { std::string tmp = tempFileName ("ppm"); try { Magick::Image fallBack (inFile); try { fallBack.write (tmp); } catch (const std::ios_base::failure &f) { (void)remove (tmp.c_str ()); throw std::ios_base::failure (tmp + ": " + f.what ()); } catch (const std::exception &e) { (void)remove (tmp.c_str ()); throw std::invalid_argument (tmp + ": " + e.what ()); } catch (...) { (void)remove (tmp.c_str ()); throw; } try { img->read (tmp.c_str ()); (void)remove (tmp.c_str ()); } catch (...) { (void)remove (tmp.c_str ()); throw; } } catch (const std::exception &e) { throw std::ios_base::failure (e.what ()); } } return img; } void MagickInter::writeColorImageWithTransparency (ColorImage &img, const std::string &outFile, int quality, bool withTransparency, coeff *transparentColors, int colorBytes) { try { Magick::Image tmp = MagickInter::magickImageFromColorImageWithTransparency (img, withTransparency, transparentColors, colorBytes); tmp.modifyImage (); if (quality > 0) { tmp.quality (quality); } tmp.write (outFile); } catch (const std::ios_base::failure &f) { throw std::ios_base::failure (outFile + ": " + f.what ()); } catch (const std::exception &e) { throw std::invalid_argument (outFile + ": " + e.what ()); } } void MagickInter::writeColorImage (ColorImage &img, const std::string &outFile, int quality) { try { Magick::Image tmp = MagickInter::magickImageFromColorImage (img); tmp.modifyImage (); if (quality > 0) { tmp.quality (quality); } tmp.write (outFile); } catch (const std::ios_base::failure &f) { throw std::ios_base::failure (outFile + ": " + f.what ()); } catch (const std::exception &e) { throw std::invalid_argument (outFile + ": " + e.what ()); } } void MagickInter::scaleAndWriteColorImage (ColorImage &img, int rows, int cols, const std::string &outFile, int quality) { try { Magick::Image resized = magickImageFromColorImage (img); resized.modifyImage (); if (quality > 0) { //std::cout << "quality: " << quality << std::endl; resized.quality (quality); } scaleMagickImage (resized, rows, cols); resized.write (outFile); } catch (const std::ios_base::failure &f) { throw std::ios_base::failure (outFile + ": " + f.what ()); } catch (const std::exception &e) { throw std::invalid_argument (outFile + ": " + e.what ()); } } // this is copy-and-pasted (gasp) from cxxutil since we don't want this // lib to depend on it... static int tempFileName (char *templ, const char *extension) { static char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; int templen = strlen (templ); int letterlen = strlen (letters); int extenlen = strlen (extension); if(templen < 6) { return -1; } char *p = templ + templen - 6; if (strcmp (p, "XXXXXX") != 0) { return -1; } srand ((unsigned)time (NULL)); int fd; char *fname = NEW (char [templen + extenlen + 1]); strcpy (fname, templ); strcat (fname, extension); p = fname + templen - 6; for (int run = 0; run < 512; run++) { for (int i = 0; i < 6; i++) { p[i] = letters[rand () % letterlen]; } if ((fd = open (fname, O_CREAT | O_EXCL)) > 0) { break; } } if (fd < 0) { DELETE (fname); return -1; } close (fd); (void)remove (fname); strncpy (templ, fname, templen + extenlen); DELETE (fname); return 0; } Index: Makefile.msc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/Makefile.msc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.msc 7 Aug 2007 17:00:58 -0000 1.9 --- Makefile.msc 17 Apr 2008 07:27:34 -0000 1.10 *************** *** 40,43 **** --- 40,46 ---- PFIOBJ = PfgReader$O PfgWriter$O PfcReader$O PfcWriter$O !endif + !ifdef MAGICKINTERDEF + MIOBJ = MagickInter$O + !endif LIBS = #.PHONY: all clean _test _tools tar zip *************** *** 49,63 **** all: wavelet$A @echo Making tools... ! $(MAKE) PFIDEF="$(PFIDEF)" PFILIB="$(PFILIB)" -nologo -f Makefile.msc _tools @echo Done _test: @echo From ze test its beginnink... ! @cd test & $(MAKE) PFIDEF="$(PFIDEF)" PFILIB="$(PFILIB)" -nologo -f Makefile.msc all @echo From ze test its end! _tools: @echo Building in tools... ! cd tools & $(MAKE) PFIDEF="$(PFIDEF)" PFILIB="$(PFILIB)" -nologo -f Makefile.msc all @echo Done. --- 52,66 ---- all: wavelet$A @echo Making tools... ! $(MAKE) MAGICKINTERDEF="$(MAGICKINTERDEF)" PFIDEF="$(PFIDEF)" PFILIB="$(PFILIB)" -nologo -f Makefile.msc _tools @echo Done _test: @echo From ze test its beginnink... ! @cd test & $(MAKE) MAGICKINTERDEF="$(MAGICKINTERDEF)" PFIDEF="$(PFIDEF)" PFILIB="$(PFILIB)" -nologo -f Makefile.msc all @echo From ze test its end! _tools: @echo Building in tools... ! cd tools & $(MAKE) MAGICKINTERDEF="$(MAGICKINTERDEF)" PFIDEF="$(PFIDEF)" PFILIB="$(PFILIB)" -nologo -f Makefile.msc all @echo Done. *************** *** 65,69 **** # Flags passed to the compiler # ! CPPFLAGS = -I. -I../vc6/include $(PFIDEF) -DJPEG -I../jpeg-6b CXXDEBUG = -DDPRINTF="" CXXOPT = -Ox --- 68,72 ---- # Flags passed to the compiler # ! CPPFLAGS = -I. -I../vc6/include $(MAGICKINTERDEF) $(PFIDEF) -DJPEG -I../jpeg-6b CXXDEBUG = -DDPRINTF="" CXXOPT = -Ox Index: WImage.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage.hh,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** WImage.hh 12 Jul 2005 14:52:18 -0000 1.6 --- WImage.hh 17 Apr 2008 07:27:34 -0000 1.7 *************** *** 29,32 **** --- 29,35 ---- #include "WImage/ColorVideo.hh" #include "WImage/VideoFrame.hh" + #ifdef MAGICK_INTER + #include "WImage/MagickInter.hh" + #endif #ifndef _WIN32_WCE #include "WImage/AviReader.hh" Index: ImageInformation.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/ImageInformation.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ImageInformation.cc 7 Aug 2007 17:00:58 -0000 1.5 --- ImageInformation.cc 17 Apr 2008 07:27:34 -0000 1.6 *************** *** 15,30 **** #include <iomanip> #endif ! #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) using namespace std; #endif ! static bool valless (const CoeffInformation *c1, const CoeffInformation *c2); ! static bool avalless (const CoeffInformation *c1, const CoeffInformation *c2); ! static bool posless (const CoeffInformation *c1, const CoeffInformation *c2); ! static bool idless (const CoeffInformation *c1, const CoeffInformation *c2); --- 15,34 ---- #include <iomanip> #endif ! #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) using namespace std; #endif ! static bool valless (const CoeffInformation *c1, const CoeffInformation *c2); ! static bool avalless (const CoeffInformation *c1, const CoeffInformation *c2); ! static bool posless (const CoeffInformation *c1, const CoeffInformation *c2); ! static bool ! yxless (const CoeffInformation *c1, const CoeffInformation *c2); ! static bool ! xyless (const CoeffInformation *c1, const CoeffInformation *c2); ! static bool idless (const CoeffInformation *c1, const CoeffInformation *c2); *************** *** 91,95 **** { assert (newsize >= 0); ! if (newsize > m_size) { --- 95,99 ---- { assert (newsize >= 0); ! if (newsize > m_size) { *************** *** 123,127 **** } ! bool ImageInformation::equals (ImageInformation &ii) { --- 127,131 ---- } ! bool ImageInformation::equals (ImageInformation &ii) { *************** *** 137,141 **** } ! void ImageInformation::gensort (cipredicate isless) { --- 141,145 ---- } ! void ImageInformation::gensort (cipredicate isless) { *************** *** 144,148 **** ! void ImageInformation::ssort (void) { --- 148,152 ---- ! void ImageInformation::ssort (void) { *************** *** 150,154 **** } ! void ImageInformation::asort (void) { --- 154,158 ---- } ! void ImageInformation::asort (void) { *************** *** 156,165 **** } ! void ImageInformation::psort (void) { quicksort (0, m_size - 1, posless); } ! void ImageInformation::isort (void) { --- 160,179 ---- } ! void ImageInformation::psort (void) { quicksort (0, m_size - 1, posless); } ! void ! ImageInformation::yxsort (void) ! { ! quicksort (0, m_size - 1, yxless); ! } ! void ! ImageInformation::xysort (void) ! { ! quicksort (0, m_size - 1, xyless); ! } ! void ImageInformation::isort (void) { *************** *** 167,171 **** } ! void ImageInformation::shuffle (void) { --- 181,185 ---- } ! void ImageInformation::shuffle (void) { *************** *** 181,185 **** } ! bool ImageInformation::ssorted (void) const { --- 195,199 ---- } ! bool ImageInformation::ssorted (void) const { *************** *** 195,199 **** } ! bool ImageInformation::asorted (void) const { --- 209,213 ---- } ! bool ImageInformation::asorted (void) const { *************** *** 203,207 ****... [truncated message content] |
From: Herbert M. D. <he...@us...> - 2008-04-17 07:27:43
|
Update of /cvsroot/wavelet/Wavelet/test In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13454/test Modified Files: Makefile.in Makefile.msc Makefile.watcomc videos.cc wavelet.cc Added Files: magickinter.cc Log Message: Optional support for using ImageMagick's Magick++ classes for reading and writing images, also some minor additions. Index: Makefile.in =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/Makefile.in,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.in 7 Aug 2007 17:01:00 -0000 1.5 --- Makefile.in 17 Apr 2008 07:27:36 -0000 1.6 *************** *** 45,49 **** filename_test image_test wavelet_test coeffinfo_test ntree_test \ imageinfo_test colorimage_test transform_test histogram_test \ ! videos_test imageresizer_test PROGRAMS = $(TESTS:_test=$E) benchmark$E DEPENDS = $(TESTS:_test=.dd) benchmark.dd --- 45,49 ---- filename_test image_test wavelet_test coeffinfo_test ntree_test \ imageinfo_test colorimage_test transform_test histogram_test \ ! videos_test imageresizer_test magickinter_test PROGRAMS = $(TESTS:_test=$E) benchmark$E DEPENDS = $(TESTS:_test=.dd) benchmark.dd *************** *** 117,124 **** @-rm -f harin[0-9][0-9]*.pgm harin-*.vid temp-*.avi # # Flags passed to the compiler # ! CPPFLAGS = -I../.. -I.. @CPPFLAGS@ @PFI_DEF@ @JPEG_DEF@ CXXSHARED = CXXDEBUG = @CXXDEBUG@ --- 117,128 ---- @-rm -f harin[0-9][0-9]*.pgm harin-*.vid temp-*.avi + magickinter_test: magickinter$E + @./$< + @-rm -f out.* + # # Flags passed to the compiler # ! CPPFLAGS = -I../.. -I.. @CPPFLAGS@ @PFI_DEF@ @JPEG_DEF@ @MAGICK_INTER_DEF@ CXXSHARED = CXXDEBUG = @CXXDEBUG@ *************** *** 126,130 **** CXXWARN = @CXXWARN@ CXXMISC = ! LDFLAGS = @LDFLAGS@ @PFI_LIB@ @JPEG_LIB@ -lm CXXFLAGS = $(CPPFLAGS) $(CXXSHARED) $(CXXOPT) $(CXXDEBUG) $(CXXWARN) $(CXXMISC) --- 130,134 ---- CXXWARN = @CXXWARN@ CXXMISC = ! LDFLAGS = @LDFLAGS@ @PFI_LIB@ @MAGICK_INTER_LIB@ @JPEG_LIB@ -lm CXXFLAGS = $(CPPFLAGS) $(CXXSHARED) $(CXXOPT) $(CXXDEBUG) $(CXXWARN) $(CXXMISC) *************** *** 193,196 **** --- 197,203 ---- $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) + magickinter$E: magickinter$O ../libwavelet$A + $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) + ../libwavelet$A: ../*.cc ../*.hh ../Wave/*.hh ../*.h $(MAKE) -C ../ static Index: wavelet.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/wavelet.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wavelet.cc 7 Aug 2007 17:01:00 -0000 1.4 --- wavelet.cc 17 Apr 2008 07:27:36 -0000 1.5 *************** *** 39,43 **** struct filter { FilterSet *filterset; ! char *name; int substeps; } filters[] = { --- 39,43 ---- struct filter { FilterSet *filterset; ! const char *name; int substeps; } filters[] = { Index: videos.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/videos.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** videos.cc 7 Aug 2007 17:01:00 -0000 1.10 --- videos.cc 17 Apr 2008 07:27:36 -0000 1.11 *************** *** 435,439 **** } ! char *fname = "harin.vid"; c = 1; y = 240; --- 435,439 ---- } ! const char *fname = "harin.vid"; c = 1; y = 240; Index: Makefile.watcomc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/Makefile.watcomc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.watcomc 7 Aug 2007 17:01:00 -0000 1.4 --- Makefile.watcomc 17 Apr 2008 07:27:36 -0000 1.5 *************** *** 5,9 **** filename_test image_test wavelet_test coeffinfo_test ntree_test & imageinfo_test colorimage_test transform_test histogram_test & ! videos_test imageresizer_test PROGRAMS = imagearray$E vectors$E position$E imagefile$E filename$E image$E & wavelet$E coeffinfo$E imageinfo$E colorimage$E benchmark$E ntree$E & --- 5,9 ---- filename_test image_test wavelet_test coeffinfo_test ntree_test & imageinfo_test colorimage_test transform_test histogram_test & ! videos_test imageresizer_test magickinter_test PROGRAMS = imagearray$E vectors$E position$E imagefile$E filename$E image$E & wavelet$E coeffinfo$E imageinfo$E colorimage$E benchmark$E ntree$E & *************** *** 11,15 **** OBJECTS = imagearray$O vectors$O position$O imagefile$O filename$O image$O & wavelet$O coeffinfo$O imageinfo$O colorimage$O benchmark$O ntree$O & ! transform$O histogram$O benchmark$O videos$O imageresizer$O CPPFLAGS = -i=.. -i=..\..\pfi -dDPRINTF="" -dPFI -dJPEG --- 11,16 ---- OBJECTS = imagearray$O vectors$O position$O imagefile$O filename$O image$O & wavelet$O coeffinfo$O imageinfo$O colorimage$O benchmark$O ntree$O & ! transform$O histogram$O benchmark$O videos$O imageresizer$O & ! magickinter$O CPPFLAGS = -i=.. -i=..\..\pfi -dDPRINTF="" -dPFI -dJPEG *************** *** 85,88 **** --- 86,93 ---- @-del harin[0-9][0-9]*.pgm harin-*.vid + magickinter_test: magickinter$E .SYMBOLIC + @.\\magickinter$E + @-del out.* + clean : .SYMBOLIC -del $(PROGRAMS) $(OBJECTS) --- NEW FILE: magickinter.cc --- /* * Test program for the class ImageResizer * * $Date: 2008/04/17 07:27:36 $ * $Revision: 1.1 $ * */ #ifdef NDEBUG #undef NDEBUG #endif /* NDEBUG */ #include <iostream> #ifdef MAGICK_INTER // if this feature is not available, we don't do anything! #include "WImage/MagickInter.hh" #include "testing.h" #include <cassert> #include <memory> #include <stdexcept> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) using namespace std; #endif int main (void) { cout << "Testing MagickInter utilities...\n"; std::auto_ptr<ColorImage> ip1 (NEW (ColorImage ())); TEST_NO_EXCEPTION (ip1->read ("christina57.jpg")); // 594x448 TEST_NO_EXCEPTION (MagickInter::writeColorImageWithTransparency (*ip1, "out.png")); std::auto_ptr<ColorImage> ip2 = MagickInter::obtainColorImage ("out.png"); ip1->write ("out1.ppm"); ip2->write ("out2.ppm"); TEST_ASSERT(ip1->epsilons (*ip2, 0.01)); cout << "done.\n"; return 0; } #else int main (void) { std::cout << "No MagickInter support, nothting to do!" << std::endl; return 0; } #endif Index: Makefile.msc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/Makefile.msc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.msc 7 Aug 2007 17:01:00 -0000 1.4 --- Makefile.msc 17 Apr 2008 07:27:36 -0000 1.5 *************** *** 30,37 **** filename_test image_test wavelet_test coeffinfo_test ntree_test \ imageinfo_test colorimage_test transform_test histogram_test \ ! videos_test imageresizer_test PROGRAMS = imagearray$E vectors$E position$E imagefile$E filename$E image$E \ wavelet$E coeffinfo$E imageinfo$E colorimage$E benchmark$E ntree$E \ ! transform$E histogram$E videos$E imageresizer$E tests: $(TESTS) --- 30,37 ---- filename_test image_test wavelet_test coeffinfo_test ntree_test \ imageinfo_test colorimage_test transform_test histogram_test \ ! videos_test imageresizer_test magickinter_test PROGRAMS = imagearray$E vectors$E position$E imagefile$E filename$E image$E \ wavelet$E coeffinfo$E imageinfo$E colorimage$E benchmark$E ntree$E \ ! transform$E histogram$E videos$E imageresizer$E magickinter$E tests: $(TESTS) *************** *** 101,104 **** --- 101,108 ---- @-del harin[0-9][0-9]*.pgm harin-*.vid + magickinter_test: magickinter$E + @.\\magickinter$E + @-del out.* + # # Flags passed to the compiler *************** *** 140,143 **** --- 144,148 ---- videos$E: videos$O imageresizer$E: imageresizer$O + magickinter$E: magickinter$O clean: |
From: Herbert M. D. <he...@us...> - 2008-04-17 07:27:43
|
Update of /cvsroot/wavelet/Wavelet/WImage In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13454/WImage Modified Files: ColorImage.hh Image.hh tools.h Added Files: MagickInter.hh Log Message: Optional support for using ImageMagick's Magick++ classes for reading and writing images, also some minor additions. Index: tools.h =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage/tools.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tools.h 13 Jul 2005 12:13:23 -0000 1.5 --- tools.h 17 Apr 2008 07:27:35 -0000 1.6 *************** *** 33,36 **** --- 33,43 ---- bool tools_equals (double d1, double d2); + /** Return true if two double values are almost equal + * @param d1 the first value + * @param d2 the second value + * @param epsilon the comparison epsilon + * @return true if almost equal */ + bool tools_epsilons (double d1, double d2, double epsilon); + /** Calculate an area from a string split to two characters * @param a1 the first character --- NEW FILE: MagickInter.hh --- /* * Interface of the image operations utilities * Author: Martin Dietze * * $Date: 2008/04/17 07:27:35 $ * $Revision: 1.1 $ * */ #ifndef MAGICK_INTER_H_INCLUDED #define MAGICK_INTER_H_INCLUDED #include <memory> #include <string> #include <WImage/ColorImage.hh> #include <Magick++/Image.h> /** * Helper functions for extended read/write support using the Magick++ classes. * This is motivated by the fact that we want to support many, many file formats * but don't want to spend our time writing import and export filters. * The implementation is quite rudimentary. All conversion is done by saving * and loading temporary files. Also, naturally (as the Wavelet lib does not * have support for this), all meta-information like e.g. transparency is lost. */ namespace MagickInter { /** * Converts a ColorImage to a Magick::Image. * @param img the ColorImage object * @param withTransparency if set to true, the returned image will contain * transparency information according to the original image's colors. * NOTE: this will only work with 3-color images using RGB color model. * @param transparentColors an array of as many members as the image has * color channels. If at a given position the original image's pixel n-tuple * has identical values, the pixel will be considered transparent. The default * value NULL stands for { -1, -1, -1 } * @param colorBytes the number of bytes per pixel (usually 1, i.e. 256 * distinct colors) * @return a corresponding Magick::Image * @exception ios_base:failure if an I/O operation did not succeed (e.g. * non-existent file, insufficient disk space etc.) * @exception invalid_argument for logical errors (e.g. unknown image file * format etc.) */ Magick::Image magickImageFromColorImageWithTransparency (ColorImage &img, bool withTransparency = false, coeff *transparentColors = NULL, int colorBytes = 1); /** * Converts a ColorImage to a Magick::Image. * @param img the ColorImage object * @return a corresponding Magick::Image * @exception ios_base:failure if an I/O operation did not succeed (e.g. * non-existent file, insufficient disk space etc.) * @exception invalid_argument for logical errors (e.g. unknown image file * format etc.) */ Magick::Image magickImageFromColorImage (ColorImage &img); /** * Converts a Magick::Image to a ColorImage. * @param img the Magick::Image object * @return an auto_ptr to the corresponding ColorImage * @exception ios_base:failure if an I/O operation did not succeed (e.g. * non-existent file, insufficient disk space etc.) * @exception invalid_argument for logical errors (e.g. unknown image file * format etc.) */ std::auto_ptr<ColorImage> colorImageFromMagickImage (Magick::Image &img); /** * Creates a ColorImage object for an image in the file system using the Magick * classes. * @param inFile the input file name * @return an auto_ptr to the new ColorImage * @exception ios_base:failure if an I/O operation did not succeed (e.g. * non-existent file, insufficient disk space etc.) * @exception invalid_argument for logical errors (e.g. unknown image file * format etc.) */ std::auto_ptr<ColorImage> obtainColorImage (const std::string &inFile); /** * Writes a ColorImage to any file format using the Magick classes. * @param img the ColorImage object * @param outFile the output file name * @param quality the quality (e.g. JPEG quality) if applicable * @exception ios_base:failure if an I/O operation did not succeed (e.g. * non-existent file, insufficient disk space etc.) * @exception invalid_argument for logical errors (e.g. unknown image file * format etc.) */ void writeColorImage (ColorImage &img, const std::string &outFile, int quality = 100); /** * Writes a ColorImage to any file format using the Magick classes. This * does not use the usual export/import approach but creates an intermediate * Magick image from the scratch. However it should be noted that the result * may differ slightly from the source image due to Magick's quantization. * @param img the ColorImage object * @param outFile the output file name * @param quality the quality (e.g. JPEG quality) if applicable * @param withTransparency if set to true, the returned image will contain * transparency information according to the original image's colors. * NOTE: this will only work with 3-color images using RGB color model. * @param transparentColors an array of as many members as the image has * color channels. If at a given position the original image's pixel n-tuple * has identical values, the pixel will be considered transparent. The default * value NULL stands for { -1, -1, -1 } * @param colorBytes the number of bytes per pixel (usually 1, i.e. 256 * distinct colors) * @exception ios_base:failure if an I/O operation did not succeed (e.g. * non-existent file, insufficient disk space etc.) * @exception invalid_argument for logical errors (e.g. unknown image file * format etc.) */ void writeColorImageWithTransparency (ColorImage &img, const std::string &outFile, int quality = 100, bool withTransparency = false, coeff *transparentColors = NULL, int colorBytes = 1); /** * Rescales and then writes a ColorImage to any file format using * the Magick classes. * @param img the ColorImage object * @param rows the target number of image rows * @param cols the target number of image cols * @param outFile the output file name * @param quality the quality (e.g. JPEG quality) if applicable * @exception ios_base:failure if an I/O operation did not succeed (e.g. * non-existent file, insufficient disk space etc.) * @exception invalid_argument for logical errors (e.g. unknown image file * format etc.) */ void scaleAndWriteColorImage (ColorImage &img, int rows, int cols, const std::string &outFile, int quality = 100); } #endif // MAGICK_INTER_H_INCLUDED Index: Image.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage/Image.hh,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Image.hh 24 Aug 2007 15:24:28 -0000 1.18 --- Image.hh 17 Apr 2008 07:27:35 -0000 1.19 *************** *** 122,125 **** --- 122,149 ---- * if both are identical: {\em true}, else {\em false} */ virtual bool epsilons (Image &img, coeff epsilon) const = 0; + /** Rough comparison. See if an image value is equal to some value according + * to a given {\em epsilon} (important for floating-point comparisons). + * @param y + * the row + * @param x + * the col + * @param value + * the value to compare to + * @param epsilon + * the epsilon + * @return + * if both are identical: {\em true}, else {\em false} */ + bool epsilonsAt (int y, int x, coeff value, coeff epsilon) const; + /** Rough comparison. See if an image value is equal to some value according + * to a given {\em epsilon} (important for floating-point comparisons). + * @param abs + * the absolute position + * @param value + * the value to compare to + * @param epsilon + * the epsilon + * @return + * if both are identical: {\em true}, else {\em false} */ + bool epsilonsAt (int abs, coeff value, coeff epsilon) const; /** Compares two images. Return {\em true} if both are equal. * @param img Index: ColorImage.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WImage/ColorImage.hh,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ColorImage.hh 24 Aug 2007 15:24:28 -0000 1.7 --- ColorImage.hh 17 Apr 2008 07:27:35 -0000 1.8 *************** *** 64,67 **** --- 64,74 ---- inline Image &channel (int num) { return *m_images[num]; } + /** Returns a reference to one of the color channels. + * {\em Don't change the dimensions of single channels unless you know + * what you're doing!} + * @param num the number of the color channel + * @return the color channel as a reference to an Image object */ + inline const Image &channel (int num) const { return *m_images[num]; } + #ifndef _WIN32_WCE /** Read the image. All steps independent of the file format will be |
From: Herbert M. D. <he...@us...> - 2008-04-17 07:27:42
|
Update of /cvsroot/wavelet/Wavelet/tools In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13454/tools Modified Files: Makefile.in Log Message: Optional support for using ImageMagick's Magick++ classes for reading and writing images, also some minor additions. Index: Makefile.in =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/Makefile.in,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.in 15 Aug 2005 17:09:41 -0000 1.7 --- Makefile.in 17 Apr 2008 07:27:36 -0000 1.8 *************** *** 51,55 **** # Flags passed to the compiler # ! CPPFLAGS = -I.. @CPPFLAGS@ @PFI_DEF@ @JPEG_DEF@ CXXSHARED = CXXDEBUG = @CXXDEBUG@ --- 51,55 ---- # Flags passed to the compiler # ! CPPFLAGS = -I.. @CPPFLAGS@ @PFI_DEF@ @JPEG_DEF@ @MAGICK_INTER_DEF@ CXXSHARED = CXXDEBUG = @CXXDEBUG@ *************** *** 57,61 **** CXXMISC = CXXWARN = @CXXWARN@ ! LDFLAGS = -L.. -lwavelet @LDFLAGS@ @PFI_LIB@ @JPEG_LIB@ -lm CXXFLAGS = $(CPPFLAGS) $(CXXSHARED) $(CXXOPT) $(CXXDEBUG) $(CXXWARN) $(CXXMISC) --- 57,61 ---- CXXMISC = CXXWARN = @CXXWARN@ ! LDFLAGS = -L.. -lwavelet @LDFLAGS@ @PFI_LIB@ @MAGICK_INTER_LIB@ @JPEG_LIB@ -lm CXXFLAGS = $(CPPFLAGS) $(CXXSHARED) $(CXXOPT) $(CXXDEBUG) $(CXXWARN) $(CXXMISC) |