main.cpp
Go to the documentation of this file.
1 #include <iostream>
2 
3 // include depthai library
4 #include <depthai/depthai.hpp>
5 
6 int main(){
7  using namespace std;
8 
9  volatile int test = 0;
10  if(test) {
12  for(const auto& device : devices){
13  std::cout << "Device name: " << device.name << " id: " << device.mxid << std::endl;
14  }
15  }
16 
17  dai::ImgFrame frame;
18  frame.setData({1,2,3,4});
19  frame.setWidth(2);
20  frame.setHeight(2);
22 
23 #ifdef DEPTHAI_HAVE_OPENCV_SUPPORT
24  auto x = frame.getFrame();
25  std::cout << "Frame cols: " << x.cols << " rows: " << x.rows << std::endl;
26 #else
27  std::cout << "Data size: " << frame.getData().size() << std::endl;
28 #endif
29 
30  return 0;
31 }
32 
dai::XLinkConnection::getAllConnectedDevices
static std::vector< DeviceInfo > getAllConnectedDevices(XLinkDeviceState_t state=X_LINK_ANY_STATE, bool skipInvalidDevices=true, XLinkPlatform_t platform=X_LINK_MYRIAD_X)
Definition: XLinkConnection.cpp:113
dai::ImgFrame::getFrame
void getFrame(T...)
Definition: ImgFrame.hpp:218
dai::RawImgFrame::Type::GRAY8
@ GRAY8
dai::Buffer::getData
std::vector< std::uint8_t > & getData() const
Get non-owning reference to internal buffer.
Definition: Buffer.cpp:13
dai::ImgFrame::setWidth
ImgFrame & setWidth(unsigned int width)
Definition: pipeline/datatype/ImgFrame.cpp:99
depthai.hpp
main
int main()
Definition: main.cpp:6
test
int test(dai::LogLevel logLevel)
Definition: logging_test.cpp:9
dai::ImgFrame
Definition: ImgFrame.hpp:25
dai::ImgFrame::setType
ImgFrame & setType(Type type)
Definition: pipeline/datatype/ImgFrame.cpp:118
dai::ImgFrame::setHeight
ImgFrame & setHeight(unsigned int height)
Definition: pipeline/datatype/ImgFrame.cpp:105
std
Definition: Node.hpp:366
dai::Buffer::setData
void setData(const std::vector< std::uint8_t > &data)
Definition: Buffer.cpp:17


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:19