168 size_t codeTypesCount{};
170 return PEAK_ICV_C_ABI_PREFIX peak_icv_BarcodeReader_GetCodeTypesGetCount(m_handle, &codeTypesCount);
173 std::vector<peak_icv_code_type> cTypes(codeTypesCount);
175 return PEAK_ICV_C_ABI_PREFIX peak_icv_BarcodeReader_GetCodeTypes(m_handle, cTypes.data(), codeTypesCount);
178 std::vector<CodeType> result;
179 result.reserve(cTypes.size());
180 std::transform(cTypes.begin(), cTypes.end(), std::back_inserter(result), [](
const auto& cType) {
181 return static_cast<CodeType>(cType);
188 std::vector<peak_icv_code_type> cTypes;
189 cTypes.reserve(codeTypesToDetect.size());
190 std::transform(codeTypesToDetect.begin(), codeTypesToDetect.end(), std::back_inserter(cTypes), [](
const auto& cType) {
191 return static_cast<peak_icv_code_type>(cType);
195 return PEAK_ICV_C_ABI_PREFIX peak_icv_BarcodeReader_SetCodeTypes(m_handle, cTypes.data(), cTypes.size());
203 return PEAK_ICV_C_ABI_PREFIX peak_icv_BarcodeReaderResult_Array_Create(result_handles.data(), result_handles.size());
207 size_t found_count{};
209 return PEAK_ICV_C_ABI_PREFIX peak_icv_BarcodeReader_DetectAndDecode(m_handle,
210 peak::common::detail::BackendAccessor<Image>::BackendHandle(image), result_handles.data(), result_handles.size(),
213 for (
size_t i = found_count; i < result_handles.size(); ++i)
216 return PEAK_ICV_C_ABI_PREFIX peak_icv_BarcodeReaderResult_Destroy(result_handles[i]);
219 result_handles.resize(found_count);
221 catch (
const std::exception&)
223 for (
auto& result_handle : result_handles)
226 return PEAK_ICV_C_ABI_PREFIX peak_icv_BarcodeReaderResult_Destroy(result_handle);
231 return peak::common::detail::BackendAccessor<CodeReaderResult>::CreateInstances(result_handles);