33 light->region.projection_roi.Area() <= 0) {
41 int xl = light->region.projection_roi.x;
42 int yt = light->region.projection_roi.y;
43 int xr = xl + light->region.projection_roi.width - 1;
44 int yb = yt + light->region.projection_roi.height - 1;
47 int center_x = (xr + xl) / 2;
48 int center_y = (yb + yt) / 2;
50 static_cast<int>(crop_scale_ *
static_cast<float>(std::max(
51 light->region.projection_roi.width,
52 light->region.projection_roi.height)));
54 resize = std::max(resize, min_crop_size_);
55 resize = std::min(resize, width);
56 resize = std::min(resize, height);
59 xl = center_x - resize / 2 + 1;
60 xl = (xl < 0) ? 0 : xl;
61 yt = center_y - resize / 2 + 1;
62 yt = (yt < 0) ? 0 : yt;
77 crop_box->
width = xr - xl + 1;
78 crop_box->
height = yb - yt + 1;