/* $Id: cpl_detector-test.c,v 1.12 2007/11/13 13:13:02 llundin Exp $ * * This file is part of the ESO Common Pipeline Library * Copyright (C) 2001-2004 European Southern Observatory * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * $Author: llundin $ * $Date: 2007/11/13 13:13:02 $ * $Revision: 1.12 $ * $Name: $ */ /*----------------------------------------------------------------------------- Includes -----------------------------------------------------------------------------*/ #include #include #include #include #include #include #include "cpl_detector.h" /*----------------------------------------------------------------------------- Define -----------------------------------------------------------------------------*/ #define IMAGESZ 10 #define IMAGESZ2 100 /*----------------------------------------------------------------------------- Main -----------------------------------------------------------------------------*/ int main(void) { cpl_image * im ; double * pi ; const int nbad = 10; /* the bad pixels positions */ const int bad_pos_x[] = {4, 5, 6, 4, 5, 6, 4, 5, 6, 8}; const int bad_pos_y[] = {5, 5, 5, 6, 6, 6, 7, 7, 7, 9}; int pos ; double noise ; double zone[4] ; int i ; cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING); /* Insert tests below */ /* Create the test image */ im = cpl_image_new(IMAGESZ, IMAGESZ, CPL_TYPE_DOUBLE) ; cpl_image_fill_noise_uniform(im, 10, 20) ; pi = cpl_image_get_data_double(im) ; /* Set the bad pixels values */ for (i=0 ; i