22#ifndef LSST_AFW_IMAGE_PYTHON_INDEXING_H
23#define LSST_AFW_IMAGE_PYTHON_INDEXING_H
25#include "pybind11/pybind11.h"
28namespace lsst {
namespace afw {
namespace image {
namespace python {
31 if (!
bbox.contains(index)) {
32 std::string msg = (boost::format(
"Index (%d, %d) outside image bounds (%d, %d) to (%d, %d).")
33 % index.getX() % index.getY() %
bbox.getMinX() %
bbox.getMinY()
35 if (index.getX() < 0 || index.getY() < 0) {
36 msg +=
" Note that negative indices are only interpreted as relative to the upper bound "
37 "when LOCAL coordinates are used.";
39 PyErr_SetString(PyExc_IndexError, msg.
c_str());
40 throw pybind11::error_already_set();
void checkBounds(geom::Point2I const &index, geom::Box2I const &bbox)