1 2 // 3 // This file is auto-generated. Please don't modify it! 4 // 5 package org.opencv.imgproc; 6 7 import java.util.ArrayList; 8 import java.util.List; 9 import org.opencv.core.Mat; 10 import org.opencv.core.MatOfFloat4; 11 import org.opencv.core.MatOfFloat6; 12 import org.opencv.core.MatOfInt; 13 import org.opencv.core.MatOfPoint2f; 14 import org.opencv.core.Point; 15 import org.opencv.core.Rect; 16 import org.opencv.utils.Converters; 17 18 // C++: class Subdiv2D 19 //javadoc: Subdiv2D 20 public class Subdiv2D { 21 22 protected final long nativeObj; Subdiv2D(long addr)23 protected Subdiv2D(long addr) { nativeObj = addr; } 24 25 26 public static final int 27 PTLOC_ERROR = -2, 28 PTLOC_OUTSIDE_RECT = -1, 29 PTLOC_INSIDE = 0, 30 PTLOC_VERTEX = 1, 31 PTLOC_ON_EDGE = 2, 32 NEXT_AROUND_ORG = 0x00, 33 NEXT_AROUND_DST = 0x22, 34 PREV_AROUND_ORG = 0x11, 35 PREV_AROUND_DST = 0x33, 36 NEXT_AROUND_LEFT = 0x13, 37 NEXT_AROUND_RIGHT = 0x31, 38 PREV_AROUND_LEFT = 0x20, 39 PREV_AROUND_RIGHT = 0x02; 40 41 42 // 43 // C++: Subdiv2D() 44 // 45 46 //javadoc: Subdiv2D::Subdiv2D() Subdiv2D()47 public Subdiv2D() 48 { 49 50 nativeObj = Subdiv2D_0(); 51 52 return; 53 } 54 55 56 // 57 // C++: Subdiv2D(Rect rect) 58 // 59 60 //javadoc: Subdiv2D::Subdiv2D(rect) Subdiv2D(Rect rect)61 public Subdiv2D(Rect rect) 62 { 63 64 nativeObj = Subdiv2D_1(rect.x, rect.y, rect.width, rect.height); 65 66 return; 67 } 68 69 70 // 71 // C++: void getTriangleList(vector_Vec6f& triangleList) 72 // 73 74 //javadoc: Subdiv2D::getTriangleList(triangleList) getTriangleList(MatOfFloat6 triangleList)75 public void getTriangleList(MatOfFloat6 triangleList) 76 { 77 Mat triangleList_mat = triangleList; 78 getTriangleList_0(nativeObj, triangleList_mat.nativeObj); 79 80 return; 81 } 82 83 84 // 85 // C++: void getVoronoiFacetList(vector_int idx, vector_vector_Point2f& facetList, vector_Point2f& facetCenters) 86 // 87 88 //javadoc: Subdiv2D::getVoronoiFacetList(idx, facetList, facetCenters) getVoronoiFacetList(MatOfInt idx, List<MatOfPoint2f> facetList, MatOfPoint2f facetCenters)89 public void getVoronoiFacetList(MatOfInt idx, List<MatOfPoint2f> facetList, MatOfPoint2f facetCenters) 90 { 91 Mat idx_mat = idx; 92 Mat facetList_mat = new Mat(); 93 Mat facetCenters_mat = facetCenters; 94 getVoronoiFacetList_0(nativeObj, idx_mat.nativeObj, facetList_mat.nativeObj, facetCenters_mat.nativeObj); 95 Converters.Mat_to_vector_vector_Point2f(facetList_mat, facetList); 96 facetList_mat.release(); 97 return; 98 } 99 100 101 // 102 // C++: Point2f getVertex(int vertex, int* firstEdge = 0) 103 // 104 105 //javadoc: Subdiv2D::getVertex(vertex, firstEdge) getVertex(int vertex, int[] firstEdge)106 public Point getVertex(int vertex, int[] firstEdge) 107 { 108 double[] firstEdge_out = new double[1]; 109 Point retVal = new Point(getVertex_0(nativeObj, vertex, firstEdge_out)); 110 if(firstEdge!=null) firstEdge[0] = (int)firstEdge_out[0]; 111 return retVal; 112 } 113 114 //javadoc: Subdiv2D::getVertex(vertex) getVertex(int vertex)115 public Point getVertex(int vertex) 116 { 117 118 Point retVal = new Point(getVertex_1(nativeObj, vertex)); 119 120 return retVal; 121 } 122 123 124 // 125 // C++: int getEdge(int edge, int nextEdgeType) 126 // 127 128 //javadoc: Subdiv2D::getEdge(edge, nextEdgeType) getEdge(int edge, int nextEdgeType)129 public int getEdge(int edge, int nextEdgeType) 130 { 131 132 int retVal = getEdge_0(nativeObj, edge, nextEdgeType); 133 134 return retVal; 135 } 136 137 138 // 139 // C++: int nextEdge(int edge) 140 // 141 142 //javadoc: Subdiv2D::nextEdge(edge) nextEdge(int edge)143 public int nextEdge(int edge) 144 { 145 146 int retVal = nextEdge_0(nativeObj, edge); 147 148 return retVal; 149 } 150 151 152 // 153 // C++: int rotateEdge(int edge, int rotate) 154 // 155 156 //javadoc: Subdiv2D::rotateEdge(edge, rotate) rotateEdge(int edge, int rotate)157 public int rotateEdge(int edge, int rotate) 158 { 159 160 int retVal = rotateEdge_0(nativeObj, edge, rotate); 161 162 return retVal; 163 } 164 165 166 // 167 // C++: int symEdge(int edge) 168 // 169 170 //javadoc: Subdiv2D::symEdge(edge) symEdge(int edge)171 public int symEdge(int edge) 172 { 173 174 int retVal = symEdge_0(nativeObj, edge); 175 176 return retVal; 177 } 178 179 180 // 181 // C++: int edgeOrg(int edge, Point2f* orgpt = 0) 182 // 183 184 //javadoc: Subdiv2D::edgeOrg(edge, orgpt) edgeOrg(int edge, Point orgpt)185 public int edgeOrg(int edge, Point orgpt) 186 { 187 double[] orgpt_out = new double[2]; 188 int retVal = edgeOrg_0(nativeObj, edge, orgpt_out); 189 if(orgpt!=null){ orgpt.x = orgpt_out[0]; orgpt.y = orgpt_out[1]; } 190 return retVal; 191 } 192 193 //javadoc: Subdiv2D::edgeOrg(edge) edgeOrg(int edge)194 public int edgeOrg(int edge) 195 { 196 197 int retVal = edgeOrg_1(nativeObj, edge); 198 199 return retVal; 200 } 201 202 203 // 204 // C++: int edgeDst(int edge, Point2f* dstpt = 0) 205 // 206 207 //javadoc: Subdiv2D::edgeDst(edge, dstpt) edgeDst(int edge, Point dstpt)208 public int edgeDst(int edge, Point dstpt) 209 { 210 double[] dstpt_out = new double[2]; 211 int retVal = edgeDst_0(nativeObj, edge, dstpt_out); 212 if(dstpt!=null){ dstpt.x = dstpt_out[0]; dstpt.y = dstpt_out[1]; } 213 return retVal; 214 } 215 216 //javadoc: Subdiv2D::edgeDst(edge) edgeDst(int edge)217 public int edgeDst(int edge) 218 { 219 220 int retVal = edgeDst_1(nativeObj, edge); 221 222 return retVal; 223 } 224 225 226 // 227 // C++: void initDelaunay(Rect rect) 228 // 229 230 //javadoc: Subdiv2D::initDelaunay(rect) initDelaunay(Rect rect)231 public void initDelaunay(Rect rect) 232 { 233 234 initDelaunay_0(nativeObj, rect.x, rect.y, rect.width, rect.height); 235 236 return; 237 } 238 239 240 // 241 // C++: int insert(Point2f pt) 242 // 243 244 //javadoc: Subdiv2D::insert(pt) insert(Point pt)245 public int insert(Point pt) 246 { 247 248 int retVal = insert_0(nativeObj, pt.x, pt.y); 249 250 return retVal; 251 } 252 253 254 // 255 // C++: void insert(vector_Point2f ptvec) 256 // 257 258 //javadoc: Subdiv2D::insert(ptvec) insert(MatOfPoint2f ptvec)259 public void insert(MatOfPoint2f ptvec) 260 { 261 Mat ptvec_mat = ptvec; 262 insert_1(nativeObj, ptvec_mat.nativeObj); 263 264 return; 265 } 266 267 268 // 269 // C++: int locate(Point2f pt, int& edge, int& vertex) 270 // 271 272 //javadoc: Subdiv2D::locate(pt, edge, vertex) locate(Point pt, int[] edge, int[] vertex)273 public int locate(Point pt, int[] edge, int[] vertex) 274 { 275 double[] edge_out = new double[1]; 276 double[] vertex_out = new double[1]; 277 int retVal = locate_0(nativeObj, pt.x, pt.y, edge_out, vertex_out); 278 if(edge!=null) edge[0] = (int)edge_out[0]; 279 if(vertex!=null) vertex[0] = (int)vertex_out[0]; 280 return retVal; 281 } 282 283 284 // 285 // C++: int findNearest(Point2f pt, Point2f* nearestPt = 0) 286 // 287 288 //javadoc: Subdiv2D::findNearest(pt, nearestPt) findNearest(Point pt, Point nearestPt)289 public int findNearest(Point pt, Point nearestPt) 290 { 291 double[] nearestPt_out = new double[2]; 292 int retVal = findNearest_0(nativeObj, pt.x, pt.y, nearestPt_out); 293 if(nearestPt!=null){ nearestPt.x = nearestPt_out[0]; nearestPt.y = nearestPt_out[1]; } 294 return retVal; 295 } 296 297 //javadoc: Subdiv2D::findNearest(pt) findNearest(Point pt)298 public int findNearest(Point pt) 299 { 300 301 int retVal = findNearest_1(nativeObj, pt.x, pt.y); 302 303 return retVal; 304 } 305 306 307 // 308 // C++: void getEdgeList(vector_Vec4f& edgeList) 309 // 310 311 //javadoc: Subdiv2D::getEdgeList(edgeList) getEdgeList(MatOfFloat4 edgeList)312 public void getEdgeList(MatOfFloat4 edgeList) 313 { 314 Mat edgeList_mat = edgeList; 315 getEdgeList_0(nativeObj, edgeList_mat.nativeObj); 316 317 return; 318 } 319 320 321 @Override finalize()322 protected void finalize() throws Throwable { 323 delete(nativeObj); 324 } 325 326 327 328 // C++: Subdiv2D() Subdiv2D_0()329 private static native long Subdiv2D_0(); 330 331 // C++: Subdiv2D(Rect rect) Subdiv2D_1(int rect_x, int rect_y, int rect_width, int rect_height)332 private static native long Subdiv2D_1(int rect_x, int rect_y, int rect_width, int rect_height); 333 334 // C++: void getTriangleList(vector_Vec6f& triangleList) getTriangleList_0(long nativeObj, long triangleList_mat_nativeObj)335 private static native void getTriangleList_0(long nativeObj, long triangleList_mat_nativeObj); 336 337 // C++: void getVoronoiFacetList(vector_int idx, vector_vector_Point2f& facetList, vector_Point2f& facetCenters) getVoronoiFacetList_0(long nativeObj, long idx_mat_nativeObj, long facetList_mat_nativeObj, long facetCenters_mat_nativeObj)338 private static native void getVoronoiFacetList_0(long nativeObj, long idx_mat_nativeObj, long facetList_mat_nativeObj, long facetCenters_mat_nativeObj); 339 340 // C++: Point2f getVertex(int vertex, int* firstEdge = 0) getVertex_0(long nativeObj, int vertex, double[] firstEdge_out)341 private static native double[] getVertex_0(long nativeObj, int vertex, double[] firstEdge_out); getVertex_1(long nativeObj, int vertex)342 private static native double[] getVertex_1(long nativeObj, int vertex); 343 344 // C++: int getEdge(int edge, int nextEdgeType) getEdge_0(long nativeObj, int edge, int nextEdgeType)345 private static native int getEdge_0(long nativeObj, int edge, int nextEdgeType); 346 347 // C++: int nextEdge(int edge) nextEdge_0(long nativeObj, int edge)348 private static native int nextEdge_0(long nativeObj, int edge); 349 350 // C++: int rotateEdge(int edge, int rotate) rotateEdge_0(long nativeObj, int edge, int rotate)351 private static native int rotateEdge_0(long nativeObj, int edge, int rotate); 352 353 // C++: int symEdge(int edge) symEdge_0(long nativeObj, int edge)354 private static native int symEdge_0(long nativeObj, int edge); 355 356 // C++: int edgeOrg(int edge, Point2f* orgpt = 0) edgeOrg_0(long nativeObj, int edge, double[] orgpt_out)357 private static native int edgeOrg_0(long nativeObj, int edge, double[] orgpt_out); edgeOrg_1(long nativeObj, int edge)358 private static native int edgeOrg_1(long nativeObj, int edge); 359 360 // C++: int edgeDst(int edge, Point2f* dstpt = 0) edgeDst_0(long nativeObj, int edge, double[] dstpt_out)361 private static native int edgeDst_0(long nativeObj, int edge, double[] dstpt_out); edgeDst_1(long nativeObj, int edge)362 private static native int edgeDst_1(long nativeObj, int edge); 363 364 // C++: void initDelaunay(Rect rect) initDelaunay_0(long nativeObj, int rect_x, int rect_y, int rect_width, int rect_height)365 private static native void initDelaunay_0(long nativeObj, int rect_x, int rect_y, int rect_width, int rect_height); 366 367 // C++: int insert(Point2f pt) insert_0(long nativeObj, double pt_x, double pt_y)368 private static native int insert_0(long nativeObj, double pt_x, double pt_y); 369 370 // C++: void insert(vector_Point2f ptvec) insert_1(long nativeObj, long ptvec_mat_nativeObj)371 private static native void insert_1(long nativeObj, long ptvec_mat_nativeObj); 372 373 // C++: int locate(Point2f pt, int& edge, int& vertex) locate_0(long nativeObj, double pt_x, double pt_y, double[] edge_out, double[] vertex_out)374 private static native int locate_0(long nativeObj, double pt_x, double pt_y, double[] edge_out, double[] vertex_out); 375 376 // C++: int findNearest(Point2f pt, Point2f* nearestPt = 0) findNearest_0(long nativeObj, double pt_x, double pt_y, double[] nearestPt_out)377 private static native int findNearest_0(long nativeObj, double pt_x, double pt_y, double[] nearestPt_out); findNearest_1(long nativeObj, double pt_x, double pt_y)378 private static native int findNearest_1(long nativeObj, double pt_x, double pt_y); 379 380 // C++: void getEdgeList(vector_Vec4f& edgeList) getEdgeList_0(long nativeObj, long edgeList_mat_nativeObj)381 private static native void getEdgeList_0(long nativeObj, long edgeList_mat_nativeObj); 382 383 // native support for java finalize() delete(long nativeObj)384 private static native void delete(long nativeObj); 385 386 } 387