add more C++ convenience functions

flipver() etc.
This commit is contained in:
John Cupitt 2015-04-24 10:10:44 +01:00
parent 3bad0528be
commit ad017dc56f
3 changed files with 60 additions and 13 deletions

View File

@ -1,7 +1,7 @@
11/2/15 started 8.0
- remove old doc stuff, lots of doc improvements
- add fliphor(), flipver(), rot90(), rot180(), rot270() convenience methods to
Python
- add fliphor(), flipver(), rot90(), rot180(), rot270(), median(), dilate(),
erode() convenience methods to Python and C++
- python: use [] to index and slice image bands, use () to get a point
- c++: use [] to band index, () returns a vector<double>
- add shift option to cast

11
TODO
View File

@ -1,11 +1,3 @@
- try:
vips embed k2.jpg x.jpg 10 10 1000 1000 --vips-cache-trace
we don't seem to show all ops or images, can we improve this?
- does cplusplus need flipver() etc.?
- are the mosaic functions calling vips_fastcor()? it must be very slow
@ -22,9 +14,6 @@
then im__chkpair() runs that 20 times, then loops ... oh dear
- make a crappy gir_ffi patch to add unset for GValue, perhaps it will produce
a response
- perhaps im_maxpos_subpel() / im_minpos_subpel() should be undeprecated,
useful with vips_fastcor()

View File

@ -557,6 +557,64 @@ public:
std::complex<double> maxpos( VOption *options = 0 )
throw( VError );
VImage
fliphor( VOption *options = 0 )
throw( VError )
{
return( flip( VIPS_DIRECTION_HORIZONTAL, options ) );
}
VImage
flipver( VOption *options = 0 )
throw( VError )
{
return( flip( VIPS_DIRECTION_VERTICAL, options ) );
}
VImage
rot90( VOption *options = 0 )
throw( VError )
{
return( rot( VIPS_ANGLE_D90, options ) );
}
VImage
rot180( VOption *options = 0 )
throw( VError )
{
return( rot( VIPS_ANGLE_D180, options ) );
}
VImage
rot270( VOption *options = 0 )
throw( VError )
{
return( rot( VIPS_ANGLE_D270, options ) );
}
VImage
dilate( VImage mask, VOption *options = 0 )
throw( VError )
{
return( morph( mask, VIPS_OPERATION_MORPHOLOGY_DILATE,
options ) );
}
VImage
erode( VImage mask, VOption *options = 0 )
throw( VError )
{
return( morph( mask, VIPS_OPERATION_MORPHOLOGY_ERODE,
options ) );
}
VImage
median( int size = 3, VOption *options = 0 )
throw( VError )
{
return( rank( size, size, (size * size) / 2, options ) );
}
VImage
floor( VOption *options = 0 )
throw( VError )