/* $Id: cpl_image_bpm-test.c,v 1.19 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.19 $ * $Name: $ */ /*----------------------------------------------------------------------------- Includes -----------------------------------------------------------------------------*/ #include #include "cpl_image_bpm.h" #include "cpl_image_gen.h" #include "cpl_image_io.h" #include "cpl_mask.h" #include "cpl_tools.h" #include "cpl_memory.h" /*----------------------------------------------------------------------------- Main -----------------------------------------------------------------------------*/ int main(void) { cpl_image * img; cpl_mask * tmp_map; cpl_mask * map; const int nx = 10; const int ny = 10; 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 i; cpl_test_init(PACKAGE_BUGREPORT, CPL_MSG_WARNING); /* Insert tests below */ /* Generate test image */ cpl_msg_info(cpl_func, "Create a DOUBLE %dx%d test image", nx, ny); img = cpl_image_fill_test_create(nx, ny); /* Set some bad pixels */ cpl_msg_info(cpl_func, "Set %d bad pixels in the test image", nbad); for (i=0; i