overlayWith improvements: diff sizes/formats, gravity, buffer input

This commit is contained in:
Lovell Fuller
2016-02-29 14:30:29 +00:00
parent 55f204c6f9
commit d92ea31858
21 changed files with 407 additions and 242 deletions

View File

@@ -2,6 +2,8 @@
#define SRC_COMMON_H_
#include <string>
#include <tuple>
#include <vips/vips8>
using vips::VImage;
@@ -80,6 +82,13 @@ namespace sharp {
*/
void FreeCallback(char* data, void* hint);
/*
Calculate the (left, top) coordinates of the output image
within the input image, applying the given gravity.
*/
std::tuple<int, int> CalculateCrop(int const inWidth, int const inHeight,
int const outWidth, int const outHeight, int const gravity);
} // namespace sharp
#endif // SRC_COMMON_H_