Subdiv2D.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. //
  2. // This file is auto-generated. Please don't modify it!
  3. //
  4. #pragma once
  5. #ifdef __cplusplus
  6. //#import "opencv.hpp"
  7. #import "opencv2/imgproc.hpp"
  8. #else
  9. #define CV_EXPORTS
  10. #endif
  11. #import <Foundation/Foundation.h>
  12. @class Float4;
  13. @class Float6;
  14. @class IntVector;
  15. @class Point2f;
  16. @class Rect2i;
  17. NS_ASSUME_NONNULL_BEGIN
  18. // C++: class Subdiv2D
  19. /**
  20. * The Subdiv2D module
  21. *
  22. * Member of `Imgproc`
  23. */
  24. CV_EXPORTS @interface Subdiv2D : NSObject
  25. #ifdef __cplusplus
  26. @property(readonly)cv::Ptr<cv::Subdiv2D> nativePtr;
  27. #endif
  28. #ifdef __cplusplus
  29. - (instancetype)initWithNativePtr:(cv::Ptr<cv::Subdiv2D>)nativePtr;
  30. + (instancetype)fromNative:(cv::Ptr<cv::Subdiv2D>)nativePtr;
  31. #endif
  32. #pragma mark - Class Constants
  33. @property (class, readonly) int PTLOC_ERROR NS_SWIFT_NAME(PTLOC_ERROR);
  34. @property (class, readonly) int PTLOC_OUTSIDE_RECT NS_SWIFT_NAME(PTLOC_OUTSIDE_RECT);
  35. @property (class, readonly) int PTLOC_INSIDE NS_SWIFT_NAME(PTLOC_INSIDE);
  36. @property (class, readonly) int PTLOC_VERTEX NS_SWIFT_NAME(PTLOC_VERTEX);
  37. @property (class, readonly) int PTLOC_ON_EDGE NS_SWIFT_NAME(PTLOC_ON_EDGE);
  38. @property (class, readonly) int NEXT_AROUND_ORG NS_SWIFT_NAME(NEXT_AROUND_ORG);
  39. @property (class, readonly) int NEXT_AROUND_DST NS_SWIFT_NAME(NEXT_AROUND_DST);
  40. @property (class, readonly) int PREV_AROUND_ORG NS_SWIFT_NAME(PREV_AROUND_ORG);
  41. @property (class, readonly) int PREV_AROUND_DST NS_SWIFT_NAME(PREV_AROUND_DST);
  42. @property (class, readonly) int NEXT_AROUND_LEFT NS_SWIFT_NAME(NEXT_AROUND_LEFT);
  43. @property (class, readonly) int NEXT_AROUND_RIGHT NS_SWIFT_NAME(NEXT_AROUND_RIGHT);
  44. @property (class, readonly) int PREV_AROUND_LEFT NS_SWIFT_NAME(PREV_AROUND_LEFT);
  45. @property (class, readonly) int PREV_AROUND_RIGHT NS_SWIFT_NAME(PREV_AROUND_RIGHT);
  46. #pragma mark - Methods
  47. //
  48. // cv::Subdiv2D::Subdiv2D()
  49. //
  50. /**
  51. * creates an empty Subdiv2D object.
  52. * To create a new empty Delaunay subdivision you need to use the #initDelaunay function.
  53. */
  54. - (instancetype)init;
  55. //
  56. // cv::Subdiv2D::Subdiv2D(Rect rect)
  57. //
  58. /**
  59. *
  60. *
  61. * @param rect Rectangle that includes all of the 2D points that are to be added to the subdivision.
  62. *
  63. * The function creates an empty Delaunay subdivision where 2D points can be added using the function
  64. * insert() . All of the points to be added must be within the specified rectangle, otherwise a runtime
  65. * error is raised.
  66. */
  67. - (instancetype)initWithRect:(Rect2i*)rect;
  68. //
  69. // void cv::Subdiv2D::initDelaunay(Rect rect)
  70. //
  71. /**
  72. * Creates a new empty Delaunay subdivision
  73. *
  74. * @param rect Rectangle that includes all of the 2D points that are to be added to the subdivision.
  75. */
  76. - (void)initDelaunay:(Rect2i*)rect NS_SWIFT_NAME(initDelaunay(rect:));
  77. //
  78. // int cv::Subdiv2D::insert(Point2f pt)
  79. //
  80. /**
  81. * Insert a single point into a Delaunay triangulation.
  82. *
  83. * @param pt Point to insert.
  84. *
  85. * The function inserts a single point into a subdivision and modifies the subdivision topology
  86. * appropriately. If a point with the same coordinates exists already, no new point is added.
  87. * @return the ID of the point.
  88. *
  89. * NOTE: If the point is outside of the triangulation specified rect a runtime error is raised.
  90. */
  91. - (int)insert:(Point2f*)pt NS_SWIFT_NAME(insert(pt:));
  92. //
  93. // void cv::Subdiv2D::insert(vector_Point2f ptvec)
  94. //
  95. /**
  96. * Insert multiple points into a Delaunay triangulation.
  97. *
  98. * @param ptvec Points to insert.
  99. *
  100. * The function inserts a vector of points into a subdivision and modifies the subdivision topology
  101. * appropriately.
  102. */
  103. - (void)insertVector:(NSArray<Point2f*>*)ptvec NS_SWIFT_NAME(insert(ptvec:));
  104. //
  105. // int cv::Subdiv2D::locate(Point2f pt, int& edge, int& vertex)
  106. //
  107. /**
  108. * Returns the location of a point within a Delaunay triangulation.
  109. *
  110. * @param pt Point to locate.
  111. * @param edge Output edge that the point belongs to or is located to the right of it.
  112. * @param vertex Optional output vertex the input point coincides with.
  113. *
  114. * The function locates the input point within the subdivision and gives one of the triangle edges
  115. * or vertices.
  116. *
  117. * @return an integer which specify one of the following five cases for point location:
  118. * - The point falls into some facet. The function returns #PTLOC_INSIDE and edge will contain one of
  119. * edges of the facet.
  120. * - The point falls onto the edge. The function returns #PTLOC_ON_EDGE and edge will contain this edge.
  121. * - The point coincides with one of the subdivision vertices. The function returns #PTLOC_VERTEX and
  122. * vertex will contain a pointer to the vertex.
  123. * - The point is outside the subdivision reference rectangle. The function returns #PTLOC_OUTSIDE_RECT
  124. * and no pointers are filled.
  125. * - One of input arguments is invalid. A runtime error is raised or, if silent or "parent" error
  126. * processing mode is selected, #PTLOC_ERROR is returned.
  127. */
  128. - (int)locate:(Point2f*)pt edge:(int*)edge vertex:(int*)vertex NS_SWIFT_NAME(locate(pt:edge:vertex:));
  129. //
  130. // int cv::Subdiv2D::findNearest(Point2f pt, Point2f* nearestPt = 0)
  131. //
  132. /**
  133. * Finds the subdivision vertex closest to the given point.
  134. *
  135. * @param pt Input point.
  136. * @param nearestPt Output subdivision vertex point.
  137. *
  138. * The function is another function that locates the input point within the subdivision. It finds the
  139. * subdivision vertex that is the closest to the input point. It is not necessarily one of vertices
  140. * of the facet containing the input point, though the facet (located using locate() ) is used as a
  141. * starting point.
  142. *
  143. * @return vertex ID.
  144. */
  145. - (int)findNearest:(Point2f*)pt nearestPt:(Point2f*)nearestPt NS_SWIFT_NAME(findNearest(pt:nearestPt:));
  146. /**
  147. * Finds the subdivision vertex closest to the given point.
  148. *
  149. * @param pt Input point.
  150. *
  151. * The function is another function that locates the input point within the subdivision. It finds the
  152. * subdivision vertex that is the closest to the input point. It is not necessarily one of vertices
  153. * of the facet containing the input point, though the facet (located using locate() ) is used as a
  154. * starting point.
  155. *
  156. * @return vertex ID.
  157. */
  158. - (int)findNearest:(Point2f*)pt NS_SWIFT_NAME(findNearest(pt:));
  159. //
  160. // void cv::Subdiv2D::getEdgeList(vector_Vec4f& edgeList)
  161. //
  162. /**
  163. * Returns a list of all edges.
  164. *
  165. * @param edgeList Output vector.
  166. *
  167. * The function gives each edge as a 4 numbers vector, where each two are one of the edge
  168. * vertices. i.e. org_x = v[0], org_y = v[1], dst_x = v[2], dst_y = v[3].
  169. */
  170. - (void)getEdgeList:(NSMutableArray<Float4*>*)edgeList NS_SWIFT_NAME(getEdgeList(edgeList:));
  171. //
  172. // void cv::Subdiv2D::getLeadingEdgeList(vector_int& leadingEdgeList)
  173. //
  174. /**
  175. * Returns a list of the leading edge ID connected to each triangle.
  176. *
  177. * @param leadingEdgeList Output vector.
  178. *
  179. * The function gives one edge ID for each triangle.
  180. */
  181. - (void)getLeadingEdgeList:(IntVector*)leadingEdgeList NS_SWIFT_NAME(getLeadingEdgeList(leadingEdgeList:));
  182. //
  183. // void cv::Subdiv2D::getTriangleList(vector_Vec6f& triangleList)
  184. //
  185. /**
  186. * Returns a list of all triangles.
  187. *
  188. * @param triangleList Output vector.
  189. *
  190. * The function gives each triangle as a 6 numbers vector, where each two are one of the triangle
  191. * vertices. i.e. p1_x = v[0], p1_y = v[1], p2_x = v[2], p2_y = v[3], p3_x = v[4], p3_y = v[5].
  192. */
  193. - (void)getTriangleList:(NSMutableArray<Float6*>*)triangleList NS_SWIFT_NAME(getTriangleList(triangleList:));
  194. //
  195. // void cv::Subdiv2D::getVoronoiFacetList(vector_int idx, vector_vector_Point2f& facetList, vector_Point2f& facetCenters)
  196. //
  197. /**
  198. * Returns a list of all Voronoi facets.
  199. *
  200. * @param idx Vector of vertices IDs to consider. For all vertices you can pass empty vector.
  201. * @param facetList Output vector of the Voronoi facets.
  202. * @param facetCenters Output vector of the Voronoi facets center points.
  203. */
  204. - (void)getVoronoiFacetList:(IntVector*)idx facetList:(NSMutableArray<NSMutableArray<Point2f*>*>*)facetList facetCenters:(NSMutableArray<Point2f*>*)facetCenters NS_SWIFT_NAME(getVoronoiFacetList(idx:facetList:facetCenters:));
  205. //
  206. // Point2f cv::Subdiv2D::getVertex(int vertex, int* firstEdge = 0)
  207. //
  208. /**
  209. * Returns vertex location from vertex ID.
  210. *
  211. * @param vertex vertex ID.
  212. * @param firstEdge Optional. The first edge ID which is connected to the vertex.
  213. * @return vertex (x,y)
  214. */
  215. - (Point2f*)getVertex:(int)vertex firstEdge:(int*)firstEdge NS_SWIFT_NAME(getVertex(vertex:firstEdge:));
  216. /**
  217. * Returns vertex location from vertex ID.
  218. *
  219. * @param vertex vertex ID.
  220. * @return vertex (x,y)
  221. */
  222. - (Point2f*)getVertex:(int)vertex NS_SWIFT_NAME(getVertex(vertex:));
  223. //
  224. // int cv::Subdiv2D::getEdge(int edge, int nextEdgeType)
  225. //
  226. /**
  227. * Returns one of the edges related to the given edge.
  228. *
  229. * @param edge Subdivision edge ID.
  230. * @param nextEdgeType Parameter specifying which of the related edges to return.
  231. * The following values are possible:
  232. * - NEXT_AROUND_ORG next around the edge origin ( eOnext on the picture below if e is the input edge)
  233. * - NEXT_AROUND_DST next around the edge vertex ( eDnext )
  234. * - PREV_AROUND_ORG previous around the edge origin (reversed eRnext )
  235. * - PREV_AROUND_DST previous around the edge destination (reversed eLnext )
  236. * - NEXT_AROUND_LEFT next around the left facet ( eLnext )
  237. * - NEXT_AROUND_RIGHT next around the right facet ( eRnext )
  238. * - PREV_AROUND_LEFT previous around the left facet (reversed eOnext )
  239. * - PREV_AROUND_RIGHT previous around the right facet (reversed eDnext )
  240. *
  241. * ![sample output](pics/quadedge.png)
  242. *
  243. * @return edge ID related to the input edge.
  244. */
  245. - (int)getEdge:(int)edge nextEdgeType:(int)nextEdgeType NS_SWIFT_NAME(getEdge(edge:nextEdgeType:));
  246. //
  247. // int cv::Subdiv2D::nextEdge(int edge)
  248. //
  249. /**
  250. * Returns next edge around the edge origin.
  251. *
  252. * @param edge Subdivision edge ID.
  253. *
  254. * @return an integer which is next edge ID around the edge origin: eOnext on the
  255. * picture above if e is the input edge).
  256. */
  257. - (int)nextEdge:(int)edge NS_SWIFT_NAME(nextEdge(edge:));
  258. //
  259. // int cv::Subdiv2D::rotateEdge(int edge, int rotate)
  260. //
  261. /**
  262. * Returns another edge of the same quad-edge.
  263. *
  264. * @param edge Subdivision edge ID.
  265. * @param rotate Parameter specifying which of the edges of the same quad-edge as the input
  266. * one to return. The following values are possible:
  267. * - 0 - the input edge ( e on the picture below if e is the input edge)
  268. * - 1 - the rotated edge ( eRot )
  269. * - 2 - the reversed edge (reversed e (in green))
  270. * - 3 - the reversed rotated edge (reversed eRot (in green))
  271. *
  272. * @return one of the edges ID of the same quad-edge as the input edge.
  273. */
  274. - (int)rotateEdge:(int)edge rotate:(int)rotate NS_SWIFT_NAME(rotateEdge(edge:rotate:));
  275. //
  276. // int cv::Subdiv2D::symEdge(int edge)
  277. //
  278. - (int)symEdge:(int)edge NS_SWIFT_NAME(symEdge(edge:));
  279. //
  280. // int cv::Subdiv2D::edgeOrg(int edge, Point2f* orgpt = 0)
  281. //
  282. /**
  283. * Returns the edge origin.
  284. *
  285. * @param edge Subdivision edge ID.
  286. * @param orgpt Output vertex location.
  287. *
  288. * @return vertex ID.
  289. */
  290. - (int)edgeOrg:(int)edge orgpt:(Point2f*)orgpt NS_SWIFT_NAME(edgeOrg(edge:orgpt:));
  291. /**
  292. * Returns the edge origin.
  293. *
  294. * @param edge Subdivision edge ID.
  295. *
  296. * @return vertex ID.
  297. */
  298. - (int)edgeOrg:(int)edge NS_SWIFT_NAME(edgeOrg(edge:));
  299. //
  300. // int cv::Subdiv2D::edgeDst(int edge, Point2f* dstpt = 0)
  301. //
  302. /**
  303. * Returns the edge destination.
  304. *
  305. * @param edge Subdivision edge ID.
  306. * @param dstpt Output vertex location.
  307. *
  308. * @return vertex ID.
  309. */
  310. - (int)edgeDst:(int)edge dstpt:(Point2f*)dstpt NS_SWIFT_NAME(edgeDst(edge:dstpt:));
  311. /**
  312. * Returns the edge destination.
  313. *
  314. * @param edge Subdivision edge ID.
  315. *
  316. * @return vertex ID.
  317. */
  318. - (int)edgeDst:(int)edge NS_SWIFT_NAME(edgeDst(edge:));
  319. @end
  320. NS_ASSUME_NONNULL_END