Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

cntfill.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: cntfill.c,v 1.1 2005/09/09 08:22:22 bellet Exp $ 00003 ************************************************************************** 00004 This software is governed by the CeCILL license under French law and 00005 abiding by the rules of distribution of free software. You can use, 00006 modify and/ or redistribute the software under the terms of the CeCILL 00007 license as circulated by CEA, CNRS and INRIA at the following URL 00008 "http://www.cecill.info". 00009 00010 As a counterpart to the access to the source code and rights to copy, 00011 modify and redistribute granted by the license, users are provided only 00012 with a limited warranty and the software's author, the holder of the 00013 economic rights, and the successive licensors have only limited 00014 liability. 00015 00016 In this respect, the user's attention is drawn to the risks associated 00017 with loading, using, modifying and/or developing or reproducing the 00018 software by the user in light of its specific status of free software, 00019 that may mean that it is complicated to manipulate, and that also 00020 therefore means that it is reserved for developers and experienced 00021 professionals having in-depth computer knowledge. Users are therefore 00022 encouraged to load and test the software's suitability as regards their 00023 requirements in conditions enabling the security of their systems and/or 00024 data to be ensured and, more generally, to use and operate it in the 00025 same conditions as regards security. 00026 00027 The fact that you are presently reading this means that you have had 00028 knowledge of the CeCILL license and that you accept its terms. 00029 00030 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00031 l'Image). All rights reserved. See License.txt for details. 00032 00033 Version 1.0 05/09/2005 00034 *************************************************************************/ 00035 00036 #include <math.h> 00037 #include "idcnt.h" 00038 #include "idima.h" 00039 00056 int 00057 _IdCntDrawPolygonOffset(PCONTOUR_USHORT contour, 00058 int ox, int oy, 00059 PPIMAGE_UCHAR image, 00060 int code, int closed, int greylevel) 00061 { 00062 int i; 00063 int NbPts = IdCntUsedNbX(contour); 00064 if (NbPts < 2) { 00065 return 0; 00066 } 00067 00068 for (i = 0; i < NbPts - 1; i++) { 00069 if (!IdImaDrawLine 00070 (image, greylevel, code, IdCntGetX(contour, i) - ox, 00071 IdCntGetY(contour, i) - oy, IdCntGetX(contour, 00072 i + 1) - ox, 00073 IdCntGetY(contour, i + 1) - oy)) { 00074 return 0; 00075 } 00076 } 00077 if (closed == 1) 00078 if (!IdImaDrawLine 00079 (image, greylevel, code, 00080 IdCntGetX(contour, NbPts - 1) - ox, IdCntGetY(contour, 00081 NbPts - 00082 1) - oy, 00083 IdCntGetX(contour, 0) - ox, IdCntGetY(contour, 00084 0) - 00085 oy)) {return 0; 00086 } 00087 00088 return (1); 00089 } 00090 00102 int 00103 IdCntDrawPolyLine(PCONTOUR_USHORT contour, 00104 PPIMAGE_UCHAR image, 00105 int code, 00106 int greylevel) 00107 { 00108 return _IdCntDrawPolygonOffset(contour, 00109 0,0, image, code, 0, greylevel); 00110 } 00111 00125 int 00126 IdCntDrawPolyLineOffset(PCONTOUR_USHORT contour, 00127 int ox, int oy, 00128 PPIMAGE_UCHAR image, 00129 int code, 00130 int greylevel) 00131 { 00132 return _IdCntDrawPolygonOffset(contour, 00133 ox, oy, image, code, 0, greylevel); 00134 } 00135 00147 int 00148 IdCntDrawPolygon(PCONTOUR_USHORT contour, 00149 PPIMAGE_UCHAR image, 00150 int code, int greylevel) 00151 { 00152 return _IdCntDrawPolygonOffset(contour, 00153 0,0, image, code, 1, greylevel); 00154 } 00155 00169 int 00170 IdCntDrawPolygonOffset(PCONTOUR_USHORT contour, 00171 int ox, int oy, 00172 PPIMAGE_UCHAR image, 00173 int code, int greylevel) 00174 { 00175 return _IdCntDrawPolygonOffset(contour, 00176 ox, oy, image, code, 1, greylevel); 00177 }

Generated on Wed Oct 19 09:28:32 2005 for SIMRI3D by doxygen 1.3.7