| Xavia SDK c++ API 2.1.0 API description of the xavia library

Loading...
Searching...
No Matches
iImage.h
1#pragma once
2
3#include "xmsdk_export.h"
4#include "pixelFormat.h"
5#include <vector>
6#include <cstdint>
7#include <memory>
8#include <string>
9
10namespace xavia::sdk
11{
18 struct ImageMetaData
19 {
20 std::uint64_t frameTimeStampUs{0};
21 std::uint64_t receivedTimeStampUs{0};
22 std::uint32_t frameNumber{0};
23 std::uint32_t width{0};
24 std::uint32_t height{0};
25 xavia::sdk::PixelFormat pixelFormat{xavia::sdk::PixelFormat::Unknown};
26 };
27
37 class IImage
38 {
39 public:
40 virtual ~IImage() = default;
41
46 virtual std::uint32_t GetWidth() const = 0;
47
52 virtual std::uint32_t GetHeight() const = 0;
53
58 virtual xavia::sdk::PixelFormat GetPixelFormat() const = 0;
59
65 virtual const std::vector<std::uint8_t>& GetPixelData() const = 0;
66
71 virtual const ImageMetaData& GetMetaData() const = 0;
72
83 virtual std::vector<std::uint8_t> Serialize() = 0;
84
97 virtual void Deserialize(const std::vector<std::uint8_t>& data) = 0;
98
112 virtual void Deserialize(const std::uint8_t* pBuffer, const std::size_t size) = 0;
113
124 virtual void SaveAsJpeg(const std::wstring& filePath,
125 const int quality = 90,
126 const bool chromaticSubsampling = false
127 ) const = 0;
128 };
129
139 std::unique_ptr<IImage> XMSDK_EXPORT CreateImage();
140} // namespace xavia::sdk
xavia::sdk::IImage
The interface of the image object.
Definition iImage.h:38
xavia::sdk::IImage::Deserialize
virtual void Deserialize(const std::uint8_t *pBuffer, const std::size_t size)=0
Fill this image object from binary data.
xavia::sdk::IImage::Deserialize
virtual void Deserialize(const std::vector< std::uint8_t > &data)=0
Fill this image object from binary data.
xavia::sdk::IImage::GetHeight
virtual std::uint32_t GetHeight() const =0
Get the height of the image.
xavia::sdk::IImage::GetPixelData
virtual const std::vector< std::uint8_t > & GetPixelData() const =0
Get the raw pixel data.
xavia::sdk::IImage::GetWidth
virtual std::uint32_t GetWidth() const =0
Get the width of the image.
xavia::sdk::IImage::GetMetaData
virtual const ImageMetaData & GetMetaData() const =0
Get the metadata of the current image.
xavia::sdk::IImage::SaveAsJpeg
virtual void SaveAsJpeg(const std::wstring &filePath, const int quality=90, const bool chromaticSubsampling=false) const =0
Save the image as an 8 bit jpeg file.
xavia::sdk::IImage::Serialize
virtual std::vector< std::uint8_t > Serialize()=0
Convert this image object into binary data.
xavia::sdk::IImage::GetPixelFormat
virtual xavia::sdk::PixelFormat GetPixelFormat() const =0
Get the pixel format.
xavia::sdk::ImageMetaData
Metadata struct containing general information for each camera image.
Definition iImage.h:19
xavia::sdk::ImageMetaData::frameTimeStampUs
std::uint64_t frameTimeStampUs
Posix timestamp in us of frame acquisition.
Definition iImage.h:20
xavia::sdk::ImageMetaData::receivedTimeStampUs
std::uint64_t receivedTimeStampUs
Posix timestamp in us when data is received by the SDK.
Definition iImage.h:21
xavia::sdk::ImageMetaData::pixelFormat
xavia::sdk::PixelFormat pixelFormat
Pixel format identifier.
Definition iImage.h:25
xavia::sdk::ImageMetaData::height
std::uint32_t height
Image height in pixels.
Definition iImage.h:24
xavia::sdk::ImageMetaData::frameNumber
std::uint32_t frameNumber
Monotonically increasing counter. Unique for each frame acquired by the camera.
Definition iImage.h:22
xavia::sdk::ImageMetaData::width
std::uint32_t width
Image width in pixels.
Definition iImage.h:23