Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd7fcf5

Browse files
committed
redo im_rank() as a class
1 parent cb96ed8 commit cd7fcf5

File tree

9 files changed

+539
-436
lines changed

9 files changed

+539
-436
lines changed

ChangeLog

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
- vips_colourspace() allows B_W, GREY16, RGB16 as source / target
3838
- added vips_thread_shutdown(), thanks Lovell
3939
- vips_linear() has a uchar output mode
40-
- redone im_cntlines() as a class
40+
- redone im_cntlines(), im_rank() as classes
4141

4242
9/1/14 started 7.36.6
4343
- fix some clang compiler warnings

libvips/deprecated/vips7compat.c

+17
Original file line numberDiff line numberDiff line change
@@ -4497,3 +4497,20 @@ im_cntlines( VipsImage *im, double *nolines, int flag )
44974497
VIPS_DIRECTION_HORIZONTAL : VIPS_DIRECTION_VERTICAL,
44984498
NULL ) );
44994499
}
4500+
4501+
int
4502+
im_rank( IMAGE *in, IMAGE *out, int width, int height, int index )
4503+
{
4504+
VipsImage *x;
4505+
4506+
if( vips_rank( in, &x, width, height, index, NULL ) )
4507+
return( -1 );
4508+
4509+
if( im_copy( x, out ) ) {
4510+
g_object_unref( x );
4511+
return( -1 );
4512+
}
4513+
g_object_unref( x );
4514+
4515+
return( 0 );
4516+
}

libvips/include/vips/morphology.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,15 @@ int vips_countlines( VipsImage *in, double *nolines,
4242
VipsDirection direction, ... )
4343
__attribute__((sentinel));
4444

45+
int vips_rank( VipsImage *in, VipsImage **out,
46+
int width, int height, int index, ... )
47+
__attribute__((sentinel));
48+
int vips_median( VipsImage *in, VipsImage **out, int size, ... )
49+
__attribute__((sentinel));
4550

4651

4752

4853

49-
int im_rank( VipsImage *in, VipsImage *out, int width, int height, int index );
50-
5154
int im_zerox( VipsImage *in, VipsImage *out, int sign );
5255
int im_label_regions( VipsImage *test, VipsImage *mask, int *segments );
5356

libvips/include/vips/vips7compat.h

+1
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,7 @@ int im_fractsurf( VipsImage *out, int size, double frd );
976976
int im_phasecor_fft( VipsImage *in1, VipsImage *in2, VipsImage *out );
977977

978978
int im_cntlines( VipsImage *im, double *nolines, int flag );
979+
int im_rank( VipsImage *in, VipsImage *out, int width, int height, int index );
979980

980981
#ifdef __cplusplus
981982
}

libvips/morphology/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ noinst_LTLIBRARIES = libmorphology.la
33
libmorphology_la_SOURCES = \
44
morphology.c \
55
countlines.c \
6+
rank.c \
67
hitmiss.c\
7-
im_rank.c \
88
im_zerox.c \
99
morph_dispatch.c \
1010
im_label_regions.c

0 commit comments

Comments
 (0)