This commit is contained in:
John Cupitt 2010-11-02 14:48:46 +00:00
parent 854bf2e5e3
commit 5283a14575
4 changed files with 16 additions and 22 deletions

13
TODO
View File

@ -1,13 +1,14 @@
- lab [100,0,0] -> srgb [255, 255, 254]? how odd
- scrap im_convsep_f() ... just use im_conv_f() twice
- make im_rank() use IM_SWAP()
- time conv with an s32 intermediate
- could do small masks in a single pass
- im_sharpen() won't use Vector, since it normalises to 100 and will clip
try using a smaller norm factor in sharpen, and maybe nip2 as well for sep
conv gen there?
- Lan's c4_stats.ws is broken, I guess due to vector stuff
- how much time are we spending setting sources by name, profile!

View File

@ -208,9 +208,9 @@ sharpen_mask_new( int radius )
im_free_imask( base );
#ifdef DEBUG
#endif /*DEBUG*/
printf( "sharpen_mask_new: created mask:\n" );
im_print_imask( line );
#endif /*DEBUG*/
return( line );
}

View File

@ -56,12 +56,11 @@ extern "C" {
#define IM_CLIP(A,V,B) IM_MAX( (A), IM_MIN( (B), (V) ) )
#define IM_NUMBER(R) ((int)(sizeof(R)/sizeof(R[0])))
#define IM_SWAP( TYPE, A, B ) \
G_STMT_START { \
#define IM_SWAP( TYPE, A, B ) { \
TYPE t = (A); \
(A) = (B); \
(B) = t; \
} G_STMT_END
}
#define IM_FREEF( F, S ) \
G_STMT_START \

View File

@ -131,12 +131,6 @@ rank_start( IMAGE *out, void *a, void *b )
return( (void *) seq );
}
#define SWAP( TYPE, A, B ) { \
TYPE t = (A); \
(A) = (B); \
(B) = t; \
}
/* Inner loop for select-sorting TYPE.
*/
#define LOOP_SELECT( TYPE ) { \
@ -167,7 +161,7 @@ rank_start( IMAGE *out, void *a, void *b )
*/ \
if( upper - lower == 1 && \
sort[lower] > sort[upper] ) \
SWAP( TYPE, \
IM_SWAP( TYPE, \
sort[lower], sort[upper] ); \
break; \
} \
@ -180,15 +174,15 @@ rank_start( IMAGE *out, void *a, void *b )
* midpoint in sort[lower + 1] for
* partitioning.
*/ \
SWAP( TYPE, sort[lower + 1], sort[mid] ); \
IM_SWAP( TYPE, sort[lower + 1], sort[mid] ); \
if( sort[lower] > sort[upper] ) \
SWAP( TYPE, \
IM_SWAP( TYPE, \
sort[lower], sort[upper] ); \
if( sort[lower + 1] > sort[upper] ) \
SWAP( TYPE, \
IM_SWAP( TYPE, \
sort[lower + 1], sort[upper] );\
if( sort[lower] > sort[lower + 1] ) \
SWAP( TYPE, \
IM_SWAP( TYPE, \
sort[lower], sort[lower + 1] ) \
\
i = lower + 1; \
@ -206,7 +200,7 @@ rank_start( IMAGE *out, void *a, void *b )
while( sort[j] > a ); \
if( j < i ) \
break; \
SWAP( TYPE, sort[i], sort[j] ); \
IM_SWAP( TYPE, sort[i], sort[j] ); \
} \
\
/* Replace mid element.