Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
aicam.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2026 OpenUAS
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/** @file aicam.cpp
19 * @brief Command-line entry point for the native AIcam photo worker.
20 * @details Delegate camera ownership and the capture protocol to the shared
21 * IMX500 implementation. This entry point does not interpret neural outputs. */
22#include <cstdio>
23#include <cstring>
24
25#include "imx500_camera.hpp"
26#include "version.h"
27
28/** @brief Report CLI metadata or run the photo worker.
29 * @param argc Argument count including the program name.
30 * @param argv Command-line vector; a leading photo-only marker is consumed here.
31 * @return Zero for help or version, otherwise the worker's exit status.
32 * @details Handle metadata requests before entering the worker so they do not
33 * require camera access. */
34int main(int argc, char **argv)
35{
36 if (argc == 2 && (!std::strcmp(argv[1], "--help") || !std::strcmp(argv[1], "-h"))) {
37 std::puts(AICAM_BUILD_VERSION);
38 std::puts("Usage: aicam --probe | --capture /absolute/photo.jpg | --serve WIDTH HEIGHT | --version");
39 return 0;
40 }
41 if (argc == 2 && (!std::strcmp(argv[1], "--version") || !std::strcmp(argv[1], "-V"))) {
42 std::puts(AICAM_BUILD_VERSION);
43 return 0;
44 }
45 if (argc > 1 && !std::strcmp(argv[1], "--photo-only")) {
46 return imx500::run_photo_worker(argc - 1, argv + 1, "aicam");
47 }
48 return imx500::run_photo_worker(argc, argv, "aicam");
49}
int main(int argc, char **argv)
Report CLI metadata or run the photo worker.
Definition aicam.cpp:34
Neutral IMX500 frame ownership, JPEG publication and worker protocol.
int run_photo_worker(int argc, char **argv, const char *application)
Run photo-only probe, capture or serve without model loading or inference.
#define AICAM_BUILD_VERSION
Definition version.h:74