yading@10: /* yading@10: * Copyright (c) 2005 Robert Edele yading@10: * yading@10: * This file is part of FFmpeg. yading@10: * yading@10: * FFmpeg is free software; you can redistribute it and/or yading@10: * modify it under the terms of the GNU Lesser General Public yading@10: * License as published by the Free Software Foundation; either yading@10: * version 2.1 of the License, or (at your option) any later version. yading@10: * yading@10: * FFmpeg is distributed in the hope that it will be useful, yading@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@10: * Lesser General Public License for more details. yading@10: * yading@10: * You should have received a copy of the GNU Lesser General Public yading@10: * License along with FFmpeg; if not, write to the Free Software yading@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@10: */ yading@10: yading@10: #ifndef AVFILTER_BBOX_H yading@10: #define AVFILTER_BBOX_H yading@10: yading@10: #include yading@10: yading@10: typedef struct { yading@10: int x1, x2, y1, y2; yading@10: } FFBoundingBox; yading@10: yading@10: /** yading@10: * Calculate the smallest rectangle that will encompass the yading@10: * region with values > min_val. yading@10: * yading@10: * @param bbox bounding box structure which is updated with the found values. yading@10: * If no pixels could be found with value > min_val, the yading@10: * structure is not modified. yading@10: * @return 1 in case at least one pixel with value > min_val was found, yading@10: * 0 otherwise yading@10: */ yading@10: int ff_calculate_bounding_box(FFBoundingBox *bbox, yading@10: const uint8_t *data, int linesize, yading@10: int w, int h, int min_val); yading@10: yading@10: #endif /* AVFILTER_BBOX_H */