Doxygen Source Code Documentation
mri_isgray.c File Reference
#include "mrilib.h"
Go to the source code of this file.
Functions | |
int | mri_isgray (MRI_IMAGE *im) |
Function Documentation
|
Returns 1 if the image is RGB and R=G=B for all voxels, otherwise returns 0. [03 Dec 2003] Definition at line 6 of file mri_isgray.c. References ENTRY, MRI_IMAGE::kind, MRI_RGB_PTR, MRI_IMAGE::nvox, and RETURN. Referenced by mri_read_mpeg().
00007 { 00008 register int nvox , ii ; 00009 register byte *bar ; 00010 00011 ENTRY("mri_isgray") ; 00012 00013 if( im == NULL || im->kind != MRI_rgb ) RETURN( 0 ); 00014 00015 nvox = im->nvox ; 00016 bar = MRI_RGB_PTR(im) ; 00017 for( ii=0 ; ii < nvox ; ii++ ) 00018 if( bar[3*ii] != bar[3*ii+1] || 00019 bar[3*ii] != bar[3*ii+2] ) RETURN( 0 ); 00020 00021 RETURN( 1 ) ; 00022 } |