IRSOL
C++ code implementing socket server for interacting with Baumer camera.
irsol::camera Namespace Reference

Provides a high-level interface to interact with camera devices using NeoAPI. More...

Namespaces

namespace  internal
 

Classes

class  Interface
 High-level wrapper around the NeoAPI camera for synchronized access. More...
 
struct  Pixel
 Represents a pixel with a given bit depth. More...
 
struct  PixelByteSwapper
 Utility for swapping pixel bytes in a buffer. More...
 
struct  PixelByteSwapper< true >
 
struct  PixelConversion
 Helper to convert pixel values from one bit depth to another with scaling. More...
 
struct  PixelRepresentation
 Helper trait to map a pixel bit depth to an appropriate integral representation type. More...
 
struct  PixelRepresentation< 12 >
 Specialization for 12-bit pixel depth. More...
 
struct  PixelRepresentation< 16 >
 Specialization for 16-bit pixel depth. More...
 
struct  PixelRepresentation< 8 >
 Specialization for 8-bit pixel depth. More...
 
class  StatusMonitor
 Class that offers an easy way to run a background monitorin thread that periodically inspects and reports information about the camera interface passed as argument. More...
 

Functions

std::string discoverCameraFeatures (Interface &cam)
 Discovers all camera features and their permissions.
 

Detailed Description

Provides a high-level interface to interact with camera devices using NeoAPI.

The irsol::camera namespace contains components for accessing and configuring industrial cameras in a thread-safe and convenient manner. It abstracts away the low-level NeoAPI interface and offers simple, strongly-typed methods to control camera parameters and acquire images.

Key functionality includes:

  • Connecting to and configuring the default camera device.
  • Getting and setting camera parameters (exposure, resolution, etc.).
  • Capturing image frames with timeout support.
  • Ensuring thread-safe access to camera operations.

This namespace is designed to be extendable and integrates closely with the rest of the irsol framework.

Function Documentation

◆ discoverCameraFeatures()

std::string irsol::camera::discoverCameraFeatures ( Interface cam)

Discovers all camera features and their permissions.

Uses internal utilities to query the camera interface and report on the available, readable, and writable features.

See 02-interacting-with-camera-features for an example.

Parameters
camReference to the camera interface to query.
Returns
A string representing the discovered features formatted as a table.

Definition at line 47 of file discovery.cpp.

48{
49 const auto& featurePermissionsMap =
51 tabulate::Table table;
52 table.add_row({"Feature Name", "Available", "Readable", "Writable"});
53
54 for(const auto& [permissions, features] : featurePermissionsMap) {
55 for(const auto* feature : features) {
56 table.add_row({feature->GetName().c_str(),
57 permissions.isAvailable() ? "yes" : "no",
58 permissions.isReadable() ? "yes" : "no",
59 permissions.isWritable() ? "yes" : "no"});
60 }
61 }
62
63 // Optional formatting:
64 table.column(0).format().font_align(tabulate::FontAlign::right);
65 table.column(1).format().font_align(tabulate::FontAlign::center);
66 table.column(2).format().font_align(tabulate::FontAlign::center);
67 table.column(3).format().font_align(tabulate::FontAlign::center);
68
69 return table.str();
70}
NeoAPI::Cam & getNeoCam()
Access the underlying NeoAPI camera instance.
std::map< FeaturePermissions, std::vector< NeoAPI::Feature * > > extractCameraFeatures(NeoAPI::Cam &cam)
Extracts and groups camera features by their permissions.
Definition discovery.cpp:15