[Wavelet-commit] Wavelet/WTools ImageResizer.hh,1.3,1.4
Status: Beta
Brought to you by:
herbert
From: Herbert M. D. <he...@us...> - 2007-08-24 15:24:34
|
Update of /cvsroot/wavelet/Wavelet/WTools In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10904/WTools Modified Files: ImageResizer.hh Log Message: New Image::fill() and ColorImage::fill() operations, extensions to the ImageResizer class, the actual resizing after cropping can now be skipped. Index: ImageResizer.hh =================================================================== RCS file: /cvsroot/wavelet/Wavelet/WTools/ImageResizer.hh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ImageResizer.hh 22 Aug 2007 13:34:09 -0000 1.3 --- ImageResizer.hh 24 Aug 2007 15:24:28 -0000 1.4 *************** *** 72,75 **** --- 72,93 ---- /** + * Prepare an image for resizing to x/y dimensions. The result image will be + * cropped to optimally fit in the new dimensions. The maximal percentage + * of cropping as well as the thresholds for guessing insignificant areas + * can be set. This operation skips the actual scaling, so that it can be + * performed by someone else. + * The new dimensions must all be greater than zero. + * @exception invalid_argument + * one or both dimensions are either negative or zero + * @param rows + * the new number of rows + * @param cols + * the new number of cols + * @param steps the number of steps to decompose before checking for features + * @return the new redimensioned image + */ + ColorImage* redimension (int rows, int cols, int steps = 1); + + /** * Return the inner (absolute) average per size (used for quality measurements) * @return the inner average per size *************** *** 195,200 **** /** ! * Create the final result image using the previously calculated number of ! * vectors to discard. * @param rows the number of rows * @param cols the number of cols --- 213,218 ---- /** ! * Create the final unscaled result image using the previously calculated ! * number of vectors to discard. * @param rows the number of rows * @param cols the number of cols *************** *** 207,211 **** * @return the result image */ ! ColorImage* doResizeImage (int rows, int cols, int discardRows, int discardCols); const ColorImage &m_image; --- 225,278 ---- * @return the result image */ ! ColorImage* getUnscaledImage (int rows, int cols, int discardRows, int discardCols); ! ! /** ! * Create the final scaled result image using the previously calculated number ! * of vectors to discard. ! * @param rows the number of rows ! * @param cols the number of cols ! * @param discardRows the number of rows to discard on each side ! * (i.e. we actually discard 2 * discardRows overall); if less than or equal ! * to zero, nothing will be discarded ! * @param discardCols the number of rows to discard on each side ! * (i.e. we actually discard 2 * discardCols overall); if less than or equal ! * to zero, nothing will be discarded ! * @return the result image ! */ ! ColorImage* getScaledImage (int rows, int cols, int discardRows, int discardCols); ! ! /** ! * This operation applies the cropping using the previously calculated numbers ! * of rows or cols which can be safely discarded. ! * @param discardRows the number of rows to discard on each side ! * (i.e. we actually discard 2 * discardRows overall); if less than or equal ! * to zero, nothing will be discarded ! * @param discardCols the number of rows to discard on each side ! * (i.e. we actually discard 2 * discardCols overall); if less than or equal ! * to zero, nothing will be discarded ! * @return the cropped image or a copy of the original if nothing was cropped ! */ ! ColorImage* getCroppedImage (int discardRows, int discardCols); ! ! /** Create a resized image's of x/y dimensions. The result image will be ! * cropped to optimally fit in the new dimensions. The maximal percentage ! * of cropping as well as the thresholds for guessing insignificant areas ! * can be set. If both dimensions are set to 0 and the optimization feature ! * is set, we get an auto-crop (i.e. the size is chosen from the image's ! * contents) ! * The new dimensions must all be greater than zero. ! * @exception invalid_argument ! * one or both dimensions are either negative or zero ! * @param rows ! * the new number of rows ! * @param cols ! * the new number of cols ! * @param steps the number of steps to decompose before checking for features ! * @param redimensionOnly if true, the image will be prepared for scaling, ! * i.e. the dimensions are fixed filling performed etc., so that it can be ! * scaled by some other application later. ! * @return the new resized or prepared image ! */ ! ColorImage* doResize (int rows, int cols, int steps, bool redimensionOnly); const ColorImage &m_image; *************** *** 226,229 **** --- 293,297 ---- double m_rowsMapping; double m_colsMapping; + int m_steps; enum { CROP_COLS, CROP_ROWS, CROP_BOTH_OR_NONE, CROP_AUTOMATICALLY |