parent
3277e26e65
commit
c5a48effa2
16
TODO
16
TODO
|
@ -1,10 +1,6 @@
|
||||||
- add a direct route to flood for label_regions, delay speeding up operation
|
- break vipsflood into a separate struct we can use directly
|
||||||
dispatch for now, seems like a large job
|
|
||||||
|
|
||||||
a direct path can also avoid things like vector_to_ink, which involve
|
same for draw_mask
|
||||||
running a pipeline to generate a single pixel
|
|
||||||
|
|
||||||
almost working
|
|
||||||
|
|
||||||
- it was quick ..
|
- it was quick ..
|
||||||
|
|
||||||
|
@ -14,9 +10,13 @@
|
||||||
user 0m0.173s
|
user 0m0.173s
|
||||||
sys 0m0.031s
|
sys 0m0.031s
|
||||||
|
|
||||||
now incredibly slow
|
best now:
|
||||||
|
|
||||||
|
$ time vips labelregions babe.jpg x.v
|
||||||
|
real 0m3.951s
|
||||||
|
user 0m3.940s
|
||||||
|
sys 0m0.032s
|
||||||
|
|
||||||
can we speed up function dispatch at all?
|
|
||||||
|
|
||||||
- ink to vec etc. should work for complex .. output or accept a double-length
|
- ink to vec etc. should work for complex .. output or accept a double-length
|
||||||
vector
|
vector
|
||||||
|
|
|
@ -548,6 +548,9 @@ vips__draw_flood_direct( VipsImage *image, VipsImage *test,
|
||||||
}
|
}
|
||||||
|
|
||||||
((VipsDraw *) flood)->image = image;
|
((VipsDraw *) flood)->image = image;
|
||||||
|
g_object_ref( image );
|
||||||
|
((VipsDraw *) flood)->lsize = VIPS_IMAGE_SIZEOF_LINE( image );
|
||||||
|
((VipsDraw *) flood)->psize = VIPS_IMAGE_SIZEOF_PEL( image );
|
||||||
|
|
||||||
if( !(((VipsDrawink *) flood)->pixel_ink = VIPS_ARRAY( flood,
|
if( !(((VipsDrawink *) flood)->pixel_ink = VIPS_ARRAY( flood,
|
||||||
VIPS_IMAGE_SIZEOF_PEL( image ), VipsPel )) ) {
|
VIPS_IMAGE_SIZEOF_PEL( image ), VipsPel )) ) {
|
||||||
|
@ -556,12 +559,16 @@ vips__draw_flood_direct( VipsImage *image, VipsImage *test,
|
||||||
}
|
}
|
||||||
*((int *) (((VipsDrawink *) flood)->pixel_ink)) = serial;
|
*((int *) (((VipsDrawink *) flood)->pixel_ink)) = serial;
|
||||||
|
|
||||||
|
flood->x = x;
|
||||||
|
flood->y = y;
|
||||||
flood->test = test;
|
flood->test = test;
|
||||||
|
g_object_ref( test );
|
||||||
|
flood->equal = TRUE;
|
||||||
flood->tsize = VIPS_IMAGE_SIZEOF_PEL( test );
|
flood->tsize = VIPS_IMAGE_SIZEOF_PEL( test );
|
||||||
flood->left = flood->x;
|
flood->left = x;
|
||||||
flood->top = flood->y;
|
flood->top = y;
|
||||||
flood->right = flood->x;
|
flood->right = x;
|
||||||
flood->bottom = flood->y;
|
flood->bottom = y;
|
||||||
flood->in = buffer_build();
|
flood->in = buffer_build();
|
||||||
flood->out = buffer_build();
|
flood->out = buffer_build();
|
||||||
|
|
||||||
|
|
|
@ -88,12 +88,7 @@ vips_labelregions_build( VipsObject *object )
|
||||||
for( y = 0; y < t[1]->Ysize; y++ ) {
|
for( y = 0; y < t[1]->Ysize; y++ ) {
|
||||||
for( x = 0; x < t[1]->Xsize; x++ ) {
|
for( x = 0; x < t[1]->Xsize; x++ ) {
|
||||||
if( !m[x] ) {
|
if( !m[x] ) {
|
||||||
/*
|
/* Use a direct path for speed.
|
||||||
if( vips_draw_flood1( t[1], serial, x, y,
|
|
||||||
"test", in,
|
|
||||||
"equal", TRUE,
|
|
||||||
NULL ) )
|
|
||||||
return( -1 );
|
|
||||||
*/
|
*/
|
||||||
if( vips__draw_flood_direct( t[1], in,
|
if( vips__draw_flood_direct( t[1], in,
|
||||||
serial, x, y ) )
|
serial, x, y ) )
|
||||||
|
|
Loading…
Reference in New Issue