OSDN Git Service

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