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

imabasic.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: imabasic.c,v 1.1 2005/09/09 08:22:45 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 "idima.h" 00037 00049 int 00050 IdImaUsedNbY(void * image) 00051 { 00052 return ( _IdImaPrivate(image)->UsedNbY); 00053 } 00054 00061 int 00062 IdImaGetUsedNbY(void * image) 00063 { 00064 return IdImaUsedNbY(image); 00065 } 00066 00078 int 00079 IdImaUsedNbX(void * image) 00080 { 00081 return ( _IdImaPrivate(image)->UsedNbX); 00082 } 00083 00090 int 00091 IdImaGetUsedNbX(void * image) 00092 { 00093 return IdImaUsedNbX(image); 00094 } 00095 00103 int 00104 IdImaDimY(void * image) 00105 { 00106 return ( _IdImaPrivate(image)->DimY); 00107 } 00108 00116 int 00117 IdImaDimX(void * image) 00118 { 00119 return ( _IdImaPrivate(image)->DimX); 00120 } 00121 00128 int 00129 IdImaBitsPerPixel(void * image) 00130 { 00131 return ( _IdImaPrivate(image)->BitsPerPixel); 00132 } 00133 00141 int 00142 IdImaType(void * image) 00143 { 00144 return ( _IdImaPrivate(image)->Type); 00145 } 00146 00154 void 00155 IdImaSetUsedNbY(void * image, int usedNby) 00156 { 00157 _IdImaPrivate(image)->UsedNbY = usedNby; 00158 } 00159 00167 void 00168 IdImaSetUsedNbX(void * image, int usedNbx) 00169 { 00170 _IdImaPrivate(image)->UsedNbX = usedNbx; 00171 } 00172 00183 void 00184 IdImaSetDimY(void * image, int height) 00185 { 00186 _IdImaPrivate(image)->DimY = height; 00187 } 00188 00199 void 00200 IdImaSetDimX(void * image, int width) 00201 { 00202 _IdImaPrivate(image)->DimX = width; 00203 } 00204 00211 void 00212 IdImaSetBitsPerPixel(void * image, int bits) 00213 { 00214 _IdImaPrivate(image)->BitsPerPixel = bits; 00215 } 00216 00223 void 00224 IdImaSetType(void * image, int type) 00225 { 00226 _IdImaPrivate(image)->Type = type; 00227 } 00228 00238 int 00239 IdImaGetBit(char ** image, int x, int y) 00240 { 00241 return (((image)[y][(x)>>3]>>((x)&7) )&1); 00242 } 00243 00253 void 00254 IdImaPutBit(char ** image, int x, int y, int val) 00255 { 00256 val ? ( ((image)[y][x>>3])|= (1<<( x &7) ) ) 00257 : ( ((image)[y][x>>3])&=~(1<<( x &7) ) ); 00258 } 00259 00268 int 00269 IdImaSameSize(void *image1, void *image2) 00270 { 00271 return ( ( image1 && image2 ) 00272 && ( IdImaDimX(image1) == IdImaDimX(image2) ) 00273 && ( IdImaDimY(image1) == IdImaDimY(image2) ) ); 00274 } 00275 00284 int 00285 IdImaSameType(void *image1, void *image2) 00286 { 00287 return ( ( image1 && image2 ) 00288 && ( IdImaType(image1) == IdImaType(image2) ) ); 00289 } 00290 00300 int 00301 IdImaSameSizeAndType(void *image1, void *image2) 00302 { 00303 return ( ( image1 && image2 ) 00304 && ( IdImaDimX(image1) == IdImaDimX(image2) ) 00305 && ( IdImaDimY(image1) == IdImaDimY(image2) ) 00306 && ( IdImaType(image1) == IdImaType(image2) ) ); 00307 }

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