CoreFlow 1.0.0
A modern orchestration and execution runtime
Loading...
Searching...
No Matches
blur_pipeline.cpp

Image Processing Pipeline.

Image Processing Pipeline

Version
0.1
Date
2025-09-06
#include <cstdlib>
#include <COREFLOW/all.hpp>
using namespace coreflow;
int main()
{
// Create context
auto context = Context::createContext();
if (Error::getStatus(context) != VX_SUCCESS)
{
std::cerr << "Failed to create Context" << std::endl;
return EXIT_FAILURE;
}
// Create graph
auto graph = Graph::createGraph(context);
{
std::cerr << "Failed to create Graph" << std::endl;
return EXIT_FAILURE;
}
// Create data objects
const vx_uint32 width = 256, height = 256;
auto rgb = Image::createImage(context, width, height, VX_DF_IMAGE_RGB);
auto yuv = Image::createImage(context, width, height, VX_DF_IMAGE_YUV4);
auto gray = Image::createImage(context, width, height, VX_DF_IMAGE_U8);
auto blur = Image::createImage(context, width, height, VX_DF_IMAGE_U8);
// Color convert (RGB -> YUV)
auto ncc = vxColorConvertNode(graph, rgb, yuv);
// Extract Y plane to gray
auto nce = vxChannelExtractNode(graph, yuv, VX_CHANNEL_Y, gray);
// Box filter 3x3
auto nbox = vxBox3x3Node(graph, gray, blur);
(void)ncc; (void)nce; (void)nbox;
// Process graph
if (graph->process() != VX_SUCCESS)
{
std::cerr << "Graph process failed" << std::endl;
return EXIT_FAILURE;
}
std::cout << "Blur pipeline ran successfully" << std::endl;
return EXIT_SUCCESS;
}
CoreVX single-include header for C++ development.
int main()
Definition blur_pipeline.cpp:15
uint32_t vx_uint32
A 32-bit unsigned value.
Definition vx_types.h:85
@ VX_DF_IMAGE_RGB
A single plane of 24-bit pixel as 3 interleaved 8-bit units of R then G then B data....
Definition vx_types.h:816
@ VX_DF_IMAGE_U8
A single plane of unsigned 8-bit data. The range of data is not specified, as it may be extracted fro...
Definition vx_types.h:855
@ VX_DF_IMAGE_YUV4
A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes. This uses the BT709 full range by default.
Definition vx_types.h:845
@ VX_CHANNEL_Y
Use to extract the LUMA channel, no matter the byte or packing order.
Definition vx_types.h:1323
@ VX_SUCCESS
No error.
Definition vx_types.h:543
static vx_context createContext()
Create a new context.
static vx_status getStatus(vx_reference ref)
Provides a generic API to return status values from Object constructors if they fail.
static vx_graph createGraph(vx_context context)
Create a graph.
static vx_image createImage(vx_context context, vx_uint32 width, vx_uint32 height, vx_df_image color, vx_bool is_virtual=vx_false_e)
Create a Image object.
VX_API_ENTRY vx_node VX_API_CALL vxBox3x3Node(vx_graph graph, vx_image input, vx_image output)
[Graph] Creates a Box Filter Node.
VX_API_ENTRY vx_node VX_API_CALL vxChannelExtractNode(vx_graph graph, vx_image input, vx_enum channel, vx_image output)
[Graph] Creates a channel extract node.
VX_API_ENTRY vx_node VX_API_CALL vxColorConvertNode(vx_graph graph, vx_image input, vx_image output)
[Graph] Creates a color conversion node.
The internal representation of a vx_array.
Definition vx_array.h:34