2014-04-04 19:14:06 +02:00
|
|
|
// *****************************************************************
|
|
|
|
// Delphi-OpenCV Demo
|
|
|
|
// Copyright (C) 2013 Project Delphi-OpenCV
|
|
|
|
// ****************************************************************
|
|
|
|
// Contributor:
|
2014-05-22 16:23:41 +02:00
|
|
|
// Laentir Valetov
|
2014-04-04 19:14:06 +02:00
|
|
|
// email:laex@bk.ru
|
2014-05-22 08:53:48 +02:00
|
|
|
// Mikhail Grigorev
|
|
|
|
// email:sleuthound@gmail.com
|
2014-04-04 19:14:06 +02:00
|
|
|
// ****************************************************************
|
|
|
|
// You may retrieve the latest version of this file at the GitHub,
|
|
|
|
// located at git://github.com/Laex/Delphi-OpenCV.git
|
|
|
|
// ****************************************************************
|
|
|
|
// The contents of this file are used with permission, subject to
|
|
|
|
// the Mozilla Public License Version 1.1 (the "License"); you may
|
|
|
|
// not use this file except in compliance with the License. You may
|
|
|
|
// obtain a copy of the License at
|
|
|
|
// http://www.mozilla.org/MPL/MPL-1_1Final.html
|
|
|
|
//
|
|
|
|
// Software distributed under the License is distributed on an
|
|
|
|
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
// implied. See the License for the specific language governing
|
|
|
|
// rights and limitations under the License.
|
|
|
|
// *******************************************************************
|
2013-09-12 12:50:55 +02:00
|
|
|
|
2014-05-22 16:23:41 +02:00
|
|
|
unit ocv.mat;
|
2013-09-12 12:50:55 +02:00
|
|
|
|
|
|
|
interface
|
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
uses
|
2014-04-04 19:14:06 +02:00
|
|
|
WinApi.Windows,
|
2014-05-22 16:23:41 +02:00
|
|
|
ocv.core.types_c,
|
|
|
|
ocv.highgui_c;
|
2013-09-12 12:50:55 +02:00
|
|
|
|
|
|
|
Type
|
2014-05-04 13:35:57 +02:00
|
|
|
TocvMat = class
|
2014-04-04 19:14:06 +02:00
|
|
|
public
|
2013-09-12 12:50:55 +02:00
|
|
|
// similar to CV_ELEM_SIZE(cvmat->type)
|
2014-04-04 19:14:06 +02:00
|
|
|
function elemSize(): size_t; virtual; stdcall; abstract;
|
2013-09-12 12:50:55 +02:00
|
|
|
// ! returns the size of element channel in bytes.
|
2014-04-04 19:14:06 +02:00
|
|
|
function elemSize1(): size_t; virtual; stdcall; abstract;
|
2013-09-12 12:50:55 +02:00
|
|
|
// ! returns element type, similar to CV_MAT_TYPE(cvmat->type)
|
2014-04-04 19:14:06 +02:00
|
|
|
function _type: Integer; virtual; stdcall; abstract;
|
2013-09-12 12:50:55 +02:00
|
|
|
// ! returns element type, similar to CV_MAT_DEPTH(cvmat->type)
|
2014-04-04 19:14:06 +02:00
|
|
|
function depth: Integer; virtual; stdcall; abstract;
|
2013-09-12 12:50:55 +02:00
|
|
|
// ! returns element type, similar to CV_MAT_CN(cvmat->type)
|
2014-04-04 19:14:06 +02:00
|
|
|
function channels: Integer; virtual; stdcall; abstract;
|
2013-09-12 12:50:55 +02:00
|
|
|
// ! returns step/elemSize1()
|
2014-04-04 19:14:06 +02:00
|
|
|
function step1(i: Integer = 0): size_t; virtual; stdcall; abstract;
|
2013-09-12 12:50:55 +02:00
|
|
|
// ! returns true if matrix data is NULL
|
2014-04-04 19:14:06 +02:00
|
|
|
function empty: bool; virtual; stdcall; abstract;
|
2013-09-12 12:50:55 +02:00
|
|
|
// ! returns the total number of matrix elements
|
2014-04-04 19:14:06 +02:00
|
|
|
function total: size_t; virtual; stdcall; abstract;
|
2013-09-12 12:50:55 +02:00
|
|
|
// * ! includes several bit - fields: - the magic signature - continuity flag - depth - number of channels * /
|
2014-04-04 19:14:06 +02:00
|
|
|
function flags: Integer; virtual; stdcall; abstract;
|
2013-09-12 12:50:55 +02:00
|
|
|
// ! the matrix dimensionality, >= 2
|
2014-04-04 19:14:06 +02:00
|
|
|
function dims: Integer; virtual; stdcall; abstract;
|
2013-09-12 12:50:55 +02:00
|
|
|
// ! the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
|
2014-04-04 19:14:06 +02:00
|
|
|
function rows: Integer; virtual; stdcall; abstract;
|
|
|
|
function cols: Integer; virtual; stdcall; abstract;
|
2013-09-12 12:50:55 +02:00
|
|
|
// ! pointer to the data
|
2014-04-04 19:14:06 +02:00
|
|
|
function data: pByte; virtual; stdcall; abstract;
|
2014-05-04 13:35:57 +02:00
|
|
|
procedure copyTo(Var m: TocvMat); virtual; stdcall; abstract;
|
2014-04-04 19:14:06 +02:00
|
|
|
// ------------------------------------------------
|
2013-09-12 12:50:55 +02:00
|
|
|
end;
|
|
|
|
|
2014-05-04 13:35:57 +02:00
|
|
|
function CreateMat: TocvMat; stdcall; overload;
|
|
|
|
function CreateMat(rows, cols, _type: Integer): TocvMat; stdcall; overload;
|
|
|
|
procedure ReleaseMat(ex: TocvMat); stdcall;
|
2013-09-12 12:50:55 +02:00
|
|
|
|
|
|
|
implementation
|
|
|
|
|
2014-05-22 16:23:41 +02:00
|
|
|
uses ocv.lib;
|
2013-09-12 12:50:55 +02:00
|
|
|
|
2014-05-22 08:53:48 +02:00
|
|
|
function CreateMat: TocvMat; stdcall; external opencv_classes_lib name 'CreateMat'; overload;
|
|
|
|
function CreateMat(rows, cols, _type: Integer): TocvMat; stdcall; external opencv_classes_lib name 'CreateMatRCT'; overload;
|
|
|
|
procedure ReleaseMat; external opencv_classes_lib;
|
2013-09-12 12:50:55 +02:00
|
|
|
|
|
|
|
end.
|