1 package org.opencv.core; 2 3 import java.nio.ByteBuffer; 4 5 // C++: class Mat 6 //javadoc: Mat 7 public class Mat { 8 9 public final long nativeObj; 10 Mat(long addr)11 public Mat(long addr) { 12 if (addr == 0) 13 throw new UnsupportedOperationException("Native object address is NULL"); 14 nativeObj = addr; 15 } 16 17 // 18 // C++: Mat::Mat() 19 // 20 21 // javadoc: Mat::Mat() Mat()22 public Mat() { 23 nativeObj = n_Mat(); 24 } 25 26 // 27 // C++: Mat::Mat(int rows, int cols, int type) 28 // 29 30 // javadoc: Mat::Mat(rows, cols, type) Mat(int rows, int cols, int type)31 public Mat(int rows, int cols, int type) { 32 nativeObj = n_Mat(rows, cols, type); 33 } 34 35 // 36 // C++: Mat::Mat(int rows, int cols, int type, void* data) 37 // 38 39 // javadoc: Mat::Mat(rows, cols, type, data) Mat(int rows, int cols, int type, ByteBuffer data)40 public Mat(int rows, int cols, int type, ByteBuffer data) { 41 nativeObj = n_Mat(rows, cols, type, data); 42 } 43 44 // 45 // C++: Mat::Mat(int rows, int cols, int type, void* data, size_t step) 46 // 47 48 // javadoc: Mat::Mat(rows, cols, type, data, step) Mat(int rows, int cols, int type, ByteBuffer data, long step)49 public Mat(int rows, int cols, int type, ByteBuffer data, long step) { 50 nativeObj = n_Mat(rows, cols, type, data, step); 51 } 52 53 // 54 // C++: Mat::Mat(Size size, int type) 55 // 56 57 // javadoc: Mat::Mat(size, type) Mat(Size size, int type)58 public Mat(Size size, int type) { 59 nativeObj = n_Mat(size.width, size.height, type); 60 } 61 62 // 63 // C++: Mat::Mat(int ndims, const int* sizes, int type) 64 // 65 66 // javadoc: Mat::Mat(sizes, type) Mat(int[] sizes, int type)67 public Mat(int[] sizes, int type) { 68 nativeObj = n_Mat(sizes.length, sizes, type); 69 } 70 71 // 72 // C++: Mat::Mat(int rows, int cols, int type, Scalar s) 73 // 74 75 // javadoc: Mat::Mat(rows, cols, type, s) Mat(int rows, int cols, int type, Scalar s)76 public Mat(int rows, int cols, int type, Scalar s) { 77 nativeObj = n_Mat(rows, cols, type, s.val[0], s.val[1], s.val[2], s.val[3]); 78 } 79 80 // 81 // C++: Mat::Mat(Size size, int type, Scalar s) 82 // 83 84 // javadoc: Mat::Mat(size, type, s) Mat(Size size, int type, Scalar s)85 public Mat(Size size, int type, Scalar s) { 86 nativeObj = n_Mat(size.width, size.height, type, s.val[0], s.val[1], s.val[2], s.val[3]); 87 } 88 89 // 90 // C++: Mat::Mat(int ndims, const int* sizes, int type, Scalar s) 91 // 92 93 // javadoc: Mat::Mat(sizes, type, s) Mat(int[] sizes, int type, Scalar s)94 public Mat(int[] sizes, int type, Scalar s) { 95 nativeObj = n_Mat(sizes.length, sizes, type, s.val[0], s.val[1], s.val[2], s.val[3]); 96 } 97 98 // 99 // C++: Mat::Mat(Mat m, Range rowRange, Range colRange = Range::all()) 100 // 101 102 // javadoc: Mat::Mat(m, rowRange, colRange) Mat(Mat m, Range rowRange, Range colRange)103 public Mat(Mat m, Range rowRange, Range colRange) { 104 nativeObj = n_Mat(m.nativeObj, rowRange.start, rowRange.end, colRange.start, colRange.end); 105 } 106 107 // javadoc: Mat::Mat(m, rowRange) Mat(Mat m, Range rowRange)108 public Mat(Mat m, Range rowRange) { 109 nativeObj = n_Mat(m.nativeObj, rowRange.start, rowRange.end); 110 } 111 112 // 113 // C++: Mat::Mat(const Mat& m, const std::vector<Range>& ranges) 114 // 115 116 // javadoc: Mat::Mat(m, ranges) Mat(Mat m, Range[] ranges)117 public Mat(Mat m, Range[] ranges) { 118 nativeObj = n_Mat(m.nativeObj, ranges); 119 } 120 121 // 122 // C++: Mat::Mat(Mat m, Rect roi) 123 // 124 125 // javadoc: Mat::Mat(m, roi) Mat(Mat m, Rect roi)126 public Mat(Mat m, Rect roi) { 127 nativeObj = n_Mat(m.nativeObj, roi.y, roi.y + roi.height, roi.x, roi.x + roi.width); 128 } 129 130 // 131 // C++: Mat Mat::adjustROI(int dtop, int dbottom, int dleft, int dright) 132 // 133 134 // javadoc: Mat::adjustROI(dtop, dbottom, dleft, dright) adjustROI(int dtop, int dbottom, int dleft, int dright)135 public Mat adjustROI(int dtop, int dbottom, int dleft, int dright) { 136 return new Mat(n_adjustROI(nativeObj, dtop, dbottom, dleft, dright)); 137 } 138 139 // 140 // C++: void Mat::assignTo(Mat m, int type = -1) 141 // 142 143 // javadoc: Mat::assignTo(m, type) assignTo(Mat m, int type)144 public void assignTo(Mat m, int type) { 145 n_assignTo(nativeObj, m.nativeObj, type); 146 } 147 148 // javadoc: Mat::assignTo(m) assignTo(Mat m)149 public void assignTo(Mat m) { 150 n_assignTo(nativeObj, m.nativeObj); 151 } 152 153 // 154 // C++: int Mat::channels() 155 // 156 157 // javadoc: Mat::channels() channels()158 public int channels() { 159 return n_channels(nativeObj); 160 } 161 162 // 163 // C++: int Mat::checkVector(int elemChannels, int depth = -1, bool 164 // requireContinuous = true) 165 // 166 167 // javadoc: Mat::checkVector(elemChannels, depth, requireContinuous) checkVector(int elemChannels, int depth, boolean requireContinuous)168 public int checkVector(int elemChannels, int depth, boolean requireContinuous) { 169 return n_checkVector(nativeObj, elemChannels, depth, requireContinuous); 170 } 171 172 // javadoc: Mat::checkVector(elemChannels, depth) checkVector(int elemChannels, int depth)173 public int checkVector(int elemChannels, int depth) { 174 return n_checkVector(nativeObj, elemChannels, depth); 175 } 176 177 // javadoc: Mat::checkVector(elemChannels) checkVector(int elemChannels)178 public int checkVector(int elemChannels) { 179 return n_checkVector(nativeObj, elemChannels); 180 } 181 182 // 183 // C++: Mat Mat::clone() 184 // 185 186 // javadoc: Mat::clone() clone()187 public Mat clone() { 188 return new Mat(n_clone(nativeObj)); 189 } 190 191 // 192 // C++: Mat Mat::col(int x) 193 // 194 195 // javadoc: Mat::col(x) col(int x)196 public Mat col(int x) { 197 return new Mat(n_col(nativeObj, x)); 198 } 199 200 // 201 // C++: Mat Mat::colRange(int startcol, int endcol) 202 // 203 204 // javadoc: Mat::colRange(startcol, endcol) colRange(int startcol, int endcol)205 public Mat colRange(int startcol, int endcol) { 206 return new Mat(n_colRange(nativeObj, startcol, endcol)); 207 } 208 209 // 210 // C++: Mat Mat::colRange(Range r) 211 // 212 213 // javadoc: Mat::colRange(r) colRange(Range r)214 public Mat colRange(Range r) { 215 return new Mat(n_colRange(nativeObj, r.start, r.end)); 216 } 217 218 // 219 // C++: int Mat::dims() 220 // 221 222 // javadoc: Mat::dims() dims()223 public int dims() { 224 return n_dims(nativeObj); 225 } 226 227 // 228 // C++: int Mat::cols() 229 // 230 231 // javadoc: Mat::cols() cols()232 public int cols() { 233 return n_cols(nativeObj); 234 } 235 236 // 237 // C++: void Mat::convertTo(Mat& m, int rtype, double alpha = 1, double beta 238 // = 0) 239 // 240 241 // javadoc: Mat::convertTo(m, rtype, alpha, beta) convertTo(Mat m, int rtype, double alpha, double beta)242 public void convertTo(Mat m, int rtype, double alpha, double beta) { 243 n_convertTo(nativeObj, m.nativeObj, rtype, alpha, beta); 244 } 245 246 // javadoc: Mat::convertTo(m, rtype, alpha) convertTo(Mat m, int rtype, double alpha)247 public void convertTo(Mat m, int rtype, double alpha) { 248 n_convertTo(nativeObj, m.nativeObj, rtype, alpha); 249 } 250 251 // javadoc: Mat::convertTo(m, rtype) convertTo(Mat m, int rtype)252 public void convertTo(Mat m, int rtype) { 253 n_convertTo(nativeObj, m.nativeObj, rtype); 254 } 255 256 // 257 // C++: void Mat::copyTo(Mat& m) 258 // 259 260 // javadoc: Mat::copyTo(m) copyTo(Mat m)261 public void copyTo(Mat m) { 262 n_copyTo(nativeObj, m.nativeObj); 263 } 264 265 // 266 // C++: void Mat::copyTo(Mat& m, Mat mask) 267 // 268 269 // javadoc: Mat::copyTo(m, mask) copyTo(Mat m, Mat mask)270 public void copyTo(Mat m, Mat mask) { 271 n_copyTo(nativeObj, m.nativeObj, mask.nativeObj); 272 } 273 274 // 275 // C++: void Mat::create(int rows, int cols, int type) 276 // 277 278 // javadoc: Mat::create(rows, cols, type) create(int rows, int cols, int type)279 public void create(int rows, int cols, int type) { 280 n_create(nativeObj, rows, cols, type); 281 } 282 283 // 284 // C++: void Mat::create(Size size, int type) 285 // 286 287 // javadoc: Mat::create(size, type) create(Size size, int type)288 public void create(Size size, int type) { 289 n_create(nativeObj, size.width, size.height, type); 290 } 291 292 // 293 // C++: void Mat::create(int ndims, const int* sizes, int type) 294 // 295 296 // javadoc: Mat::create(sizes, type) create(int[] sizes, int type)297 public void create(int[] sizes, int type) { 298 n_create(nativeObj, sizes.length, sizes, type); 299 } 300 301 // 302 // C++: void Mat::copySize(const Mat& m); 303 // 304 305 // javadoc: Mat::copySize(m) copySize(Mat m)306 public void copySize(Mat m) { 307 n_copySize(nativeObj, m.nativeObj); 308 } 309 310 // 311 // C++: Mat Mat::cross(Mat m) 312 // 313 314 // javadoc: Mat::cross(m) cross(Mat m)315 public Mat cross(Mat m) { 316 return new Mat(n_cross(nativeObj, m.nativeObj)); 317 } 318 319 // 320 // C++: long Mat::dataAddr() 321 // 322 323 // javadoc: Mat::dataAddr() dataAddr()324 public long dataAddr() { 325 return n_dataAddr(nativeObj); 326 } 327 328 // 329 // C++: int Mat::depth() 330 // 331 332 // javadoc: Mat::depth() depth()333 public int depth() { 334 return n_depth(nativeObj); 335 } 336 337 // 338 // C++: Mat Mat::diag(int d = 0) 339 // 340 341 // javadoc: Mat::diag(d) diag(int d)342 public Mat diag(int d) { 343 return new Mat(n_diag(nativeObj, d)); 344 } 345 346 // javadoc: Mat::diag() diag()347 public Mat diag() { 348 return new Mat(n_diag(nativeObj, 0)); 349 } 350 351 // 352 // C++: static Mat Mat::diag(Mat d) 353 // 354 355 // javadoc: Mat::diag(d) diag(Mat d)356 public static Mat diag(Mat d) { 357 return new Mat(n_diag(d.nativeObj)); 358 } 359 360 // 361 // C++: double Mat::dot(Mat m) 362 // 363 364 // javadoc: Mat::dot(m) dot(Mat m)365 public double dot(Mat m) { 366 return n_dot(nativeObj, m.nativeObj); 367 } 368 369 // 370 // C++: size_t Mat::elemSize() 371 // 372 373 // javadoc: Mat::elemSize() elemSize()374 public long elemSize() { 375 return n_elemSize(nativeObj); 376 } 377 378 // 379 // C++: size_t Mat::elemSize1() 380 // 381 382 // javadoc: Mat::elemSize1() elemSize1()383 public long elemSize1() { 384 return n_elemSize1(nativeObj); 385 } 386 387 // 388 // C++: bool Mat::empty() 389 // 390 391 // javadoc: Mat::empty() empty()392 public boolean empty() { 393 return n_empty(nativeObj); 394 } 395 396 // 397 // C++: static Mat Mat::eye(int rows, int cols, int type) 398 // 399 400 // javadoc: Mat::eye(rows, cols, type) eye(int rows, int cols, int type)401 public static Mat eye(int rows, int cols, int type) { 402 return new Mat(n_eye(rows, cols, type)); 403 } 404 405 // 406 // C++: static Mat Mat::eye(Size size, int type) 407 // 408 409 // javadoc: Mat::eye(size, type) eye(Size size, int type)410 public static Mat eye(Size size, int type) { 411 return new Mat(n_eye(size.width, size.height, type)); 412 } 413 414 // 415 // C++: Mat Mat::inv(int method = DECOMP_LU) 416 // 417 418 // javadoc: Mat::inv(method) inv(int method)419 public Mat inv(int method) { 420 return new Mat(n_inv(nativeObj, method)); 421 } 422 423 // javadoc: Mat::inv() inv()424 public Mat inv() { 425 return new Mat(n_inv(nativeObj)); 426 } 427 428 // 429 // C++: bool Mat::isContinuous() 430 // 431 432 // javadoc: Mat::isContinuous() isContinuous()433 public boolean isContinuous() { 434 return n_isContinuous(nativeObj); 435 } 436 437 // 438 // C++: bool Mat::isSubmatrix() 439 // 440 441 // javadoc: Mat::isSubmatrix() isSubmatrix()442 public boolean isSubmatrix() { 443 return n_isSubmatrix(nativeObj); 444 } 445 446 // 447 // C++: void Mat::locateROI(Size wholeSize, Point ofs) 448 // 449 450 // javadoc: Mat::locateROI(wholeSize, ofs) locateROI(Size wholeSize, Point ofs)451 public void locateROI(Size wholeSize, Point ofs) { 452 double[] wholeSize_out = new double[2]; 453 double[] ofs_out = new double[2]; 454 locateROI_0(nativeObj, wholeSize_out, ofs_out); 455 if (wholeSize != null) { 456 wholeSize.width = wholeSize_out[0]; 457 wholeSize.height = wholeSize_out[1]; 458 } 459 if (ofs != null) { 460 ofs.x = ofs_out[0]; 461 ofs.y = ofs_out[1]; 462 } 463 } 464 465 // 466 // C++: Mat Mat::mul(Mat m, double scale = 1) 467 // 468 469 // javadoc: Mat::mul(m, scale) mul(Mat m, double scale)470 public Mat mul(Mat m, double scale) { 471 return new Mat(n_mul(nativeObj, m.nativeObj, scale)); 472 } 473 474 // javadoc: Mat::mul(m) mul(Mat m)475 public Mat mul(Mat m) { 476 return new Mat(n_mul(nativeObj, m.nativeObj)); 477 } 478 479 // 480 // C++: static Mat Mat::ones(int rows, int cols, int type) 481 // 482 483 // javadoc: Mat::ones(rows, cols, type) ones(int rows, int cols, int type)484 public static Mat ones(int rows, int cols, int type) { 485 return new Mat(n_ones(rows, cols, type)); 486 } 487 488 // 489 // C++: static Mat Mat::ones(Size size, int type) 490 // 491 492 // javadoc: Mat::ones(size, type) ones(Size size, int type)493 public static Mat ones(Size size, int type) { 494 return new Mat(n_ones(size.width, size.height, type)); 495 } 496 497 // 498 // C++: static Mat Mat::ones(int ndims, const int* sizes, int type) 499 // 500 501 // javadoc: Mat::ones(sizes, type) ones(int[] sizes, int type)502 public static Mat ones(int[] sizes, int type) { 503 return new Mat(n_ones(sizes.length, sizes, type)); 504 } 505 506 // 507 // C++: void Mat::push_back(Mat m) 508 // 509 510 // javadoc: Mat::push_back(m) push_back(Mat m)511 public void push_back(Mat m) { 512 n_push_back(nativeObj, m.nativeObj); 513 } 514 515 // 516 // C++: void Mat::release() 517 // 518 519 // javadoc: Mat::release() release()520 public void release() { 521 n_release(nativeObj); 522 } 523 524 // 525 // C++: Mat Mat::reshape(int cn, int rows = 0) 526 // 527 528 // javadoc: Mat::reshape(cn, rows) reshape(int cn, int rows)529 public Mat reshape(int cn, int rows) { 530 return new Mat(n_reshape(nativeObj, cn, rows)); 531 } 532 533 // javadoc: Mat::reshape(cn) reshape(int cn)534 public Mat reshape(int cn) { 535 return new Mat(n_reshape(nativeObj, cn)); 536 } 537 538 // 539 // C++: Mat Mat::reshape(int cn, int newndims, const int* newsz) 540 // 541 542 // javadoc: Mat::reshape(cn, newshape) reshape(int cn, int[] newshape)543 public Mat reshape(int cn, int[] newshape) { 544 return new Mat(n_reshape_1(nativeObj, cn, newshape.length, newshape)); 545 } 546 547 // 548 // C++: Mat Mat::row(int y) 549 // 550 551 // javadoc: Mat::row(y) row(int y)552 public Mat row(int y) { 553 return new Mat(n_row(nativeObj, y)); 554 } 555 556 // 557 // C++: Mat Mat::rowRange(int startrow, int endrow) 558 // 559 560 // javadoc: Mat::rowRange(startrow, endrow) rowRange(int startrow, int endrow)561 public Mat rowRange(int startrow, int endrow) { 562 return new Mat(n_rowRange(nativeObj, startrow, endrow)); 563 } 564 565 // 566 // C++: Mat Mat::rowRange(Range r) 567 // 568 569 // javadoc: Mat::rowRange(r) rowRange(Range r)570 public Mat rowRange(Range r) { 571 return new Mat(n_rowRange(nativeObj, r.start, r.end)); 572 } 573 574 // 575 // C++: int Mat::rows() 576 // 577 578 // javadoc: Mat::rows() rows()579 public int rows() { 580 return n_rows(nativeObj); 581 } 582 583 // 584 // C++: Mat Mat::operator =(Scalar s) 585 // 586 587 // javadoc: Mat::operator =(s) setTo(Scalar s)588 public Mat setTo(Scalar s) { 589 return new Mat(n_setTo(nativeObj, s.val[0], s.val[1], s.val[2], s.val[3])); 590 } 591 592 // 593 // C++: Mat Mat::setTo(Scalar value, Mat mask = Mat()) 594 // 595 596 // javadoc: Mat::setTo(value, mask) setTo(Scalar value, Mat mask)597 public Mat setTo(Scalar value, Mat mask) { 598 return new Mat(n_setTo(nativeObj, value.val[0], value.val[1], value.val[2], value.val[3], mask.nativeObj)); 599 } 600 601 // 602 // C++: Mat Mat::setTo(Mat value, Mat mask = Mat()) 603 // 604 605 // javadoc: Mat::setTo(value, mask) setTo(Mat value, Mat mask)606 public Mat setTo(Mat value, Mat mask) { 607 return new Mat(n_setTo(nativeObj, value.nativeObj, mask.nativeObj)); 608 } 609 610 // javadoc: Mat::setTo(value) setTo(Mat value)611 public Mat setTo(Mat value) { 612 return new Mat(n_setTo(nativeObj, value.nativeObj)); 613 } 614 615 // 616 // C++: Size Mat::size() 617 // 618 619 // javadoc: Mat::size() size()620 public Size size() { 621 return new Size(n_size(nativeObj)); 622 } 623 624 // 625 // C++: int Mat::size(int i) 626 // 627 628 // javadoc: Mat::size(int i) size(int i)629 public int size(int i) { 630 return n_size_i(nativeObj, i); 631 } 632 633 // 634 // C++: size_t Mat::step1(int i = 0) 635 // 636 637 // javadoc: Mat::step1(i) step1(int i)638 public long step1(int i) { 639 return n_step1(nativeObj, i); 640 } 641 642 // javadoc: Mat::step1() step1()643 public long step1() { 644 return n_step1(nativeObj); 645 } 646 647 // 648 // C++: Mat Mat::operator()(int rowStart, int rowEnd, int colStart, int 649 // colEnd) 650 // 651 652 // javadoc: Mat::operator()(rowStart, rowEnd, colStart, colEnd) submat(int rowStart, int rowEnd, int colStart, int colEnd)653 public Mat submat(int rowStart, int rowEnd, int colStart, int colEnd) { 654 return new Mat(n_submat_rr(nativeObj, rowStart, rowEnd, colStart, colEnd)); 655 } 656 657 // 658 // C++: Mat Mat::operator()(Range rowRange, Range colRange) 659 // 660 661 // javadoc: Mat::operator()(rowRange, colRange) submat(Range rowRange, Range colRange)662 public Mat submat(Range rowRange, Range colRange) { 663 return new Mat(n_submat_rr(nativeObj, rowRange.start, rowRange.end, colRange.start, colRange.end)); 664 } 665 666 // 667 // C++: Mat Mat::operator()(const std::vector<Range>& ranges) 668 // 669 670 // javadoc: Mat::operator()(ranges[]) submat(Range[] ranges)671 public Mat submat(Range[] ranges) { 672 return new Mat(n_submat_ranges(nativeObj, ranges)); 673 } 674 675 // 676 // C++: Mat Mat::operator()(Rect roi) 677 // 678 679 // javadoc: Mat::operator()(roi) submat(Rect roi)680 public Mat submat(Rect roi) { 681 return new Mat(n_submat(nativeObj, roi.x, roi.y, roi.width, roi.height)); 682 } 683 684 // 685 // C++: Mat Mat::t() 686 // 687 688 // javadoc: Mat::t() t()689 public Mat t() { 690 return new Mat(n_t(nativeObj)); 691 } 692 693 // 694 // C++: size_t Mat::total() 695 // 696 697 // javadoc: Mat::total() total()698 public long total() { 699 return n_total(nativeObj); 700 } 701 702 // 703 // C++: int Mat::type() 704 // 705 706 // javadoc: Mat::type() type()707 public int type() { 708 return n_type(nativeObj); 709 } 710 711 // 712 // C++: static Mat Mat::zeros(int rows, int cols, int type) 713 // 714 715 // javadoc: Mat::zeros(rows, cols, type) zeros(int rows, int cols, int type)716 public static Mat zeros(int rows, int cols, int type) { 717 return new Mat(n_zeros(rows, cols, type)); 718 } 719 720 // 721 // C++: static Mat Mat::zeros(Size size, int type) 722 // 723 724 // javadoc: Mat::zeros(size, type) zeros(Size size, int type)725 public static Mat zeros(Size size, int type) { 726 return new Mat(n_zeros(size.width, size.height, type)); 727 } 728 729 // 730 // C++: static Mat Mat::zeros(int ndims, const int* sizes, int type) 731 // 732 733 // javadoc: Mat::zeros(sizes, type) zeros(int[] sizes, int type)734 public static Mat zeros(int[] sizes, int type) { 735 return new Mat(n_zeros(sizes.length, sizes, type)); 736 } 737 738 @Override finalize()739 protected void finalize() throws Throwable { 740 n_delete(nativeObj); 741 super.finalize(); 742 } 743 744 // javadoc:Mat::toString() 745 @Override toString()746 public String toString() { 747 String _dims = (dims() > 0) ? "" : "-1*-1*"; 748 for (int i=0; i<dims(); i++) { 749 _dims += size(i) + "*"; 750 } 751 return "Mat [ " + _dims + CvType.typeToString(type()) + 752 ", isCont=" + isContinuous() + ", isSubmat=" + isSubmatrix() + 753 ", nativeObj=0x" + Long.toHexString(nativeObj) + 754 ", dataAddr=0x" + Long.toHexString(dataAddr()) + 755 " ]"; 756 } 757 758 // javadoc:Mat::dump() dump()759 public String dump() { 760 return nDump(nativeObj); 761 } 762 763 // javadoc:Mat::put(row,col,data) put(int row, int col, double... data)764 public int put(int row, int col, double... data) { 765 int t = type(); 766 if (data == null || data.length % CvType.channels(t) != 0) 767 throw new UnsupportedOperationException( 768 "Provided data element number (" + 769 (data == null ? 0 : data.length) + 770 ") should be multiple of the Mat channels count (" + 771 CvType.channels(t) + ")"); 772 return nPutD(nativeObj, row, col, data.length, data); 773 } 774 775 // javadoc:Mat::put(idx,data) put(int[] idx, double... data)776 public int put(int[] idx, double... data) { 777 int t = type(); 778 if (data == null || data.length % CvType.channels(t) != 0) 779 throw new UnsupportedOperationException( 780 "Provided data element number (" + 781 (data == null ? 0 : data.length) + 782 ") should be multiple of the Mat channels count (" + 783 CvType.channels(t) + ")"); 784 if (idx.length != dims()) 785 throw new IllegalArgumentException("Incorrect number of indices"); 786 return nPutDIdx(nativeObj, idx, data.length, data); 787 } 788 789 // javadoc:Mat::put(row,col,data) put(int row, int col, float[] data)790 public int put(int row, int col, float[] data) { 791 int t = type(); 792 if (data == null || data.length % CvType.channels(t) != 0) 793 throw new UnsupportedOperationException( 794 "Provided data element number (" + 795 (data == null ? 0 : data.length) + 796 ") should be multiple of the Mat channels count (" + 797 CvType.channels(t) + ")"); 798 if (CvType.depth(t) == CvType.CV_32F) { 799 return nPutF(nativeObj, row, col, data.length, data); 800 } 801 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 802 } 803 804 // javadoc:Mat::put(idx,data) put(int[] idx, float[] data)805 public int put(int[] idx, float[] data) { 806 int t = type(); 807 if (data == null || data.length % CvType.channels(t) != 0) 808 throw new UnsupportedOperationException( 809 "Provided data element number (" + 810 (data == null ? 0 : data.length) + 811 ") should be multiple of the Mat channels count (" + 812 CvType.channels(t) + ")"); 813 if (idx.length != dims()) 814 throw new IllegalArgumentException("Incorrect number of indices"); 815 if (CvType.depth(t) == CvType.CV_32F) { 816 return nPutFIdx(nativeObj, idx, data.length, data); 817 } 818 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 819 } 820 821 // javadoc:Mat::put(row,col,data) put(int row, int col, int[] data)822 public int put(int row, int col, int[] data) { 823 int t = type(); 824 if (data == null || data.length % CvType.channels(t) != 0) 825 throw new UnsupportedOperationException( 826 "Provided data element number (" + 827 (data == null ? 0 : data.length) + 828 ") should be multiple of the Mat channels count (" + 829 CvType.channels(t) + ")"); 830 if (CvType.depth(t) == CvType.CV_32S) { 831 return nPutI(nativeObj, row, col, data.length, data); 832 } 833 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 834 } 835 836 // javadoc:Mat::put(idx,data) put(int[] idx, int[] data)837 public int put(int[] idx, int[] data) { 838 int t = type(); 839 if (data == null || data.length % CvType.channels(t) != 0) 840 throw new UnsupportedOperationException( 841 "Provided data element number (" + 842 (data == null ? 0 : data.length) + 843 ") should be multiple of the Mat channels count (" + 844 CvType.channels(t) + ")"); 845 if (idx.length != dims()) 846 throw new IllegalArgumentException("Incorrect number of indices"); 847 if (CvType.depth(t) == CvType.CV_32S) { 848 return nPutIIdx(nativeObj, idx, data.length, data); 849 } 850 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 851 } 852 853 // javadoc:Mat::put(row,col,data) put(int row, int col, short[] data)854 public int put(int row, int col, short[] data) { 855 int t = type(); 856 if (data == null || data.length % CvType.channels(t) != 0) 857 throw new UnsupportedOperationException( 858 "Provided data element number (" + 859 (data == null ? 0 : data.length) + 860 ") should be multiple of the Mat channels count (" + 861 CvType.channels(t) + ")"); 862 if (CvType.depth(t) == CvType.CV_16U || CvType.depth(t) == CvType.CV_16S) { 863 return nPutS(nativeObj, row, col, data.length, data); 864 } 865 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 866 } 867 868 // javadoc:Mat::put(idx,data) put(int[] idx, short[] data)869 public int put(int[] idx, short[] data) { 870 int t = type(); 871 if (data == null || data.length % CvType.channels(t) != 0) 872 throw new UnsupportedOperationException( 873 "Provided data element number (" + 874 (data == null ? 0 : data.length) + 875 ") should be multiple of the Mat channels count (" + 876 CvType.channels(t) + ")"); 877 if (idx.length != dims()) 878 throw new IllegalArgumentException("Incorrect number of indices"); 879 if (CvType.depth(t) == CvType.CV_16U || CvType.depth(t) == CvType.CV_16S) { 880 return nPutSIdx(nativeObj, idx, data.length, data); 881 } 882 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 883 } 884 885 // javadoc:Mat::put(row,col,data) put(int row, int col, byte[] data)886 public int put(int row, int col, byte[] data) { 887 int t = type(); 888 if (data == null || data.length % CvType.channels(t) != 0) 889 throw new UnsupportedOperationException( 890 "Provided data element number (" + 891 (data == null ? 0 : data.length) + 892 ") should be multiple of the Mat channels count (" + 893 CvType.channels(t) + ")"); 894 if (CvType.depth(t) == CvType.CV_8U || CvType.depth(t) == CvType.CV_8S) { 895 return nPutB(nativeObj, row, col, data.length, data); 896 } 897 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 898 } 899 900 // javadoc:Mat::put(idx,data) put(int[] idx, byte[] data)901 public int put(int[] idx, byte[] data) { 902 int t = type(); 903 if (data == null || data.length % CvType.channels(t) != 0) 904 throw new UnsupportedOperationException( 905 "Provided data element number (" + 906 (data == null ? 0 : data.length) + 907 ") should be multiple of the Mat channels count (" + 908 CvType.channels(t) + ")"); 909 if (idx.length != dims()) 910 throw new IllegalArgumentException("Incorrect number of indices"); 911 if (CvType.depth(t) == CvType.CV_8U || CvType.depth(t) == CvType.CV_8S) { 912 return nPutBIdx(nativeObj, idx, data.length, data); 913 } 914 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 915 } 916 917 // javadoc:Mat::put(row,col,data,offset,length) put(int row, int col, byte[] data, int offset, int length)918 public int put(int row, int col, byte[] data, int offset, int length) { 919 int t = type(); 920 if (data == null || length % CvType.channels(t) != 0) 921 throw new UnsupportedOperationException( 922 "Provided data element number (" + 923 (data == null ? 0 : data.length) + 924 ") should be multiple of the Mat channels count (" + 925 CvType.channels(t) + ")"); 926 if (CvType.depth(t) == CvType.CV_8U || CvType.depth(t) == CvType.CV_8S) { 927 return nPutBwOffset(nativeObj, row, col, length, offset, data); 928 } 929 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 930 } 931 932 // javadoc:Mat::put(idx,data,offset,length) put(int[] idx, byte[] data, int offset, int length)933 public int put(int[] idx, byte[] data, int offset, int length) { 934 int t = type(); 935 if (data == null || length % CvType.channels(t) != 0) 936 throw new UnsupportedOperationException( 937 "Provided data element number (" + 938 (data == null ? 0 : data.length) + 939 ") should be multiple of the Mat channels count (" + 940 CvType.channels(t) + ")"); 941 if (idx.length != dims()) 942 throw new IllegalArgumentException("Incorrect number of indices"); 943 if (CvType.depth(t) == CvType.CV_8U || CvType.depth(t) == CvType.CV_8S) { 944 return nPutBwIdxOffset(nativeObj, idx, length, offset, data); 945 } 946 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 947 } 948 949 // javadoc:Mat::get(row,col,data) get(int row, int col, byte[] data)950 public int get(int row, int col, byte[] data) { 951 int t = type(); 952 if (data == null || data.length % CvType.channels(t) != 0) 953 throw new UnsupportedOperationException( 954 "Provided data element number (" + 955 (data == null ? 0 : data.length) + 956 ") should be multiple of the Mat channels count (" + 957 CvType.channels(t) + ")"); 958 if (CvType.depth(t) == CvType.CV_8U || CvType.depth(t) == CvType.CV_8S) { 959 return nGetB(nativeObj, row, col, data.length, data); 960 } 961 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 962 } 963 964 // javadoc:Mat::get(idx,data) get(int[] idx, byte[] data)965 public int get(int[] idx, byte[] data) { 966 int t = type(); 967 if (data == null || data.length % CvType.channels(t) != 0) 968 throw new UnsupportedOperationException( 969 "Provided data element number (" + 970 (data == null ? 0 : data.length) + 971 ") should be multiple of the Mat channels count (" + 972 CvType.channels(t) + ")"); 973 if (idx.length != dims()) 974 throw new IllegalArgumentException("Incorrect number of indices"); 975 if (CvType.depth(t) == CvType.CV_8U || CvType.depth(t) == CvType.CV_8S) { 976 return nGetBIdx(nativeObj, idx, data.length, data); 977 } 978 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 979 } 980 981 // javadoc:Mat::get(row,col,data) get(int row, int col, short[] data)982 public int get(int row, int col, short[] data) { 983 int t = type(); 984 if (data == null || data.length % CvType.channels(t) != 0) 985 throw new UnsupportedOperationException( 986 "Provided data element number (" + 987 (data == null ? 0 : data.length) + 988 ") should be multiple of the Mat channels count (" + 989 CvType.channels(t) + ")"); 990 if (CvType.depth(t) == CvType.CV_16U || CvType.depth(t) == CvType.CV_16S) { 991 return nGetS(nativeObj, row, col, data.length, data); 992 } 993 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 994 } 995 996 // javadoc:Mat::get(idx,data) get(int[] idx, short[] data)997 public int get(int[] idx, short[] data) { 998 int t = type(); 999 if (data == null || data.length % CvType.channels(t) != 0) 1000 throw new UnsupportedOperationException( 1001 "Provided data element number (" + 1002 (data == null ? 0 : data.length) + 1003 ") should be multiple of the Mat channels count (" + 1004 CvType.channels(t) + ")"); 1005 if (idx.length != dims()) 1006 throw new IllegalArgumentException("Incorrect number of indices"); 1007 if (CvType.depth(t) == CvType.CV_16U || CvType.depth(t) == CvType.CV_16S) { 1008 return nGetSIdx(nativeObj, idx, data.length, data); 1009 } 1010 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 1011 } 1012 1013 // javadoc:Mat::get(row,col,data) get(int row, int col, int[] data)1014 public int get(int row, int col, int[] data) { 1015 int t = type(); 1016 if (data == null || data.length % CvType.channels(t) != 0) 1017 throw new UnsupportedOperationException( 1018 "Provided data element number (" + 1019 (data == null ? 0 : data.length) + 1020 ") should be multiple of the Mat channels count (" + 1021 CvType.channels(t) + ")"); 1022 if (CvType.depth(t) == CvType.CV_32S) { 1023 return nGetI(nativeObj, row, col, data.length, data); 1024 } 1025 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 1026 } 1027 1028 // javadoc:Mat::get(idx,data) get(int[] idx, int[] data)1029 public int get(int[] idx, int[] data) { 1030 int t = type(); 1031 if (data == null || data.length % CvType.channels(t) != 0) 1032 throw new UnsupportedOperationException( 1033 "Provided data element number (" + 1034 (data == null ? 0 : data.length) + 1035 ") should be multiple of the Mat channels count (" + 1036 CvType.channels(t) + ")"); 1037 if (idx.length != dims()) 1038 throw new IllegalArgumentException("Incorrect number of indices"); 1039 if (CvType.depth(t) == CvType.CV_32S) { 1040 return nGetIIdx(nativeObj, idx, data.length, data); 1041 } 1042 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 1043 } 1044 1045 // javadoc:Mat::get(row,col,data) get(int row, int col, float[] data)1046 public int get(int row, int col, float[] data) { 1047 int t = type(); 1048 if (data == null || data.length % CvType.channels(t) != 0) 1049 throw new UnsupportedOperationException( 1050 "Provided data element number (" + 1051 (data == null ? 0 : data.length) + 1052 ") should be multiple of the Mat channels count (" + 1053 CvType.channels(t) + ")"); 1054 if (CvType.depth(t) == CvType.CV_32F) { 1055 return nGetF(nativeObj, row, col, data.length, data); 1056 } 1057 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 1058 } 1059 1060 // javadoc:Mat::get(idx,data) get(int[] idx, float[] data)1061 public int get(int[] idx, float[] data) { 1062 int t = type(); 1063 if (data == null || data.length % CvType.channels(t) != 0) 1064 throw new UnsupportedOperationException( 1065 "Provided data element number (" + 1066 (data == null ? 0 : data.length) + 1067 ") should be multiple of the Mat channels count (" + 1068 CvType.channels(t) + ")"); 1069 if (idx.length != dims()) 1070 throw new IllegalArgumentException("Incorrect number of indices"); 1071 if (CvType.depth(t) == CvType.CV_32F) { 1072 return nGetFIdx(nativeObj, idx, data.length, data); 1073 } 1074 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 1075 } 1076 1077 // javadoc:Mat::get(row,col,data) get(int row, int col, double[] data)1078 public int get(int row, int col, double[] data) { 1079 int t = type(); 1080 if (data == null || data.length % CvType.channels(t) != 0) 1081 throw new UnsupportedOperationException( 1082 "Provided data element number (" + 1083 (data == null ? 0 : data.length) + 1084 ") should be multiple of the Mat channels count (" + 1085 CvType.channels(t) + ")"); 1086 if (CvType.depth(t) == CvType.CV_64F) { 1087 return nGetD(nativeObj, row, col, data.length, data); 1088 } 1089 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 1090 } 1091 1092 // javadoc:Mat::get(idx,data) get(int[] idx, double[] data)1093 public int get(int[] idx, double[] data) { 1094 int t = type(); 1095 if (data == null || data.length % CvType.channels(t) != 0) 1096 throw new UnsupportedOperationException( 1097 "Provided data element number (" + 1098 (data == null ? 0 : data.length) + 1099 ") should be multiple of the Mat channels count (" + 1100 CvType.channels(t) + ")"); 1101 if (idx.length != dims()) 1102 throw new IllegalArgumentException("Incorrect number of indices"); 1103 if (CvType.depth(t) == CvType.CV_64F) { 1104 return nGetDIdx(nativeObj, idx, data.length, data); 1105 } 1106 throw new UnsupportedOperationException("Mat data type is not compatible: " + t); 1107 } 1108 1109 // javadoc:Mat::get(row,col) get(int row, int col)1110 public double[] get(int row, int col) { 1111 return nGet(nativeObj, row, col); 1112 } 1113 1114 // javadoc:Mat::get(idx) get(int[] idx)1115 public double[] get(int[] idx) { 1116 if (idx.length != dims()) 1117 throw new IllegalArgumentException("Incorrect number of indices"); 1118 return nGetIdx(nativeObj, idx); 1119 } 1120 1121 // javadoc:Mat::height() height()1122 public int height() { 1123 return rows(); 1124 } 1125 1126 // javadoc:Mat::width() width()1127 public int width() { 1128 return cols(); 1129 } 1130 1131 // javadoc:Mat::at(clazz, row, col) 1132 @SuppressWarnings("unchecked") at(Class<T> clazz, int row, int col)1133 public <T> Atable<T> at(Class<T> clazz, int row, int col) { 1134 if (clazz == Byte.class || clazz == byte.class) { 1135 return (Atable<T>)new AtableByte(this, row, col); 1136 } else if (clazz == Double.class || clazz == double.class) { 1137 return (Atable<T>)new AtableDouble(this, row, col); 1138 } else if (clazz == Float.class || clazz == float.class) { 1139 return (Atable<T>)new AtableFloat(this, row, col); 1140 } else if (clazz == Integer.class || clazz == int.class) { 1141 return (Atable<T>)new AtableInteger(this, row, col); 1142 } else if (clazz == Short.class || clazz == short.class) { 1143 return (Atable<T>)new AtableShort(this, row, col); 1144 } else { 1145 throw new RuntimeException("Unsupported class type"); 1146 } 1147 } 1148 1149 // javadoc:Mat::at(clazz, idx) 1150 @SuppressWarnings("unchecked") at(Class<T> clazz, int[] idx)1151 public <T> Atable<T> at(Class<T> clazz, int[] idx) { 1152 if (clazz == Byte.class || clazz == byte.class) { 1153 return (Atable<T>)new AtableByte(this, idx); 1154 } else if (clazz == Double.class || clazz == double.class) { 1155 return (Atable<T>)new AtableDouble(this, idx); 1156 } else if (clazz == Float.class || clazz == float.class) { 1157 return (Atable<T>)new AtableFloat(this, idx); 1158 } else if (clazz == Integer.class || clazz == int.class) { 1159 return (Atable<T>)new AtableInteger(this, idx); 1160 } else if (clazz == Short.class || clazz == short.class) { 1161 return (Atable<T>)new AtableShort(this, idx); 1162 } else { 1163 throw new RuntimeException("Unsupported class parameter"); 1164 } 1165 } 1166 1167 public static class Tuple2<T> { Tuple2(T _0, T _1)1168 public Tuple2(T _0, T _1) { 1169 this._0 = _0; 1170 this._1 = _1; 1171 } 1172 get_0()1173 public T get_0() { 1174 return _0; 1175 } 1176 get_1()1177 public T get_1() { 1178 return _1; 1179 } 1180 1181 private final T _0; 1182 private final T _1; 1183 } 1184 1185 public static class Tuple3<T> { Tuple3(T _0, T _1, T _2)1186 public Tuple3(T _0, T _1, T _2) { 1187 this._0 = _0; 1188 this._1 = _1; 1189 this._2 = _2; 1190 } 1191 get_0()1192 public T get_0() { 1193 return _0; 1194 } 1195 get_1()1196 public T get_1() { 1197 return _1; 1198 } 1199 get_2()1200 public T get_2() { 1201 return _2; 1202 } 1203 1204 private final T _0; 1205 private final T _1; 1206 private final T _2; 1207 } 1208 1209 public static class Tuple4<T> { Tuple4(T _0, T _1, T _2, T _3)1210 public Tuple4(T _0, T _1, T _2, T _3) { 1211 this._0 = _0; 1212 this._1 = _1; 1213 this._2 = _2; 1214 this._3 = _3; 1215 } 1216 get_0()1217 public T get_0() { 1218 return _0; 1219 } 1220 get_1()1221 public T get_1() { 1222 return _1; 1223 } 1224 get_2()1225 public T get_2() { 1226 return _2; 1227 } 1228 get_3()1229 public T get_3() { 1230 return _3; 1231 } 1232 1233 private final T _0; 1234 private final T _1; 1235 private final T _2; 1236 private final T _3; 1237 } 1238 1239 public interface Atable<T> { getV()1240 T getV(); setV(T v)1241 void setV(T v); getV2c()1242 Tuple2<T> getV2c(); setV2c(Tuple2<T> v)1243 void setV2c(Tuple2<T> v); getV3c()1244 Tuple3<T> getV3c(); setV3c(Tuple3<T> v)1245 void setV3c(Tuple3<T> v); getV4c()1246 Tuple4<T> getV4c(); setV4c(Tuple4<T> v)1247 void setV4c(Tuple4<T> v); 1248 } 1249 1250 private static class AtableBase { 1251 AtableBase(Mat mat, int row, int col)1252 protected AtableBase(Mat mat, int row, int col) { 1253 this.mat = mat; 1254 indices = new int[2]; 1255 indices[0] = row; 1256 indices[1] = col; 1257 } 1258 AtableBase(Mat mat, int[] indices)1259 protected AtableBase(Mat mat, int[] indices) { 1260 this.mat = mat; 1261 this.indices = indices; 1262 } 1263 1264 protected final Mat mat; 1265 protected final int[] indices; 1266 } 1267 1268 private static class AtableByte extends AtableBase implements Atable<Byte> { 1269 AtableByte(Mat mat, int row, int col)1270 public AtableByte(Mat mat, int row, int col) { 1271 super(mat, row, col); 1272 } 1273 AtableByte(Mat mat, int[] indices)1274 public AtableByte(Mat mat, int[] indices) { 1275 super(mat, indices); 1276 } 1277 1278 @Override getV()1279 public Byte getV() { 1280 byte[] data = new byte[1]; 1281 mat.get(indices, data); 1282 return data[0]; 1283 } 1284 1285 @Override setV(Byte v)1286 public void setV(Byte v) { 1287 byte[] data = new byte[] { v }; 1288 mat.put(indices, data); 1289 } 1290 1291 @Override getV2c()1292 public Tuple2<Byte> getV2c() { 1293 byte[] data = new byte[2]; 1294 mat.get(indices, data); 1295 return new Tuple2<Byte>(data[0], data[1]); 1296 } 1297 1298 @Override setV2c(Tuple2<Byte> v)1299 public void setV2c(Tuple2<Byte> v) { 1300 byte[] data = new byte[] { v._0, v._1 }; 1301 mat.put(indices, data); 1302 } 1303 1304 @Override getV3c()1305 public Tuple3<Byte> getV3c() { 1306 byte[] data = new byte[3]; 1307 mat.get(indices, data); 1308 return new Tuple3<Byte>(data[0], data[1], data[2]); 1309 } 1310 1311 @Override setV3c(Tuple3<Byte> v)1312 public void setV3c(Tuple3<Byte> v) { 1313 byte[] data = new byte[] { v._0, v._1, v._2 }; 1314 mat.put(indices, data); 1315 } 1316 1317 @Override getV4c()1318 public Tuple4<Byte> getV4c() { 1319 byte[] data = new byte[4]; 1320 mat.get(indices, data); 1321 return new Tuple4<Byte>(data[0], data[1], data[2], data[3]); 1322 } 1323 1324 @Override setV4c(Tuple4<Byte> v)1325 public void setV4c(Tuple4<Byte> v) { 1326 byte[] data = new byte[] { v._0, v._1, v._2, v._3 }; 1327 mat.put(indices, data); 1328 } 1329 } 1330 1331 private static class AtableDouble extends AtableBase implements Atable<Double> { 1332 AtableDouble(Mat mat, int row, int col)1333 public AtableDouble(Mat mat, int row, int col) { 1334 super(mat, row, col); 1335 } 1336 AtableDouble(Mat mat, int[] indices)1337 public AtableDouble(Mat mat, int[] indices) { 1338 super(mat, indices); 1339 } 1340 1341 @Override getV()1342 public Double getV() { 1343 double[] data = new double[1]; 1344 mat.get(indices, data); 1345 return data[0]; 1346 } 1347 1348 @Override setV(Double v)1349 public void setV(Double v) { 1350 double[] data = new double[] { v }; 1351 mat.put(indices, data); 1352 } 1353 1354 @Override getV2c()1355 public Tuple2<Double> getV2c() { 1356 double[] data = new double[2]; 1357 mat.get(indices, data); 1358 return new Tuple2<Double>(data[0], data[1]); 1359 } 1360 1361 @Override setV2c(Tuple2<Double> v)1362 public void setV2c(Tuple2<Double> v) { 1363 double[] data = new double[] { v._0, v._1 }; 1364 mat.put(indices, data); 1365 } 1366 1367 @Override getV3c()1368 public Tuple3<Double> getV3c() { 1369 double[] data = new double[3]; 1370 mat.get(indices, data); 1371 return new Tuple3<Double>(data[0], data[1], data[2]); 1372 } 1373 1374 @Override setV3c(Tuple3<Double> v)1375 public void setV3c(Tuple3<Double> v) { 1376 double[] data = new double[] { v._0, v._1, v._2 }; 1377 mat.put(indices, data); 1378 } 1379 1380 @Override getV4c()1381 public Tuple4<Double> getV4c() { 1382 double[] data = new double[4]; 1383 mat.get(indices, data); 1384 return new Tuple4<Double>(data[0], data[1], data[2], data[3]); 1385 } 1386 1387 @Override setV4c(Tuple4<Double> v)1388 public void setV4c(Tuple4<Double> v) { 1389 double[] data = new double[] { v._0, v._1, v._2, v._3 }; 1390 mat.put(indices, data); 1391 } 1392 } 1393 1394 private static class AtableFloat extends AtableBase implements Atable<Float> { 1395 AtableFloat(Mat mat, int row, int col)1396 public AtableFloat(Mat mat, int row, int col) { 1397 super(mat, row, col); 1398 } 1399 AtableFloat(Mat mat, int[] indices)1400 public AtableFloat(Mat mat, int[] indices) { 1401 super(mat, indices); 1402 } 1403 1404 @Override getV()1405 public Float getV() { 1406 float[] data = new float[1]; 1407 mat.get(indices, data); 1408 return data[0]; 1409 } 1410 1411 @Override setV(Float v)1412 public void setV(Float v) { 1413 float[] data = new float[] { v }; 1414 mat.put(indices, data); 1415 } 1416 1417 @Override getV2c()1418 public Tuple2<Float> getV2c() { 1419 float[] data = new float[2]; 1420 mat.get(indices, data); 1421 return new Tuple2<Float>(data[0], data[1]); 1422 } 1423 1424 @Override setV2c(Tuple2<Float> v)1425 public void setV2c(Tuple2<Float> v) { 1426 float[] data = new float[] { v._0, v._1 }; 1427 mat.put(indices, data); 1428 } 1429 1430 @Override getV3c()1431 public Tuple3<Float> getV3c() { 1432 float[] data = new float[3]; 1433 mat.get(indices, data); 1434 return new Tuple3<Float>(data[0], data[1], data[2]); 1435 } 1436 1437 @Override setV3c(Tuple3<Float> v)1438 public void setV3c(Tuple3<Float> v) { 1439 float[] data = new float[] { v._0, v._1, v._2 }; 1440 mat.put(indices, data); 1441 } 1442 1443 @Override getV4c()1444 public Tuple4<Float> getV4c() { 1445 float[] data = new float[4]; 1446 mat.get(indices, data); 1447 return new Tuple4<Float>(data[0], data[1], data[2], data[3]); 1448 } 1449 1450 @Override setV4c(Tuple4<Float> v)1451 public void setV4c(Tuple4<Float> v) { 1452 double[] data = new double[] { v._0, v._1, v._2, v._3 }; 1453 mat.put(indices, data); 1454 } 1455 } 1456 1457 private static class AtableInteger extends AtableBase implements Atable<Integer> { 1458 AtableInteger(Mat mat, int row, int col)1459 public AtableInteger(Mat mat, int row, int col) { 1460 super(mat, row, col); 1461 } 1462 AtableInteger(Mat mat, int[] indices)1463 public AtableInteger(Mat mat, int[] indices) { 1464 super(mat, indices); 1465 } 1466 1467 @Override getV()1468 public Integer getV() { 1469 int[] data = new int[1]; 1470 mat.get(indices, data); 1471 return data[0]; 1472 } 1473 1474 @Override setV(Integer v)1475 public void setV(Integer v) { 1476 int[] data = new int[] { v }; 1477 mat.put(indices, data); 1478 } 1479 1480 @Override getV2c()1481 public Tuple2<Integer> getV2c() { 1482 int[] data = new int[2]; 1483 mat.get(indices, data); 1484 return new Tuple2<Integer>(data[0], data[1]); 1485 } 1486 1487 @Override setV2c(Tuple2<Integer> v)1488 public void setV2c(Tuple2<Integer> v) { 1489 int[] data = new int[] { v._0, v._1 }; 1490 mat.put(indices, data); 1491 } 1492 1493 @Override getV3c()1494 public Tuple3<Integer> getV3c() { 1495 int[] data = new int[3]; 1496 mat.get(indices, data); 1497 return new Tuple3<Integer>(data[0], data[1], data[2]); 1498 } 1499 1500 @Override setV3c(Tuple3<Integer> v)1501 public void setV3c(Tuple3<Integer> v) { 1502 int[] data = new int[] { v._0, v._1, v._2 }; 1503 mat.put(indices, data); 1504 } 1505 1506 @Override getV4c()1507 public Tuple4<Integer> getV4c() { 1508 int[] data = new int[4]; 1509 mat.get(indices, data); 1510 return new Tuple4<Integer>(data[0], data[1], data[2], data[3]); 1511 } 1512 1513 @Override setV4c(Tuple4<Integer> v)1514 public void setV4c(Tuple4<Integer> v) { 1515 int[] data = new int[] { v._0, v._1, v._2, v._3 }; 1516 mat.put(indices, data); 1517 } 1518 } 1519 1520 private static class AtableShort extends AtableBase implements Atable<Short> { 1521 AtableShort(Mat mat, int row, int col)1522 public AtableShort(Mat mat, int row, int col) { 1523 super(mat, row, col); 1524 } 1525 AtableShort(Mat mat, int[] indices)1526 public AtableShort(Mat mat, int[] indices) { 1527 super(mat, indices); 1528 } 1529 1530 @Override getV()1531 public Short getV() { 1532 short[] data = new short[1]; 1533 mat.get(indices, data); 1534 return data[0]; 1535 } 1536 1537 @Override setV(Short v)1538 public void setV(Short v) { 1539 short[] data = new short[] { v }; 1540 mat.put(indices, data); 1541 } 1542 1543 @Override getV2c()1544 public Tuple2<Short> getV2c() { 1545 short[] data = new short[2]; 1546 mat.get(indices, data); 1547 return new Tuple2<Short>(data[0], data[1]); 1548 } 1549 1550 @Override setV2c(Tuple2<Short> v)1551 public void setV2c(Tuple2<Short> v) { 1552 short[] data = new short[] { v._0, v._1 }; 1553 mat.put(indices, data); 1554 } 1555 1556 @Override getV3c()1557 public Tuple3<Short> getV3c() { 1558 short[] data = new short[3]; 1559 mat.get(indices, data); 1560 return new Tuple3<Short>(data[0], data[1], data[2]); 1561 } 1562 1563 @Override setV3c(Tuple3<Short> v)1564 public void setV3c(Tuple3<Short> v) { 1565 short[] data = new short[] { v._0, v._1, v._2 }; 1566 mat.put(indices, data); 1567 } 1568 1569 @Override getV4c()1570 public Tuple4<Short> getV4c() { 1571 short[] data = new short[4]; 1572 mat.get(indices, data); 1573 return new Tuple4<Short>(data[0], data[1], data[2], data[3]); 1574 } 1575 1576 @Override setV4c(Tuple4<Short> v)1577 public void setV4c(Tuple4<Short> v) { 1578 short[] data = new short[] { v._0, v._1, v._2, v._3 }; 1579 mat.put(indices, data); 1580 } 1581 } 1582 1583 // javadoc:Mat::getNativeObjAddr() getNativeObjAddr()1584 public long getNativeObjAddr() { 1585 return nativeObj; 1586 } 1587 1588 // C++: Mat::Mat() n_Mat()1589 private static native long n_Mat(); 1590 1591 // C++: Mat::Mat(int rows, int cols, int type) n_Mat(int rows, int cols, int type)1592 private static native long n_Mat(int rows, int cols, int type); 1593 1594 // C++: Mat::Mat(int ndims, const int* sizes, int type) n_Mat(int ndims, int[] sizes, int type)1595 private static native long n_Mat(int ndims, int[] sizes, int type); 1596 1597 // C++: Mat::Mat(int rows, int cols, int type, void* data) n_Mat(int rows, int cols, int type, ByteBuffer data)1598 private static native long n_Mat(int rows, int cols, int type, ByteBuffer data); 1599 1600 // C++: Mat::Mat(int rows, int cols, int type, void* data, size_t step) n_Mat(int rows, int cols, int type, ByteBuffer data, long step)1601 private static native long n_Mat(int rows, int cols, int type, ByteBuffer data, long step); 1602 1603 // C++: Mat::Mat(Size size, int type) n_Mat(double size_width, double size_height, int type)1604 private static native long n_Mat(double size_width, double size_height, int type); 1605 1606 // C++: Mat::Mat(int rows, int cols, int type, Scalar s) n_Mat(int rows, int cols, int type, double s_val0, double s_val1, double s_val2, double s_val3)1607 private static native long n_Mat(int rows, int cols, int type, double s_val0, double s_val1, double s_val2, double s_val3); 1608 1609 // C++: Mat::Mat(Size size, int type, Scalar s) n_Mat(double size_width, double size_height, int type, double s_val0, double s_val1, double s_val2, double s_val3)1610 private static native long n_Mat(double size_width, double size_height, int type, double s_val0, double s_val1, double s_val2, double s_val3); 1611 1612 // C++: Mat::Mat(int ndims, const int* sizes, int type, Scalar s) n_Mat(int ndims, int[] sizes, int type, double s_val0, double s_val1, double s_val2, double s_val3)1613 private static native long n_Mat(int ndims, int[] sizes, int type, double s_val0, double s_val1, double s_val2, double s_val3); 1614 1615 // C++: Mat::Mat(Mat m, Range rowRange, Range colRange = Range::all()) n_Mat(long m_nativeObj, int rowRange_start, int rowRange_end, int colRange_start, int colRange_end)1616 private static native long n_Mat(long m_nativeObj, int rowRange_start, int rowRange_end, int colRange_start, int colRange_end); 1617 n_Mat(long m_nativeObj, int rowRange_start, int rowRange_end)1618 private static native long n_Mat(long m_nativeObj, int rowRange_start, int rowRange_end); 1619 1620 // C++: Mat::Mat(const Mat& m, const std::vector<Range>& ranges) n_Mat(long m_nativeObj, Range[] ranges)1621 private static native long n_Mat(long m_nativeObj, Range[] ranges); 1622 1623 // C++: Mat Mat::adjustROI(int dtop, int dbottom, int dleft, int dright) n_adjustROI(long nativeObj, int dtop, int dbottom, int dleft, int dright)1624 private static native long n_adjustROI(long nativeObj, int dtop, int dbottom, int dleft, int dright); 1625 1626 // C++: void Mat::assignTo(Mat m, int type = -1) n_assignTo(long nativeObj, long m_nativeObj, int type)1627 private static native void n_assignTo(long nativeObj, long m_nativeObj, int type); 1628 n_assignTo(long nativeObj, long m_nativeObj)1629 private static native void n_assignTo(long nativeObj, long m_nativeObj); 1630 1631 // C++: int Mat::channels() n_channels(long nativeObj)1632 private static native int n_channels(long nativeObj); 1633 1634 // C++: int Mat::checkVector(int elemChannels, int depth = -1, bool 1635 // requireContinuous = true) n_checkVector(long nativeObj, int elemChannels, int depth, boolean requireContinuous)1636 private static native int n_checkVector(long nativeObj, int elemChannels, int depth, boolean requireContinuous); 1637 n_checkVector(long nativeObj, int elemChannels, int depth)1638 private static native int n_checkVector(long nativeObj, int elemChannels, int depth); 1639 n_checkVector(long nativeObj, int elemChannels)1640 private static native int n_checkVector(long nativeObj, int elemChannels); 1641 1642 // C++: Mat Mat::clone() n_clone(long nativeObj)1643 private static native long n_clone(long nativeObj); 1644 1645 // C++: Mat Mat::col(int x) n_col(long nativeObj, int x)1646 private static native long n_col(long nativeObj, int x); 1647 1648 // C++: Mat Mat::colRange(int startcol, int endcol) n_colRange(long nativeObj, int startcol, int endcol)1649 private static native long n_colRange(long nativeObj, int startcol, int endcol); 1650 1651 // C++: int Mat::dims() n_dims(long nativeObj)1652 private static native int n_dims(long nativeObj); 1653 1654 // C++: int Mat::cols() n_cols(long nativeObj)1655 private static native int n_cols(long nativeObj); 1656 1657 // C++: void Mat::convertTo(Mat& m, int rtype, double alpha = 1, double beta 1658 // = 0) n_convertTo(long nativeObj, long m_nativeObj, int rtype, double alpha, double beta)1659 private static native void n_convertTo(long nativeObj, long m_nativeObj, int rtype, double alpha, double beta); 1660 n_convertTo(long nativeObj, long m_nativeObj, int rtype, double alpha)1661 private static native void n_convertTo(long nativeObj, long m_nativeObj, int rtype, double alpha); 1662 n_convertTo(long nativeObj, long m_nativeObj, int rtype)1663 private static native void n_convertTo(long nativeObj, long m_nativeObj, int rtype); 1664 1665 // C++: void Mat::copyTo(Mat& m) n_copyTo(long nativeObj, long m_nativeObj)1666 private static native void n_copyTo(long nativeObj, long m_nativeObj); 1667 1668 // C++: void Mat::copyTo(Mat& m, Mat mask) n_copyTo(long nativeObj, long m_nativeObj, long mask_nativeObj)1669 private static native void n_copyTo(long nativeObj, long m_nativeObj, long mask_nativeObj); 1670 1671 // C++: void Mat::create(int rows, int cols, int type) n_create(long nativeObj, int rows, int cols, int type)1672 private static native void n_create(long nativeObj, int rows, int cols, int type); 1673 1674 // C++: void Mat::create(Size size, int type) n_create(long nativeObj, double size_width, double size_height, int type)1675 private static native void n_create(long nativeObj, double size_width, double size_height, int type); 1676 1677 // C++: void Mat::create(int ndims, const int* sizes, int type) n_create(long nativeObj, int ndims, int[] sizes, int type)1678 private static native void n_create(long nativeObj, int ndims, int[] sizes, int type); 1679 1680 // C++: void Mat::copySize(const Mat& m) n_copySize(long nativeObj, long m_nativeObj)1681 private static native void n_copySize(long nativeObj, long m_nativeObj); 1682 1683 // C++: Mat Mat::cross(Mat m) n_cross(long nativeObj, long m_nativeObj)1684 private static native long n_cross(long nativeObj, long m_nativeObj); 1685 1686 // C++: long Mat::dataAddr() n_dataAddr(long nativeObj)1687 private static native long n_dataAddr(long nativeObj); 1688 1689 // C++: int Mat::depth() n_depth(long nativeObj)1690 private static native int n_depth(long nativeObj); 1691 1692 // C++: Mat Mat::diag(int d = 0) n_diag(long nativeObj, int d)1693 private static native long n_diag(long nativeObj, int d); 1694 1695 // C++: static Mat Mat::diag(Mat d) n_diag(long d_nativeObj)1696 private static native long n_diag(long d_nativeObj); 1697 1698 // C++: double Mat::dot(Mat m) n_dot(long nativeObj, long m_nativeObj)1699 private static native double n_dot(long nativeObj, long m_nativeObj); 1700 1701 // C++: size_t Mat::elemSize() n_elemSize(long nativeObj)1702 private static native long n_elemSize(long nativeObj); 1703 1704 // C++: size_t Mat::elemSize1() n_elemSize1(long nativeObj)1705 private static native long n_elemSize1(long nativeObj); 1706 1707 // C++: bool Mat::empty() n_empty(long nativeObj)1708 private static native boolean n_empty(long nativeObj); 1709 1710 // C++: static Mat Mat::eye(int rows, int cols, int type) n_eye(int rows, int cols, int type)1711 private static native long n_eye(int rows, int cols, int type); 1712 1713 // C++: static Mat Mat::eye(Size size, int type) n_eye(double size_width, double size_height, int type)1714 private static native long n_eye(double size_width, double size_height, int type); 1715 1716 // C++: Mat Mat::inv(int method = DECOMP_LU) n_inv(long nativeObj, int method)1717 private static native long n_inv(long nativeObj, int method); 1718 n_inv(long nativeObj)1719 private static native long n_inv(long nativeObj); 1720 1721 // C++: bool Mat::isContinuous() n_isContinuous(long nativeObj)1722 private static native boolean n_isContinuous(long nativeObj); 1723 1724 // C++: bool Mat::isSubmatrix() n_isSubmatrix(long nativeObj)1725 private static native boolean n_isSubmatrix(long nativeObj); 1726 1727 // C++: void Mat::locateROI(Size wholeSize, Point ofs) locateROI_0(long nativeObj, double[] wholeSize_out, double[] ofs_out)1728 private static native void locateROI_0(long nativeObj, double[] wholeSize_out, double[] ofs_out); 1729 1730 // C++: Mat Mat::mul(Mat m, double scale = 1) n_mul(long nativeObj, long m_nativeObj, double scale)1731 private static native long n_mul(long nativeObj, long m_nativeObj, double scale); 1732 n_mul(long nativeObj, long m_nativeObj)1733 private static native long n_mul(long nativeObj, long m_nativeObj); 1734 1735 // C++: static Mat Mat::ones(int rows, int cols, int type) n_ones(int rows, int cols, int type)1736 private static native long n_ones(int rows, int cols, int type); 1737 1738 // C++: static Mat Mat::ones(Size size, int type) n_ones(double size_width, double size_height, int type)1739 private static native long n_ones(double size_width, double size_height, int type); 1740 1741 // C++: static Mat Mat::ones(int ndims, const int* sizes, int type) n_ones(int ndims, int[] sizes, int type)1742 private static native long n_ones(int ndims, int[] sizes, int type); 1743 1744 // C++: void Mat::push_back(Mat m) n_push_back(long nativeObj, long m_nativeObj)1745 private static native void n_push_back(long nativeObj, long m_nativeObj); 1746 1747 // C++: void Mat::release() n_release(long nativeObj)1748 private static native void n_release(long nativeObj); 1749 1750 // C++: Mat Mat::reshape(int cn, int rows = 0) n_reshape(long nativeObj, int cn, int rows)1751 private static native long n_reshape(long nativeObj, int cn, int rows); 1752 n_reshape(long nativeObj, int cn)1753 private static native long n_reshape(long nativeObj, int cn); 1754 1755 // C++: Mat Mat::reshape(int cn, int newndims, const int* newsz) n_reshape_1(long nativeObj, int cn, int newndims, int[] newsz)1756 private static native long n_reshape_1(long nativeObj, int cn, int newndims, int[] newsz); 1757 1758 // C++: Mat Mat::row(int y) n_row(long nativeObj, int y)1759 private static native long n_row(long nativeObj, int y); 1760 1761 // C++: Mat Mat::rowRange(int startrow, int endrow) n_rowRange(long nativeObj, int startrow, int endrow)1762 private static native long n_rowRange(long nativeObj, int startrow, int endrow); 1763 1764 // C++: int Mat::rows() n_rows(long nativeObj)1765 private static native int n_rows(long nativeObj); 1766 1767 // C++: Mat Mat::operator =(Scalar s) n_setTo(long nativeObj, double s_val0, double s_val1, double s_val2, double s_val3)1768 private static native long n_setTo(long nativeObj, double s_val0, double s_val1, double s_val2, double s_val3); 1769 1770 // C++: Mat Mat::setTo(Scalar value, Mat mask = Mat()) n_setTo(long nativeObj, double s_val0, double s_val1, double s_val2, double s_val3, long mask_nativeObj)1771 private static native long n_setTo(long nativeObj, double s_val0, double s_val1, double s_val2, double s_val3, long mask_nativeObj); 1772 1773 // C++: Mat Mat::setTo(Mat value, Mat mask = Mat()) n_setTo(long nativeObj, long value_nativeObj, long mask_nativeObj)1774 private static native long n_setTo(long nativeObj, long value_nativeObj, long mask_nativeObj); 1775 n_setTo(long nativeObj, long value_nativeObj)1776 private static native long n_setTo(long nativeObj, long value_nativeObj); 1777 1778 // C++: Size Mat::size() n_size(long nativeObj)1779 private static native double[] n_size(long nativeObj); 1780 1781 // C++: int Mat::size(int i) n_size_i(long nativeObj, int i)1782 private static native int n_size_i(long nativeObj, int i); 1783 1784 // C++: size_t Mat::step1(int i = 0) n_step1(long nativeObj, int i)1785 private static native long n_step1(long nativeObj, int i); 1786 n_step1(long nativeObj)1787 private static native long n_step1(long nativeObj); 1788 1789 // C++: Mat Mat::operator()(Range rowRange, Range colRange) n_submat_rr(long nativeObj, int rowRange_start, int rowRange_end, int colRange_start, int colRange_end)1790 private static native long n_submat_rr(long nativeObj, int rowRange_start, int rowRange_end, int colRange_start, int colRange_end); 1791 1792 // C++: Mat Mat::operator()(const std::vector<Range>& ranges) n_submat_ranges(long nativeObj, Range[] ranges)1793 private static native long n_submat_ranges(long nativeObj, Range[] ranges); 1794 1795 // C++: Mat Mat::operator()(Rect roi) n_submat(long nativeObj, int roi_x, int roi_y, int roi_width, int roi_height)1796 private static native long n_submat(long nativeObj, int roi_x, int roi_y, int roi_width, int roi_height); 1797 1798 // C++: Mat Mat::t() n_t(long nativeObj)1799 private static native long n_t(long nativeObj); 1800 1801 // C++: size_t Mat::total() n_total(long nativeObj)1802 private static native long n_total(long nativeObj); 1803 1804 // C++: int Mat::type() n_type(long nativeObj)1805 private static native int n_type(long nativeObj); 1806 1807 // C++: static Mat Mat::zeros(int rows, int cols, int type) n_zeros(int rows, int cols, int type)1808 private static native long n_zeros(int rows, int cols, int type); 1809 1810 // C++: static Mat Mat::zeros(Size size, int type) n_zeros(double size_width, double size_height, int type)1811 private static native long n_zeros(double size_width, double size_height, int type); 1812 1813 // C++: static Mat Mat::zeros(int ndims, const int* sizes, int type) n_zeros(int ndims, int[] sizes, int type)1814 private static native long n_zeros(int ndims, int[] sizes, int type); 1815 1816 // native support for java finalize() n_delete(long nativeObj)1817 private static native void n_delete(long nativeObj); 1818 nPutD(long self, int row, int col, int count, double[] data)1819 private static native int nPutD(long self, int row, int col, int count, double[] data); 1820 nPutDIdx(long self, int[] idx, int count, double[] data)1821 private static native int nPutDIdx(long self, int[] idx, int count, double[] data); 1822 nPutF(long self, int row, int col, int count, float[] data)1823 private static native int nPutF(long self, int row, int col, int count, float[] data); 1824 nPutFIdx(long self, int[] idx, int count, float[] data)1825 private static native int nPutFIdx(long self, int[] idx, int count, float[] data); 1826 nPutI(long self, int row, int col, int count, int[] data)1827 private static native int nPutI(long self, int row, int col, int count, int[] data); 1828 nPutIIdx(long self, int[] idx, int count, int[] data)1829 private static native int nPutIIdx(long self, int[] idx, int count, int[] data); 1830 nPutS(long self, int row, int col, int count, short[] data)1831 private static native int nPutS(long self, int row, int col, int count, short[] data); 1832 nPutSIdx(long self, int[] idx, int count, short[] data)1833 private static native int nPutSIdx(long self, int[] idx, int count, short[] data); 1834 nPutB(long self, int row, int col, int count, byte[] data)1835 private static native int nPutB(long self, int row, int col, int count, byte[] data); 1836 nPutBIdx(long self, int[] idx, int count, byte[] data)1837 private static native int nPutBIdx(long self, int[] idx, int count, byte[] data); 1838 nPutBwOffset(long self, int row, int col, int count, int offset, byte[] data)1839 private static native int nPutBwOffset(long self, int row, int col, int count, int offset, byte[] data); 1840 nPutBwIdxOffset(long self, int[] idx, int count, int offset, byte[] data)1841 private static native int nPutBwIdxOffset(long self, int[] idx, int count, int offset, byte[] data); 1842 nGetB(long self, int row, int col, int count, byte[] vals)1843 private static native int nGetB(long self, int row, int col, int count, byte[] vals); 1844 nGetBIdx(long self, int[] idx, int count, byte[] vals)1845 private static native int nGetBIdx(long self, int[] idx, int count, byte[] vals); 1846 nGetS(long self, int row, int col, int count, short[] vals)1847 private static native int nGetS(long self, int row, int col, int count, short[] vals); 1848 nGetSIdx(long self, int[] idx, int count, short[] vals)1849 private static native int nGetSIdx(long self, int[] idx, int count, short[] vals); 1850 nGetI(long self, int row, int col, int count, int[] vals)1851 private static native int nGetI(long self, int row, int col, int count, int[] vals); 1852 nGetIIdx(long self, int[] idx, int count, int[] vals)1853 private static native int nGetIIdx(long self, int[] idx, int count, int[] vals); 1854 nGetF(long self, int row, int col, int count, float[] vals)1855 private static native int nGetF(long self, int row, int col, int count, float[] vals); 1856 nGetFIdx(long self, int[] idx, int count, float[] vals)1857 private static native int nGetFIdx(long self, int[] idx, int count, float[] vals); 1858 nGetD(long self, int row, int col, int count, double[] vals)1859 private static native int nGetD(long self, int row, int col, int count, double[] vals); 1860 nGetDIdx(long self, int[] idx, int count, double[] vals)1861 private static native int nGetDIdx(long self, int[] idx, int count, double[] vals); 1862 nGet(long self, int row, int col)1863 private static native double[] nGet(long self, int row, int col); 1864 nGetIdx(long self, int[] idx)1865 private static native double[] nGetIdx(long self, int[] idx); 1866 nDump(long self)1867 private static native String nDump(long self); 1868 } 1869