im_measure() works on labq

the old im_measure() woprked on labq images, make the wrapper work on
labq too
This commit is contained in:
John Cupitt 2012-03-01 13:45:57 +00:00
parent 3b6691dd57
commit 20a916e4fa

@ -153,27 +153,6 @@ internal_im_measure_area( IMAGE *im,
{
DOUBLEMASK *mask;
/* Check input image.
*/
if( im->Coding == IM_CODING_LABQ ) {
IMAGE *t1;
if( !(t1 = im_open( "measure-temp", "p" )) )
return( NULL );
if( im_LabQ2Lab( im, t1 ) ||
!(mask = im_measure_area( t1,
left, top, width, height,
u, v,
sel, nsel, name )) ) {
im_close( t1 );
return( NULL );
}
im_close( t1 );
return( mask );
}
if( im_check_uncoded( "im_measure", im ) ||
im_check_noncomplex( "im_measure", im ) )
return( NULL );
@ -212,6 +191,26 @@ im_measure_area( IMAGE *im,
int u, int v,
int *sel, int nsel, const char *name )
{
/* The old im_measure() worked on labq.
*/
if( im->Coding == IM_CODING_LABQ ) {
IMAGE *t1;
if( !(t1 = im_open( "measure-temp", "p" )) )
return( NULL );
if( im_LabQ2Lab( im, t1 ) ||
!(mask = im_measure_area( t1,
left, top, width, height,
u, v,
sel, nsel, name )) ) {
im_close( t1 );
return( NULL );
}
im_close( t1 );
return( mask );
}
if( sel )
return( internal_im_measure_area( im,
left, top, width, height, u, v, sel, nsel, name ) );