[Wavelet-commit] Wavelet/WTools ImageInformation.hh,1.4,1.5
Status: Beta
Brought to you by:
herbert
From: Herbert M. D. <he...@us...> - 2008-04-17 07:27:42
|
Update of /cvsroot/wavelet/Wavelet/WTools In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13454/WTools Modified Files: ImageInformation.hh Log Message: Optional support for using ImageMagick's Magick++ classes for reading and writing images, also some minor additions. Index: ImageInformation.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WTools/ImageInformation.hh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ImageInformation.hh 12 Jul 2005 14:52:19 -0000 1.4 --- ImageInformation.hh 17 Apr 2008 07:27:35 -0000 1.5 *************** *** 13,22 **** #include "WImage/Image.hh" ! /** ! * @addtogroup WTools * @{ */ /** A comparison function type for coefficients. Different criterions * (e.g. value or index) can be used. */ ! typedef bool (*cipredicate) (const CoeffInformation *c1, const CoeffInformation *c2); --- 13,22 ---- #include "WImage/Image.hh" ! /** ! * @addtogroup WTools * @{ */ /** A comparison function type for coefficients. Different criterions * (e.g. value or index) can be used. */ ! typedef bool (*cipredicate) (const CoeffInformation *c1, const CoeffInformation *c2); *************** *** 33,41 **** * methods for sorting, shuffleing etc. are used for watermark. */ ! class ImageInformation { public: ! /** Constructor. Initializes a number of empty components. * @param size the number of components */ ImageInformation (int size = 0); --- 33,41 ---- * methods for sorting, shuffleing etc. are used for watermark. */ ! class ImageInformation { public: ! /** Constructor. Initializes a number of empty components. * @param size the number of components */ ImageInformation (int size = 0); *************** *** 50,63 **** * the number of stored coeffs */ inline int size (void) const { return m_size; } ! /** Get the first n coeffs. * @param n * the number of coeffs ! * @return * a new info object containing the coeffs */ ImageInformation *head (int n); ! /** Get the last n coeffs. * @param n * the number of coeffs ! * @return * a new info object containing the coeffs */ ImageInformation *tail (int n); --- 50,63 ---- * the number of stored coeffs */ inline int size (void) const { return m_size; } ! /** Get the first n coeffs. * @param n * the number of coeffs ! * @return * a new info object containing the coeffs */ ImageInformation *head (int n); ! /** Get the last n coeffs. * @param n * the number of coeffs ! * @return * a new info object containing the coeffs */ ImageInformation *tail (int n); *************** *** 65,69 **** * @param ii * the other ImageInformation object. ! * @return * a new info object containing the coeffs */ ImageInformation *append (ImageInformation &ii); --- 65,69 ---- * @param ii * the other ImageInformation object. ! * @return * a new info object containing the coeffs */ ImageInformation *append (ImageInformation &ii); *************** *** 71,76 **** * @return * a new info object containing a copy of this */ ! inline ImageInformation *clone (void) { ! return head (m_size); //ImageInformation *ret = new ImageInformation (0); //ret->m_coeffs = new CoeffInformation [m_size]; --- 71,76 ---- * @return * a new info object containing a copy of this */ ! inline ImageInformation *clone (void) { ! return head (m_size); //ImageInformation *ret = new ImageInformation (0); //ret->m_coeffs = new CoeffInformation [m_size]; *************** *** 84,93 **** /** Shrink (discard some of the coeffs). * @param newsize ! * the new number of coeffs, if greater than the actual size, the * operation has no effect * @param leavehead * if {\em true} discard from behind, else discard from the top */ void shrink (int newsize, bool leavehead = true); ! /** Equality test. * @param ii * other info object --- 84,93 ---- /** Shrink (discard some of the coeffs). * @param newsize ! * the new number of coeffs, if greater than the actual size, the * operation has no effect * @param leavehead * if {\em true} discard from behind, else discard from the top */ void shrink (int newsize, bool leavehead = true); ! /** Equality test. * @param ii * other info object *************** *** 99,111 **** * @param pos * the info's position in this object (array index) ! * @return * a reference to the coeff info node */ inline CoeffInformation &at (int pos) { return m_coeffs[pos]; } /** Set a position from a CoeffInformation object. ! * @param c * the CoeffInformation object * @param pos * the info's position in this object (array index) */ inline void to (CoeffInformation &c, int pos) { m_coeffs[pos] = c; } /** Resize the object preserving as many old values as possible. * @param size the new size */ --- 99,117 ---- * @param pos * the info's position in this object (array index) ! * @return * a reference to the coeff info node */ inline CoeffInformation &at (int pos) { return m_coeffs[pos]; } /** Set a position from a CoeffInformation object. ! * @param c * the CoeffInformation object * @param pos * the info's position in this object (array index) */ inline void to (CoeffInformation &c, int pos) { m_coeffs[pos] = c; } + /** Set a position from a CoeffInformation object. + * @param c + * the CoeffInformation object + * @param pos + * the info's position in this object (array index) */ + inline void to (const CoeffInformation &c, int pos) { m_coeffs[pos] = c; } /** Resize the object preserving as many old values as possible. * @param size the new size */ *************** *** 118,122 **** void swap (int pos1, int pos2); ! /** Sort the coeffs according to their values. * @param isless * the comparison function to use. */ --- 124,128 ---- void swap (int pos1, int pos2); ! /** Sort the coeffs according to their values. * @param isless * the comparison function to use. */ *************** *** 128,131 **** --- 134,141 ---- /** Sort the coeffs according to their absolute positions in the image. */ void psort (void); + /** Sort the coeffs according to their rows/cols positions in the image. */ + void yxsort (void); + /** Sort the coeffs according to their cols/rows positions in the image. */ + void xysort (void); /** Sort the coeffs according to their IDs. */ void isort (void); *************** *** 157,166 **** * @return true if the position was found */ inline bool isIn (int y, int x) const { return locate (y, x) >= 0; } ! /** Returns true a position's index if it is is in this * ImageInformation object. * @param abs the absolute position in the image * @return the index if found, else -1 */ ! int locate (int abs) const; ! /** Returns true a position's index if it is is in this * ImageInformation object. * @param y the row in the image --- 167,176 ---- * @return true if the position was found */ inline bool isIn (int y, int x) const { return locate (y, x) >= 0; } ! /** Returns true a position's index if it is is in this * ImageInformation object. * @param abs the absolute position in the image * @return the index if found, else -1 */ ! int locate (int abs) const; ! /** Returns true a position's index if it is is in this * ImageInformation object. * @param y the row in the image *************** *** 184,201 **** * the minimum value */ coeff smin (void); ! #ifndef _WIN32_WCE ! /** Write the contents to stdout or a file. * @exception ios_base::failure if the file could not be opened for writing. ! * @param delim what to print between two entries * @param file the name of the file (empty string for stdout) */ void dump (const char *delim = " ", const char *file = "") const; #endif ! /** Return the average absolute greyscale value. * @return the average absolute greyscale value */ coeff aaverage (void) const; ! /** Return the average (signed) greyscale value. * @return the average greyscale value */ coeff saverage (void) const; --- 194,211 ---- * the minimum value */ coeff smin (void); ! #ifndef _WIN32_WCE ! /** Write the contents to stdout or a file. * @exception ios_base::failure if the file could not be opened for writing. ! * @param delim what to print between two entries * @param file the name of the file (empty string for stdout) */ void dump (const char *delim = " ", const char *file = "") const; #endif ! /** Return the average absolute greyscale value. * @return the average absolute greyscale value */ coeff aaverage (void) const; ! /** Return the average (signed) greyscale value. * @return the average greyscale value */ coeff saverage (void) const; *************** *** 210,214 **** double variance (bool abs = false) const; ! /** Returns the standard deviation. * @param abs true if signs are discarded. * @return the standard deviation. */ --- 220,224 ---- double variance (bool abs = false) const; ! /** Returns the standard deviation. * @param abs true if signs are discarded. * @return the standard deviation. */ *************** *** 216,220 **** #ifdef USE_DEPRECATED_API ! /** Equality test. * @param ii * other info object --- 226,230 ---- #ifdef USE_DEPRECATED_API ! /** Equality test. * @param ii * other info object *************** *** 229,233 **** /** The number of coeffs. */ int m_size; ! /** Obtain a subset of the coeffs. * @param coeffs * the address of the CoeffInformation array to write to --- 239,243 ---- /** The number of coeffs. */ int m_size; ! /** Obtain a subset of the coeffs. * @param coeffs * the address of the CoeffInformation array to write to *************** *** 238,242 **** * the bottom */ void copyCoeffs (CoeffInformation *coeffs, int size, bool head); ! /** Obtain a new info object containging a subset of the coeffs. * @param size * the number of coeffs to be stored --- 248,252 ---- * the bottom */ void copyCoeffs (CoeffInformation *coeffs, int size, bool head); ! /** Obtain a new info object containging a subset of the coeffs. * @param size * the number of coeffs to be stored *************** *** 255,259 **** * the pseudo-random number */ int randint (int from, int to); ! /** Sort the coefficients. A Quicksort algorithm according to * Jon Bentley. * @param from --- 265,269 ---- * the pseudo-random number */ int randint (int from, int to); ! /** Sort the coefficients. A Quicksort algorithm according to * Jon Bentley. * @param from *************** *** 262,269 **** * the end index (included in sort) * @param isless ! * the the comparison function, {\em true} when the left arg is * less than the right one */ void quicksort (int from, int to, cipredicate isless); ! }; /* class ImageInformation */ --- 272,279 ---- * the end index (included in sort) * @param isless ! * the the comparison function, {\em true} when the left arg is * less than the right one */ void quicksort (int from, int to, cipredicate isless); ! }; /* class ImageInformation */ |