Skip to content

Commit cc60419

Browse files
committed
add fill_nearest
1 parent ae1aaca commit cc60419

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ started 8.6.0 16/8/17
22
- add scRGB support
33
- improve radiance support
44
- add composite to alpha menu
5+
- add Image / Select / Fill
56

67
started 8.5.1 22/1/17
78
- fix a crash bug

share/nip2/start/_joe_extra.def

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,41 @@ Select_item = class
362362
}
363363
}
364364

365+
Fill_item = class
366+
Menuaction "_Fill" "fill zero pixels with the nearest non-zero" {
367+
action x = class
368+
Image _result {
369+
_vislevel = 3;
370+
371+
distance = Image _distance;
372+
373+
[_result, _distance] = vips_call "fill_nearest" [x.value] [
374+
"distance" => true
375+
];
376+
}
377+
}
378+
379+
fill_nearest x
380+
= oo_unary_function nearest_op x, is_class x
381+
= near x, is_image x
382+
= error (_ "bad arguments to " ++ "fill_nearest")
383+
{
384+
nearest_op = Operator "fill_nearest"
385+
fill_nearest Operator_type.COMPOUND_REWRAP false;
386+
387+
near x
388+
= [out, distance]
389+
{
390+
[out, distance] = vips_call "fill_nearest" [x] [
391+
"distance" => true
392+
];
393+
}
394+
}
395+
396+
397+
398+
399+
365400
};
366401

367402
////////////////////////////////////////////////////////////////////////////////////

share/nip2/start/_stdenv.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2593,5 +2593,3 @@ hist_entropy x
25932593
];
25942594
}
25952595
}
2596-
2597-

0 commit comments

Comments
 (0)