Skip to content

Repository files navigation

QuickDataFlow

Build StatuscodecovQuality Gate StatusCMakeLicensePyPI

This library is for building multithreaded and fast C++ applications

Requirements

  • gtest
  • wheel

Install

Build for C++

git clone https://github.com/ilyajob05/QuickDataFlow.git
cd QuickDataFlow
chmod +x build.sh
./build.sh

Install from deb

Your need build library before install

sudo pdkg -i build/QuickDataFlow-2.1.0-Linux.deb

Install from Pypi

pip install QuickDataFlow

or download file from PyPi whl or tar.gz

pip install QuickDataFlow-2.1.2.tar.gz # or
# pip install QuickDataFlow-2.1.2-cp310-cp310-manylinux2014_x86_64.whl 

Usage

C++

#include<opencv2/opencv.hpp>
#include"shm_message.hpp"usingnamespacefshm;usingnamespacestd;usingnamespacecv;intmain(int argc, char* argv[])
{
// create a buffer for data transfer
MessageBuff msg_buff("img_sender_point_i_", "img_sender_point_o_",
10, 10, 640 * 480 * 3, 640 * 480 * 3);
Mat inputImage = imread("../data/test-image-1.png");
Mat sendImage(480, 640, CV_8UC3);
resize(inputImage, sendImage, Size(640, 480));
cvtColor(sendImage, sendImage, COLOR_BGR2RGB); // for PILnamedWindow("camera image sender", WINDOW_NORMAL);
// send data
uchar* arr = sendImage.isContinuous() ? sendImage.data : sendImage.clone().data;
msg_buff.push_message_sync(static_cast<unsignedchar*>(arr));
imshow("camera image sender", inputImage);
waitKey(10000);
return0;
}

Python

fromPILimportImagefromQuickDataFlowimportshm_messageassmmb_buff=sm.MessageBuff("img_sender_point_o_", "img_sender_point_i_",
10, 10, 640*480*3, 640*480*3)
buff=bytes([0] * (640*480*3))
mb_buff.get_msg(buff)
img=Image.frombytes("RGB", (640,480), buff)
img.show()

About

QuickDataFlow library is designed for messaging between programs written in c++ and python

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages