Skip to content
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

Actually load rgb_alpha images. #2942

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tools/python/src/numpy_returns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ numpy_image<rgb_pixel> load_rgb_image (const std::string &path)
return img;
}

numpy_image<rgb_pixel> load_rgb_alpha_image (const std::string &path)
numpy_image<rgb_alpha_pixel> load_rgb_alpha_image (const std::string &path)
{
numpy_image<rgb_alpha_pixel> img;
load_image(img, path);
Expand Down Expand Up @@ -166,6 +166,11 @@ void bind_numpy_returns(py::module &m)
py::arg("filename")
);

m.def("load_rgb_alpha_image", &load_rgb_alpha_image,
"Takes a path and returns a numpy array (RGBA) containing the image",
py::arg("filename")
);

m.def("load_grayscale_image", &load_grayscale_image,
"Takes a path and returns a numpy array containing the image, as an 8bit grayscale image.",
py::arg("filename")
Expand Down
Loading