| 226 | } |
| 227 | |
| 228 | py::array as_grayscale( |
| 229 | const py::array& img |
| 230 | ) |
| 231 | { |
| 232 | if (is_image<rgb_pixel>(img)) |
| 233 | { |
| 234 | numpy_image<unsigned char> out; |
| 235 | assign_image(out, numpy_image<rgb_pixel>(img)); |
| 236 | return out; |
| 237 | } |
| 238 | else |
| 239 | { |
| 240 | return img; |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | // ---------------------------------------------------------------------------------------- |
| 245 |
nothing calls this directly
no test coverage detected