YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
IplImage.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 1995, 2000 Intel Corporation
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7// originates from cvtypes.h in intel OpenCV project,
8// some local modifications.
9
10// check if CV is present
11#ifndef _CV_H_
12// check if IPL is present
13#ifndef HAVE_IPL
14// or asserted to be present
15#ifndef HAVE_OPENCV
16
17#ifndef YARP_CVTYPES_H_
18#define YARP_CVTYPES_H_
19
20// To simplify interaction with opencv header files, say that we
21// have ipl headers
22// We may fail anyway, but we will certainly fail otherwise.
23#ifndef HAVE_IPL
24#define HAVE_IPL
25#endif
26
27
28#include <cassert>
29#include <cstdlib>
30
31#if defined _MSC_VER || defined __BORLANDC__
32typedef __int64 int64;
33typedef unsigned __int64 uint64;
34#else
35typedef long long int64;
36typedef unsigned long long uint64;
37#endif
38
39#ifndef __IPL_H__
40typedef unsigned char uchar;
41#endif
42
43
44
45
46/****************************************************************************************\
47 * Image type (MiniIplImage) *
48\****************************************************************************************/
49
50/*
51 * The following definitions (until #endif)
52 * is an extract from IPL headers.
53 * Copyright (c) 1995 Intel Corporation.
54 */
55
56#define IPL_DEPTH_SIGN 0x80000000
57
58#define IPL_DEPTH_1U 1
59#define IPL_DEPTH_8U 8
60#define IPL_DEPTH_16U 16
61#define IPL_DEPTH_32F 32
62
63#define IPL_DEPTH_8S (int)(IPL_DEPTH_SIGN| 8)
64#define IPL_DEPTH_16S (int)(IPL_DEPTH_SIGN|16)
65#define IPL_DEPTH_32S (int)(IPL_DEPTH_SIGN|32)
66
67#define IPL_DATA_ORDER_PIXEL 0
68#define IPL_DATA_ORDER_PLANE 1
69
70#define IPL_ORIGIN_TL 0
71#define IPL_ORIGIN_BL 1
72
73#define IPL_ALIGN_4BYTES 4
74#define IPL_ALIGN_8BYTES 8
75#define IPL_ALIGN_16BYTES 16
76#define IPL_ALIGN_32BYTES 32
77
78#define IPL_ALIGN_DWORD IPL_ALIGN_4BYTES
79#define IPL_ALIGN_QWORD IPL_ALIGN_8BYTES
80
81typedef struct _IplImage {
83 int depth;
85 int origin;
87 int align;
89 int width;
90 int height;
94 char *imageData;
96}
98
99typedef struct _IplTileInfo IplTileInfo;
100
101#define IPL_IMAGE_HEADER 1
102#define IPL_IMAGE_DATA 2
103#define IPL_IMAGE_ROI 4
104
105
109#define IPLAPIIMPL(type,name,arg) extern type name arg
110
112
114
116 (int nChannels, int depth,
117 int origin, int align,
118 int width, int height));
119
121
122#define IPL_BORDER_CONSTANT 0
123
124#define IPL_SIDE_TOP_INDEX 0
125#define IPL_SIDE_BOTTOM_INDEX 1
126#define IPL_SIDE_LEFT_INDEX 2
127#define IPL_SIDE_RIGHT_INDEX 3
128#define IPL_SIDE_TOP (1<<IPL_SIDE_TOP_INDEX)
129#define IPL_SIDE_BOTTOM (1<<IPL_SIDE_BOTTOM_INDEX)
130#define IPL_SIDE_LEFT (1<<IPL_SIDE_LEFT_INDEX)
131#define IPL_SIDE_RIGHT (1<<IPL_SIDE_RIGHT_INDEX)
132#define IPL_SIDE_ALL (IPL_SIDE_RIGHT|IPL_SIDE_TOP|IPL_SIDE_LEFT|IPL_SIDE_BOTTOM)
133
134#define IPL_DEPTH_MASK 0x7FFFFFFF
135
136#define IPL_IMAGE_HEADER 1
137#define IPL_IMAGE_DATA 2
138#define IPL_IMAGE_ROI 4
139#define IPL_IMAGE_TILE 8
140#define IPL_IMAGE_MASK 16
141#define IPL_IMAGE_ALL (IPL_IMAGE_HEADER|IPL_IMAGE_DATA|\
142 IPL_IMAGE_TILE|IPL_IMAGE_ROI|IPL_IMAGE_MASK)
143#define IPL_IMAGE_ALL_WITHOUT_MASK (IPL_IMAGE_HEADER|IPL_IMAGE_DATA|\
144 IPL_IMAGE_TILE|IPL_IMAGE_ROI)
145
146#define YARP_IMAGE_ALIGN 8
147
148#endif /*YARP_CVTYPES_H_*/
149#endif /*HAVE_OPENCV*/
150#endif /*HAVE_IPL*/
151#endif /*_CV_H_*/
152
153/* End of file. */
void iplDeallocateHeader(MiniIplImage *image)
Definition IplImage.cpp:122
#define IPLAPIIMPL(type, name, arg)
Definition for functions implemented within YARP_sig.
Definition IplImage.h:109
unsigned long long uint64
Definition IplImage.h:36
MiniIplImage * iplCreateImageHeader(int nChannels, int depth, int origin, int align, int width, int height)
Definition IplImage.cpp:84
void iplAllocateImage(MiniIplImage *image)
Definition IplImage.cpp:43
unsigned char uchar
Definition IplImage.h:40
struct _IplTileInfo IplTileInfo
Definition IplImage.h:99
struct _IplImage MiniIplImage
void iplDeallocateImage(MiniIplImage *image)
Definition IplImage.cpp:48
long long int64
Definition IplImage.h:35
int nChannels
Most of OpenCV functions support 1,2,3 or 4 channels.
Definition IplImage.h:82
int height
image height in pixels
Definition IplImage.h:90
int align
Alignment of image rows (4 or 8).
Definition IplImage.h:87
char * imageData
pointer to aligned image data
Definition IplImage.h:94
int imageSize
image data size in bytes (==image->height*image->widthStep in case of interleaved data)
Definition IplImage.h:91
int origin
0 - top-left origin, 1 - bottom-left origin (Windows bitmaps style)
Definition IplImage.h:85
int widthStep
size of aligned image row in bytes
Definition IplImage.h:95
int depth
pixel depth in bits: IPL_DEPTH_8U, IPL_DEPTH_8S, IPL_DEPTH_16S, IPL_DEPTH_32S, IPL_DEPTH_32F and IPL_...
Definition IplImage.h:83
int width
image width in pixels
Definition IplImage.h:89