Mech-Eye API 2.5.1
API reference documentation for Mech-Eye Industrial 3D Camera
Loading...
Searching...
No Matches
Frame2D.h
Go to the documentation of this file.
1/*******************************************************************************
2 * BSD 3-Clause License
3 *
4 * Copyright (c) 2016-2025, Mech-Mind Robotics Technologies Co., Ltd.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 *
17 * 3. Neither the name of the copyright holder nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 * Info: https://www.mech-mind.com/
33 *
34 ******************************************************************************/
35
36#pragma once
37#include <memory>
38#include "api_global.h"
39#include "CameraProperties.h"
40#include "Array2D.h"
41
42namespace mmind {
43
44namespace eye {
45
49struct Gray
50{
51 uint8_t gray{0};
52};
53
58{
59 uint8_t b{0};
60 uint8_t g{0};
61 uint8_t r{0};
62};
63
66
73{
74public:
79
84
88 Frame2D(const Frame2D& other) noexcept;
89
93 Frame2D& operator=(const Frame2D& other) noexcept;
94
98 Size imageSize() const;
99
103 bool isEmpty() const;
104
109
113 uint64_t frameId() const;
114
118 void clear();
119
129
139
140private:
141 friend class CameraImpl;
142 friend class Frame2DAnd3D;
143 friend class InternalInterfaces;
144
145 std::shared_ptr<class Frame2DImpl> _impl;
146 Frame2D(std::shared_ptr<Frame2DImpl>& frameImpl);
147};
148
149} // namespace eye
150} // namespace mmind
#define MMIND_API_EXPORT
Definition api_global.h:48
Represents a 2D container of data.
Definition Array2D.h:17
Represents the 2D and 3D capture results, which can be obtained by calling Camera::capture2DAnd3D....
Definition Frame2DAnd3D.h:101
Represents the 2D capture result, which can be obtained by calling Camera::capture2D....
Definition Frame2D.h:73
Color2DImage getColorImage() const
Gets the image data of the Frame2D with the ColorBGR pixel format. If the 2D camera's color type (acc...
Size imageSize() const
Gets the image size of Frame2D.
ColorTypeOf2DCamera colorType() const
Gets the color type of the 2D camera in the 3D camera.
Frame2D(const Frame2D &other) noexcept
Constructor.
Frame2D()
Constructor.
~Frame2D()
Destructor.
GrayScale2DImage getGrayScaleImage() const
Gets image data of the Frame2D with the Gray pixel format. If the 2D camera's color type (according t...
Frame2D & operator=(const Frame2D &other) noexcept
Copy assignment.
uint64_t frameId() const
The ID of the Frame2D frame.
void clear()
Clears the data in Frame2D and releases the associated resources.
bool isEmpty() const
Judges whether Frame2D is empty.
ColorTypeOf2DCamera
Defines the color type of the 2D camera in the 3D camera.
Definition CameraProperties.h:155
Definition Camera.h:45
Represents a pixel in Color2DImage with blue, green, and red channel information.
Definition Frame2D.h:58
uint8_t g
Green channel.
Definition Frame2D.h:60
uint8_t b
Blue channel.
Definition Frame2D.h:59
uint8_t r
Red channel.
Definition Frame2D.h:61
Represents a pixel in GrayScale2DImage with grayscale channel information.
Definition Frame2D.h:50
uint8_t gray
Grayscale channel.
Definition Frame2D.h:51
Describes a two-dimensional size with a width and a height.
Definition CommonTypes.h:40