Changeset 12588
- Timestamp:
- Mar 26, 2007, 4:43:22 PM (19 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 2 added
- 4 edited
-
imageops/Makefile.am (modified) (2 diffs)
-
imageops/psImageBinning.c (added)
-
imageops/psImageBinning.h (added)
-
imageops/psImageUnbin.c (modified) (6 diffs)
-
imageops/psImageUnbin.h (modified) (2 diffs)
-
pslib_strict.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/Makefile.am
r12183 r12588 13 13 psImageStructManip.c \ 14 14 psImageMaskOps.c \ 15 psImageBinning.c \ 15 16 psImageUnbin.c 16 17 … … 26 27 psImageStructManip.h \ 27 28 psImageMaskOps.h \ 29 psImageBinning.h \ 28 30 psImageUnbin.h 29 31 -
trunk/psLib/src/imageops/psImageUnbin.c
r11795 r12588 1 /** @file psImageUnbin.c 2 * 3 * @brief Functions to perform unbinning (resampling) of images. 4 * 5 * @ingroup Image 6 * 7 * @author Eugene Magnier, IfA 8 * 9 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-03-27 02:43:22 $ 11 * 12 * Copyright 2007 Institute for Astronomy, University of Hawaii 13 */ 14 1 15 #ifdef HAVE_CONFIG_H 2 16 # include "config.h" … … 4 18 5 19 #include <stdio.h> 6 7 20 #include "psError.h" 21 #include "psAssert.h" 22 #include "psRegion.h" 8 23 #include "psImage.h" 9 #include "ps Assert.h"24 #include "psImageBinning.h" 10 25 #include "psImageUnbin.h" 11 26 … … 15 30 // binned pixel. 16 31 // XXX check that this is still consistent with psphotImageMedian... 17 psImage *psImageUnbin(psImage *out, const psImage *in, int DX, int DY, int dx, int dy)32 psImage *psImageUnbin(psImage *out, const psImage *in, const psImageBinning *binning) 18 33 { 19 34 PS_ASSERT_IMAGE_NON_NULL(in, NULL); 20 35 PS_ASSERT_IMAGE_NON_NULL(out, NULL); 36 37 int DX = binning->nXbin; 38 int DY = binning->nYbin; 39 int dx = binning->nXskip; 40 int dy = binning->nYskip; 41 21 42 PS_ASSERT_INT_POSITIVE(DX, NULL); 22 43 PS_ASSERT_INT_POSITIVE(DY, NULL); … … 28 49 long Nx = out->numCols; 29 50 long Ny = out->numRows; 51 52 // XXX validate the binning structure vs the input and output images? 30 53 31 54 psF32 **vIn = in->data.F32; … … 183 206 * cases should be added 184 207 */ 185 double psImageUnbinPixel(const int ix, const int iy, // desired Unbinned point 208 double psImageUnbinPixel(const int ix, const int iy, // desired Unbinned point (parent coords) 186 209 const psImage *in, // binned image 187 const int DX, const int DY, //!< Scaling factors in x and y 188 const int dx, const int dy) //!< Overhang 210 const psImageBinning *binning) //!< Overhang 189 211 { 212 213 int DX = binning->nXbin; 214 int DY = binning->nYbin; 215 int dx = binning->nXskip; 216 int dy = binning->nYskip; 217 190 218 PS_ASSERT_IMAGE_NON_NULL(in, NAN); 191 219 assert (in->type.type == PS_TYPE_F32); 220 192 221 PS_ASSERT_INT_POSITIVE(DX, NAN); 193 222 PS_ASSERT_INT_POSITIVE(DY, NAN); … … 197 226 * Find which binned pixel we're in 198 227 */ 199 const int Xs = (ix + dx)/DX; // index of binned pixel 200 const int Ys = (iy + dy)/DY; 228 229 const int Xs = (ix - dx)/DX; // index of binned pixel 230 const int Ys = (iy - dy)/DY; 201 231 if (Xs < 0 || Xs >= in->numCols || Ys < 0 || Ys >= in->numRows) { 202 232 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Point (%d,%d) lies outside binned image", ix, iy); -
trunk/psLib/src/imageops/psImageUnbin.h
r11248 r12588 6 6 * @author Robert DeSonia, MHPCC 7 7 * 8 * $Revision: 1. 3$ $Name: not supported by cvs2svn $9 * $Date: 2007-0 1-23 22:47:23$8 * $Revision: 1.4 $ $Name: not supported by cvs2svn $ 9 * $Date: 2007-03-27 02:43:22 $ 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii 11 11 */ … … 17 17 /// @{ 18 18 19 #include "psImage.h"20 21 19 // This needs to be considered more carefully 22 20 psImage *psImageUnbin (psImage *out, //!< Output image 23 21 const psImage *in, //!< Input image 24 int DX, int DY, //!< Scaling factors in x and y25 int dx, int dy //!< Overhang26 ); 22 const psImageBinning *binning ///< binning definition 23 ); 24 27 25 double psImageUnbinPixel(const int ix, const int iy, //!< desired Unbinned point 28 26 const psImage *in, //!< binned image 29 const int DX, const int DY, //!< Scaling factors in x and y 30 const int dx, const int dy //!< Overhang 27 const psImageBinning *binning ///< binning definition 31 28 ); 32 29 -
trunk/psLib/src/pslib_strict.h
r11669 r12588 9 9 * @author Eric Van Alst, MHPCC 10 10 * 11 * @version $Revision: 1.2 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2007-0 2-06 21:55:28$11 * @version $Revision: 1.28 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2007-03-27 02:43:22 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 43 43 //#include "psXML.h" 44 44 45 #include "psRegion.h" 45 46 #include "psImageConvolve.h" 46 47 #include "psImageGeomManip.h" … … 50 51 #include "psImageStructManip.h" 51 52 #include "psImageMaskOps.h" 53 #include "psImageBinning.h" 52 54 #include "psImageUnbin.h" 53 55 … … 65 67 #include "psMinimizePolyFit.h" 66 68 #include "psRandom.h" 67 #include "psRegion.h"68 69 #include "psRegionForImage.h" 69 70 #include "psPolynomial.h"
Note:
See TracChangeset
for help on using the changeset viewer.
