New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing C++ functions #1209

Merged
merged 3 commits into from Jan 11, 2019

Conversation

Projects
None yet
3 participants
@kleisauke
Copy link
Member

kleisauke commented Jan 10, 2019

The functions has_alpha() and copy_memory() were missing from the C++ binding.

Add missing C++ functions
The functions has_alpha() and copy_memory() were missing from the C++ binding.
@lovell

lovell approved these changes Jan 10, 2019

@kleisauke

This comment has been minimized.

Copy link
Member

kleisauke commented Jan 10, 2019

Just noticed that a wrapper function for vips_image_remove is also missing.

Shall I add this too? This allows users to use image.remove(VIPS_META_ORIENTATION) instead than vips_image_remove(image.get_image(), VIPS_META_ORIENTATION).

@kleisauke

This comment has been minimized.

Copy link
Member

kleisauke commented Jan 10, 2019

Not related to this PR:
A std::string overload function for new_from_buffer would also be useful, see this example:

std::stringstream svg;
svg << R"(<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100" height="100">)" << '\n'
    << R"(<circle cx="50" cy="50" r="50" />)" << '\n'
    << "</svg>";

std::string svg_mask = svg.str();

/*
This would be useful:
VImage mask = VImage::new_from_buffer(svg_mask, "", VImage::option()->set("access", VIPS_ACCESS_SEQUENTIAL));
*/
VImage mask = VImage::new_from_buffer(reinterpret_cast<void *>(&svg_mask[0u]), svg_mask.size(),
                                      "", VImage::option()->set("access", VIPS_ACCESS_SEQUENTIAL));
Add remove function to the C++ binding
To remove an item of metadata.
@jcupitt

This comment has been minimized.

Copy link
Member

jcupitt commented Jan 11, 2019

Sure, a std::string for new_from_buffer sounds useful!

@kleisauke

This comment has been minimized.

Copy link
Member

kleisauke commented Jan 11, 2019

Done with kleisauke@c397543. Shall I open a separate pull request for that or include it in this PR?

@jcupitt

This comment has been minimized.

Copy link
Member

jcupitt commented Jan 11, 2019

Sure, it's only a small change, let's do it all here.

@kleisauke

This comment has been minimized.

Copy link
Member

kleisauke commented Jan 11, 2019

OK, all done.

@jcupitt jcupitt merged commit f0439fb into libvips:master Jan 11, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jcupitt

This comment has been minimized.

Copy link
Member

jcupitt commented Jan 11, 2019

OK, all looks good! Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment