| 219 | |
| 220 | |
| 221 | CV_IMPL CvSeq* |
| 222 | cvConvexHull2( const CvArr* array, void* hull_storage, |
| 223 | int orientation, int return_points ) |
| 224 | { |
| 225 | union { CvContour* c; CvSeq* s; } hull; |
| 226 | cv::AutoBuffer<CvPoint*> _pointer; |
| 227 | CvPoint** pointer; |
| 228 | CvPoint2D32f** pointerf = 0; |
| 229 | cv::AutoBuffer<int> _stack; |
| 230 | int* stack; |
| 231 | |
| 232 | hull.s = 0; |
| 233 | |
| 234 | CvMat* mat = 0; |
| 235 | CvSeqReader reader; |
| 236 | CvSeqWriter writer; |
| 237 | CvContour contour_header; |
| 238 | union { CvContour c; CvSeq s; } hull_header; |
| 239 | CvSeqBlock block, hullblock; |
| 240 | CvSeq* ptseq = 0; |
| 241 | CvSeq* hullseq = 0; |
| 242 | int is_float; |
| 243 | int* t_stack; |
| 244 | int t_count; |
| 245 | int i, miny_ind = 0, maxy_ind = 0, total; |
| 246 | int hulltype; |
| 247 | int stop_idx; |
| 248 | sklansky_func sklansky; |
| 249 | |
| 250 | if( CV_IS_SEQ( array )) |
| 251 | { |
| 252 | ptseq = (CvSeq*)array; |
| 253 | if( !CV_IS_SEQ_POINT_SET( ptseq )) |
| 254 | CV_Error( CV_StsBadArg, "Unsupported sequence type" ); |
| 255 | if( hull_storage == 0 ) |
| 256 | hull_storage = ptseq->storage; |
| 257 | } |
| 258 | else |
| 259 | { |
| 260 | ptseq = cvPointSeqFromMat( CV_SEQ_KIND_GENERIC, array, &contour_header, &block ); |
| 261 | } |
| 262 | |
| 263 | if( CV_IS_STORAGE( hull_storage )) |
| 264 | { |
| 265 | if( return_points ) |
| 266 | { |
| 267 | hullseq = cvCreateSeq( |
| 268 | CV_SEQ_KIND_CURVE|CV_SEQ_ELTYPE(ptseq)| |
| 269 | CV_SEQ_FLAG_CLOSED|CV_SEQ_FLAG_CONVEX, |
| 270 | sizeof(CvContour), sizeof(CvPoint),(CvMemStorage*)hull_storage ); |
| 271 | } |
| 272 | else |
| 273 | { |
| 274 | hullseq = cvCreateSeq( |
| 275 | CV_SEQ_KIND_CURVE|CV_SEQ_ELTYPE_PPOINT| |
| 276 | CV_SEQ_FLAG_CLOSED|CV_SEQ_FLAG_CONVEX, |
| 277 | sizeof(CvContour), sizeof(CvPoint*), (CvMemStorage*)hull_storage ); |
| 278 | } |
no test coverage detected