|
|
@ -20,6 +20,13 @@ numpy_image<rgb_pixel> load_rgb_image (const std::string &path)
|
|
|
|
return img;
|
|
|
|
return img;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
numpy_image<rgb_pixel> load_rgb_alpha_image (const std::string &path)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
numpy_image<rgb_alpha_pixel> img;
|
|
|
|
|
|
|
|
load_image(img, path);
|
|
|
|
|
|
|
|
return img;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
numpy_image<unsigned char> load_grayscale_image (const std::string &path)
|
|
|
|
numpy_image<unsigned char> load_grayscale_image (const std::string &path)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
numpy_image<unsigned char> img;
|
|
|
|
numpy_image<unsigned char> img;
|
|
|
@ -168,6 +175,10 @@ void bind_numpy_returns(py::module &m)
|
|
|
|
"Saves the given image to the specified path. Determines the file type from the file extension specified in the path",
|
|
|
|
"Saves the given image to the specified path. Determines the file type from the file extension specified in the path",
|
|
|
|
py::arg("img"), py::arg("filename"), py::arg("quality") = 75
|
|
|
|
py::arg("img"), py::arg("filename"), py::arg("quality") = 75
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
m.def("save_image", &save_image<rgb_alpha_pixel>,
|
|
|
|
|
|
|
|
"Saves the given image to the specified path. Determines the file type from the file extension specified in the path",
|
|
|
|
|
|
|
|
py::arg("img"), py::arg("filename"), py::arg("quality") = 75
|
|
|
|
|
|
|
|
);
|
|
|
|
m.def("save_image", &save_image<unsigned char>,
|
|
|
|
m.def("save_image", &save_image<unsigned char>,
|
|
|
|
"Saves the given image to the specified path. Determines the file type from the file extension specified in the path",
|
|
|
|
"Saves the given image to the specified path. Determines the file type from the file extension specified in the path",
|
|
|
|
py::arg("img"), py::arg("filename"), py::arg("quality") = 75
|
|
|
|
py::arg("img"), py::arg("filename"), py::arg("quality") = 75
|
|
|
|