Imaging Control 4 C++ Library 1.2.0
Loading...
Searching...
No Matches
Getting Started

Setup

Windows

To help setting up projects, the installer sets two environment variables:

  • IC4PATH points to the installation directory
  • PATH is extended to include IC4PATH%\bin

The IC Imaging Control 4 installer puts the include, library and binary files into

  • IC4PATH%\include
  • IC4PATH%\lib
  • IC4PATH%\bin

Linux

The ic4 SDK for Linux is split into several .deb packages.

ic4.deb

Contains the ic4 core libraries.

Contains ic4-ctrl binary. Useful for debugging purposes.

ic4-dev.deb

Contains:

  • ic4 header files
  • CMake modules
  • pkg-conf description

This package is required when compiling C or C++ applications using ic4.

ic4-doc.deb

Contains html documentation for all language bindings of ic4.

ic4-plugin-encoder.deb

Contains plugin allowing ic4 to save h264/h265 videos via GStreamer.

ic4-plugin-display.deb

Contains plugin allowing ic4 to display images via OpenGL.

ic4-utils.deb

Contains ic4-demoapp and ic4-device-manager.

Setting Up the Project

To compile a C++ program using IC Imaging Control 4 C++ Class Library, include files and libraries have to be found by the project in some way. The specifics depend on the type of project being used.

Using Microsoft Visual Studio

After creating a C++ project, make the following changes to the project settings:

  • Add $(IC4PATH)\include to the list of include directories
  • Add $(IC4PATH)\lib to the list of library directories

Using CMake

Add the following line to your CMakeLists.txt to instuct CMake to look for the ic4 library package:

find_package(ic4 REQUIRED)
ic4 namespace
Definition Allocator.h:15

Then, add ic4::core to the target_link_libraries section for your executable. CMake will then automatically add the proper include pathes and library options to your project.

To copy the ic4 binary files to your output directory, use the ic4_copy_runtime_to_target function.

The minimum CMakeLists.txt for a ic4 C++ project looks like this:

cmake_minimum_required(VERSION 3.8)
project( hello-ic4 )
find_package( ic4 REQUIRED )
add_executable( hello-ic4
hello-ic4.cpp
)
target_link_libraries( hello-ic4
PRIVATE
ic4::core
)
ic4_copy_runtime_to_target( hello-ic4 )

Hello IC4!

Add this code to your main C++ file to check whether project setup was successful:

#include <ic4/ic4.h>
#include <iostream>
int main()
{
std::cout << "Hello, IC4!" << std::endl;
}
bool initLibrary(const InitLibraryConfig &config={})
This function must be used to initialize the library.
Definition InitLibrary.h:89