You’re reading an older version of the Slamcore SDK documenation. The latest one is 23.04.

File image.hpp

Core API objects - image.

Helper functions for slamcore::ImageFormat

template<class Archive>
static inline void load_minimal(const Archive&, ImageFormat &obj, const std::string &value)
template<class Archive>
static inline std::string save_minimal(const Archive&, const ImageFormat &obj)
static inline std::ostream &operator<<(std::ostream &os, const ImageFormat obj)

Helper conversion methods

slamcore::ImageFormat \(\leftrightarrow\) BytesPerChannel

template<ImageFormat fmt>
static inline std::size_t ImageFormatToBytesPerPixel()
static inline std::size_t ImageFormatToBytesPerPixel(const ImageFormat fmt)
template<ImageFormat fmt>
static inline std::size_t ImageFormatToBytesPerChannel()
static inline std::size_t ImageFormatToBytesPerChannel(const ImageFormat fmt)

Enums

enum class ImageFormat : EnumBaseT

Various internal image formats.

Values:

enumerator Custom

Undefined.

enumerator Mono_8

8 bit per pixel

enumerator Mono_16

16 bit per pixel

enumerator Mono_F

32 bit float per pixel

enumerator RGB_8

8 bit per component, RGB

enumerator RGBA_8

8 bit per component, RGBA

enumerator RGB_F

32 bit float per component, RGB

enumerator RGBA_F

32 bit float per component, RGBA

enumerator JPEG

Binary JPEG data.

enumerator Mono_32

32 bit per pixel

enumerator Mono_64

64 bit per pixel

enumerator Count
template<>
struct ImageFormatTraits<ImageFormat::Mono_8>
#include <image.hpp>

Public Types

using ChannelType = uint8_t

Public Static Attributes

static constexpr std::size_t Channels = 1
template<>
struct ImageFormatTraits<ImageFormat::Mono_16>
#include <image.hpp>

Public Types

using ChannelType = uint16_t

Public Static Attributes

static constexpr std::size_t Channels = 1
template<>
struct ImageFormatTraits<ImageFormat::Mono_F>
#include <image.hpp>

Public Types

using ChannelType = float

Public Static Attributes

static constexpr std::size_t Channels = 1
template<>
struct ImageFormatTraits<ImageFormat::RGB_8>
#include <image.hpp>

Public Types

using ChannelType = uint8_t

Public Static Attributes

static constexpr std::size_t Channels = 3
template<>
struct ImageFormatTraits<ImageFormat::RGBA_8>
#include <image.hpp>

Public Types

using ChannelType = uint8_t

Public Static Attributes

static constexpr std::size_t Channels = 4
template<>
struct ImageFormatTraits<ImageFormat::RGB_F>
#include <image.hpp>

Public Types

using ChannelType = float

Public Static Attributes

static constexpr std::size_t Channels = 3
template<>
struct ImageFormatTraits<ImageFormat::RGBA_F>
#include <image.hpp>

Public Types

using ChannelType = float

Public Static Attributes

static constexpr std::size_t Channels = 4
template<>
struct ImageFormatTraits<ImageFormat::Mono_32>
#include <image.hpp>

Public Types

using ChannelType = uint32_t

Public Static Attributes

static constexpr std::size_t Channels = 1
template<>
struct ImageFormatTraits<ImageFormat::Mono_64>
#include <image.hpp>

Public Types

using ChannelType = uint64_t

Public Static Attributes

static constexpr std::size_t Channels = 1
template<typename T>
struct TypeTraits<T, typename enable_if_is_base_of<ImageInterface, T>::type>
#include <image.hpp>

Public Static Attributes

static constexpr ObjectType EnumType = ObjectType::Image
namespace slamcore

Main namespace for the Slamcore public API

Helper functions for slamcore::ImageFormat

template<class Archive>
static inline void load_minimal(const Archive&, ImageFormat &obj, const std::string &value)
template<class Archive>
static inline std::string save_minimal(const Archive&, const ImageFormat &obj)
static inline std::ostream &operator<<(std::ostream &os, const ImageFormat obj)

Helper conversion methods

slamcore::ImageFormat \(\leftrightarrow\) BytesPerChannel

template<ImageFormat fmt>
static inline std::size_t ImageFormatToBytesPerPixel()
static inline std::size_t ImageFormatToBytesPerPixel(const ImageFormat fmt)
template<ImageFormat fmt>
static inline std::size_t ImageFormatToBytesPerChannel()
static inline std::size_t ImageFormatToBytesPerChannel(const ImageFormat fmt)

Get information about the client library

Enums

enum class ImageFormat : EnumBaseT

Various internal image formats.

Values:

enumerator Custom

Undefined.

enumerator Mono_8

8 bit per pixel

enumerator Mono_16

16 bit per pixel

enumerator Mono_F

32 bit float per pixel

enumerator RGB_8

8 bit per component, RGB

enumerator RGBA_8

8 bit per component, RGBA

enumerator RGB_F

32 bit float per component, RGB

enumerator RGBA_F

32 bit float per component, RGBA

enumerator JPEG

Binary JPEG data.

enumerator Mono_32

32 bit per pixel

enumerator Mono_64

64 bit per pixel

enumerator Count
template<ImageFormat fmt>
struct ImageFormatTraits
#include <image.hpp>

Traits specific to the corresponding slamcore::ImageFormat they are templated for Supports storing information for the following properties:

  • Channels - numbers of associated channels

  • ChannelType - e.g., float / double, …

template<> Mono_16 >
#include <image.hpp>

Public Types

using ChannelType = uint16_t

Public Static Attributes

static constexpr std::size_t Channels = 1
template<> Mono_32 >
#include <image.hpp>

Public Types

using ChannelType = uint32_t

Public Static Attributes

static constexpr std::size_t Channels = 1
template<> Mono_64 >
#include <image.hpp>

Public Types

using ChannelType = uint64_t

Public Static Attributes

static constexpr std::size_t Channels = 1
template<> Mono_8 >
#include <image.hpp>

Public Types

using ChannelType = uint8_t

Public Static Attributes

static constexpr std::size_t Channels = 1
template<> Mono_F >
#include <image.hpp>

Public Types

using ChannelType = float

Public Static Attributes

static constexpr std::size_t Channels = 1
template<> RGB_8 >
#include <image.hpp>

Public Types

using ChannelType = uint8_t

Public Static Attributes

static constexpr std::size_t Channels = 3
template<> RGB_F >
#include <image.hpp>

Public Types

using ChannelType = float

Public Static Attributes

static constexpr std::size_t Channels = 3
template<> RGBA_8 >
#include <image.hpp>

Public Types

using ChannelType = uint8_t

Public Static Attributes

static constexpr std::size_t Channels = 4
template<> RGBA_F >
#include <image.hpp>

Public Types

using ChannelType = float

Public Static Attributes

static constexpr std::size_t Channels = 4
class ImageInterface : public MeasurementPoint<camera_clock>
#include <image.hpp>

Representing a single video frame.

Public Types

using Ptr = std::shared_ptr<ImageInterface>
using CPtr = std::shared_ptr<const ImageInterface>
using MeasurementPointT = MeasurementPoint<camera_clock>

Public Functions

virtual ~ImageInterface() = default
virtual ImageFormat getFormat() const = 0

Get the internal image data format.

virtual std::size_t getWidth() const = 0

Get image width in pixels.

virtual std::size_t getHeight() const = 0

Get image height in pixels.

virtual std::size_t getPitch() const = 0

Get image line stride in bytes.

virtual std::size_t getBytesPerPixel() const = 0

Bytes per pixel.

virtual std::size_t getBufferSize() const = 0

Get image total buffer size in bytes.

inline virtual camera_duration getExposureTime() const

[OPTIONAL] Get image exposure time.

inline virtual float getGain() const

[OPTIONAL] Get image gain.

inline virtual bool getAutoExposureEnabled() const

[OPTIONAL] Get image auto-exposure state.

inline virtual float getLaserPower() const

[OPTIONAL] Get IR laser projector state at the time of capture.

virtual bool isValid() const = 0

Check if the image contains valid data.

virtual const uint8_t *getData() const = 0

Returns the internal buffer with image data.

template<typename T> type >
#include <image.hpp>

Public Static Attributes

static constexpr ObjectType EnumType = ObjectType::Image