42 std::vector<uint64_t>
Bins;
145 ImageBackendAccessor::BackendHandle(image), &m_backendHandle);
159 if (other.m_backendHandle)
164 m_backendHandle = other.m_backendHandle;
176 if (other.m_backendHandle)
183 m_backendHandle = other.m_backendHandle;
190 *
this = std::move(other);
197 if (m_backendHandle !=
nullptr)
202 m_backendHandle = other.m_backendHandle;
203 other.m_backendHandle =
nullptr;
223 std::vector<HistogramChannel> channels;
225 size_t numChannels = 0;
229 for (
size_t ch = 0; ch < numChannels; ++ch)
231 uint64_t pixelSum = 0;
236 uint64_t pixelCount = 0;
241 size_t binListSize = 0;
245 std::vector<uint64_t> binList(binListSize);
248 m_backendHandle, ch, binList.data(), &binListSize);
251 channels.emplace_back(
HistogramChannel{ pixelSum, pixelCount, std::move(binList) });
peak::ipl::PixelFormat PixelFormat() const
Returns the pixel format of the histogram.
Definition peak_ipl_histogram.hpp:209
std::vector< HistogramChannel > Channels() const
Returns a vector containing the bin list of each channel.
Definition peak_ipl_histogram.hpp:221
~Histogram()
Destructor for the Histogram instance.
Definition peak_ipl_histogram.hpp:149
Histogram & operator=(const Histogram &other)
Copy assigment for Histogram instance.
Definition peak_ipl_histogram.hpp:167
Stores the pixel format, width and height of an image and the pointer to the image buffer.
Definition peak_ipl_image.hpp:42
PixelFormatName
Enum holding the possible pixel format names.
Definition peak_ipl_simple_types.hpp:38
@ Invalid
Invalid Pixel Format.
Definition peak_ipl_simple_types.hpp:39
The "peak::ipl" namespace contains the whole image processing library.
void ExecuteAndMapReturnCodes(const CallableType &callableObject)
Definition peak_ipl_exception.hpp:284
#define PEAK_IPL_NO_DISCARD
Definition peak_ipl_attribute_defines.h:20
PEAK_IPL_C_API PEAK_IPL_Histogram_Destruct(PEAK_IPL_HISTOGRAM_HANDLE histogramHandle)
Destroys the histogram associated with the given handle.
PEAK_IPL_C_API PEAK_IPL_Histogram_Construct(PEAK_IPL_IMAGE_HANDLE imageHandle, PEAK_IPL_HISTOGRAM_HANDLE *histogramHandle)
Creates a histogram from image data.
PEAK_IPL_C_API PEAK_IPL_Histogram_GetPixelFormat(PEAK_IPL_HISTOGRAM_HANDLE histogramHandle, PEAK_IPL_PIXEL_FORMAT *pixelFormat)
Queries the pixel format of the given histogram.
struct PEAK_IPL_HISTOGRAM * PEAK_IPL_HISTOGRAM_HANDLE
Definition peak_ipl_backend.h:406
PEAK_IPL_C_API PEAK_IPL_Histogram_Acquire(PEAK_IPL_HISTOGRAM_HANDLE histogramHandle)
Increase the reference count of a histogram object.
PEAK_IPL_C_API PEAK_IPL_Histogram_GetNumChannels(PEAK_IPL_HISTOGRAM_HANDLE histogramHandle, size_t *numChannels)
Queries the number of the given histogram's channels.
PEAK_IPL_C_API PEAK_IPL_Histogram_GetPixelSumForChannel(PEAK_IPL_HISTOGRAM_HANDLE histogramHandle, size_t channelIndex, uint64_t *pixelSum)
Queries the pixel sum for the channel with the given index.
PEAK_IPL_C_API PEAK_IPL_Histogram_GetBinsForChannel(PEAK_IPL_HISTOGRAM_HANDLE histogramHandle, size_t channelIndex, uint64_t *bins, size_t *binsSize)
Queries the bin list of the channel with the given index.
PEAK_IPL_C_API PEAK_IPL_Histogram_GetPixelCountForChannel(PEAK_IPL_HISTOGRAM_HANDLE histogramHandle, size_t channelIndex, uint64_t *pixelCount)
Queries the pixel count for the channel with the given index.
int32_t PEAK_IPL_PIXEL_FORMAT
Definition peak_ipl_backend.h:170
#define PEAK_IPL_C_ABI_PREFIX
Definition peak_ipl_dll_defines.h:11
Stores the values of the histogram.
Definition peak_ipl_histogram.hpp:39
uint64_t PixelCount
Definition peak_ipl_histogram.hpp:41
std::vector< uint64_t > Bins
Definition peak_ipl_histogram.hpp:42
uint64_t PixelSum
Definition peak_ipl_histogram.hpp:40