summaryrefslogtreecommitdiff
path: root/Documentation
AgeCommit message (Expand)Author
2022-06-17Documentation: Update the "Start an event loop" sectionDaniel Semkowicz
2022-06-17Documentation: Update code examples to use the Request::reuse() methodDaniel Semkowicz
2022-06-17Documentation: Add the missing const to the example codeDaniel Semkowicz
2022-06-17Documentation: Fix createRequest unique_ptrTommaso Merciai
2022-06-08Documentation: Add python-bindings.rstTomi Valkeinen
2022-06-06libcamera: base: log: Add coloring to the log outputLaurent Pinchart
2022-05-10meson: Use new project_*_root() functionsTomi Valkeinen
2022-05-04Documentation: Use https instead of httpQuentin Schulz
2022-05-04Documentation: Fix typosQuentin Schulz
2022-05-04Documentation: Replace ’ by 'Quentin Schulz
2022-04-15Documentation: Fix spelling errorRishikesh Donadkar
2022-04-06Documentation: Briefly document the mail-based contribution processLaurent Pinchart
2022-04-02Documentation: guides: introduction: Fix spelling errorsKunal Agarwal
2021-12-29Documentation: guides: introduction: Fix typosEugen Hristev via libcamera-devel
2021-12-03libcamera: camera_lens: Add a new class to model a camera lensHan-Lin Chen
2021-12-01guides: tracing: Mention where to find the trace filePaul Elder
2021-11-18Documentation: coding-style: Document the git commit hooksLaurent Pinchart
2021-10-30Documentation: coding-style: Document error handling rulesLaurent Pinchart
2021-10-30Documentation: Fix build when the IPU3 pipeline handler is disabledLaurent Pinchart
2021-10-26Documentation: Include IPU3 in Doxygen buildKieran Bingham
2021-09-27Documentation: application-developer: Add camera detection checkLaurent Pinchart
2021-09-27Documentation: application-developer: Use correct type to store sizeLaurent Pinchart
2021-09-27Documentation: application-developer: Make global variable staticLaurent Pinchart
2021-09-24libcamera: Standardize URLs to git repositoriesLaurent Pinchart
2021-09-07libcamera: framebuffer: Prevent modifying the number of metadata planesLaurent Pinchart
2021-09-07libcamera: v4l2_videodevice: Drop toV4L2PixelFormat()Laurent Pinchart
2021-09-02libcamera: base: signal: Support connecting signals to functorsLaurent Pinchart
2021-08-27Documentation: Explicitly enable DotKieran Bingham
2021-08-27Documentation: Remove obsoleted configKieran Bingham
2021-08-25Documentation: application-developer: Fix up spelling errorKieran Bingham
2021-08-25Documentation: application-developer: Fix reference to cam BufferWriterKieran Bingham
2021-08-25Documentation: application-developer: Recommend unique_ptr for CameraManagerKieran Bingham
2021-08-25Documentation: application-developer: Clean up build instructionsKieran Bingham
2021-08-25Documentation: application-developer: Remove irrelevant TODOKieran Bingham
2021-08-21Documentation: Drop deprecated Doxygen optionsLaurent Pinchart
2021-08-17Documentation: guides: pipeline-handler: Migrate to Camera::PrivateLaurent Pinchart
2021-08-16libcamera: pipeline_handler: Move CameraData members to Camera::PrivateLaurent Pinchart
2021-08-11clang-format: Regroup sort ordersKieran Bingham
2021-08-09libcamera: Rename 'method' to 'function'Laurent Pinchart
2021-08-03Documentation: Doxygen: Don't exclude Private classesLaurent Pinchart
2021-07-21Documentation: guides: application-developer: update pkgconfig namePaul Elder
2021-07-19libcamera: ipa_manager: Allow forcing IPA module isolationLaurent Pinchart
2021-06-25libcamera/base: Move span to base libraryKieran Bingham
2021-06-25libcamera/base: Move extended base functionalityKieran Bingham
2021-06-25libcamera/base: Introduce new base libraryKieran Bingham
2021-05-30libcamera is moving its IRC channel to OFTC (irc.oftc.net)Laurent Pinchart
2021-05-27ipa: core: Move documentation from cpp file back into the mojom filePaul Elder
2021-05-24ipa: ipc: Rename CameraSensorInfo to IPACameraSensorInfoUmang Jain
2021-05-24ipa: Move core IPA interface documentation to a .cpp fileUmang Jain
2021-05-13Documentation: Fix too short title underline in ipa.rstHirokazu Honda
class="hl opt">} return TestPass; } int testEnumerate() { std::vector<int> integers{ 1, 2, 3, 4, 5 }; int i = 0; for (auto [index, value] : utils::enumerate(integers)) { if (index != i || value != i + 1) { cerr << "utils::enumerate(<vector>) test failed: i=" << i << ", index=" << index << ", value=" << value << std::endl; return TestFail; } /* Verify that we can modify the value. */ --value; ++i; } if (integers != std::vector<int>{ 0, 1, 2, 3, 4 }) { cerr << "Failed to modify container in enumerated range loop" << endl; return TestFail; } Span<const int> span{ integers }; i = 0; for (auto [index, value] : utils::enumerate(span)) { if (index != i || value != i) { cerr << "utils::enumerate(<span>) test failed: i=" << i << ", index=" << index << ", value=" << value << std::endl; return TestFail; } ++i; } const int array[] = { 0, 2, 4, 6, 8 }; i = 0; for (auto [index, value] : utils::enumerate(array)) { if (index != i || value != i * 2) { cerr << "utils::enumerate(<array>) test failed: i=" << i << ", index=" << index << ", value=" << value << std::endl; return TestFail; } ++i; } return TestPass; } int run() { /* utils::hex() test. */ std::ostringstream os; std::string ref; os << utils::hex(static_cast<int32_t>(0x42)) << " "; ref += "0x00000042 "; os << utils::hex(static_cast<uint32_t>(0x42)) << " "; ref += "0x00000042 "; os << utils::hex(static_cast<int64_t>(0x42)) << " "; ref += "0x0000000000000042 "; os << utils::hex(static_cast<uint64_t>(0x42)) << " "; ref += "0x0000000000000042 "; os << utils::hex(static_cast<int32_t>(0x42), 4) << " "; ref += "0x0042 "; os << utils::hex(static_cast<uint32_t>(0x42), 1) << " "; ref += "0x42 "; os << utils::hex(static_cast<int64_t>(0x42), 4) << " "; ref += "0x0042 "; os << utils::hex(static_cast<uint64_t>(0x42), 1) << " "; ref += "0x42 "; std::string s = os.str(); if (s != ref) { cerr << "utils::hex() test failed, expected '" << ref << "', got '" << s << "'"; return TestFail; } /* utils::join() and utils::split() test. */ std::vector<std::string> elements = { "/bin", "/usr/bin", "", "", }; std::string path; for (const auto &element : elements) path += (path.empty() ? "" : ":") + element; if (path != utils::join(elements, ":")) { cerr << "utils::join() test failed" << endl; return TestFail; } std::vector<std::string> dirs; for (const auto &dir : utils::split(path, ":")) dirs.push_back(dir); if (dirs != elements) { cerr << "utils::split() test failed" << endl; return TestFail; } /* utils::join() with conversion function test. */ std::vector<Size> sizes = { { 0, 0 }, { 100, 100 } }; s = utils::join(sizes, "/", [](const Size &size) { return size.toString(); }); if (s != "0x0/100x100") { cerr << "utils::join() with conversion test failed" << endl; return TestFail; } /* utils::dirname() tests. */ if (TestPass != testDirname()) return TestFail; /* utils::map_keys() test. */ const std::map<std::string, unsigned int> map{ { "zero", 0 }, { "one", 1 }, { "two", 2 }, }; std::vector<std::string> expectedKeys{ "zero", "one", "two", }; std::sort(expectedKeys.begin(), expectedKeys.end()); const std::vector<std::string> keys = utils::map_keys(map); if (keys != expectedKeys) { cerr << "utils::map_keys() test failed" << endl; return TestFail; } /* utils::alignUp() and utils::alignDown() tests. */ if (utils::alignDown(6, 3) != 6 || utils::alignDown(7, 3) != 6) { cerr << "utils::alignDown test failed" << endl; return TestFail; } if (utils::alignUp(6, 3) != 6 || utils::alignUp(7, 3) != 9) { cerr << "utils::alignUp test failed" << endl; return TestFail; } /* utils::enumerate() test. */ if (testEnumerate() != TestPass) return TestFail; return TestPass; } }; TEST_REGISTER(UtilsTest)