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
local_pipe.h
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/**
19 * @file local_pipe.h
20 * @brief Local mock-camera backend API for simulator and desk testing. */
21#ifndef USHER_LOCAL_PIPE_H
22#define USHER_LOCAL_PIPE_H
23
24#include <stddef.h>
25#include "camera_backend.h"
26
27/** @brief Initialize a deterministic mock image source for local camera simulation.
28 * @param mock_image Readable JPEG copied for each shot.
29 * @return 0 on readiness or -1 on missing source/output storage.
30 * @details Copy the path into the backend so the caller need not retain it. */
31int local_pipe_init(const char *mock_image);
32
33/** @brief Initialize test mode with a supplied JPEG or a random fixture beside USHER.
34 * @param mock_image Optional explicit JPEG; NULL enables testphotos discovery.
35 * @return 0 on readiness or -1 on configuration failure.
36 * @details If discovery finds no eligible fixture, use the bundled mock JPEG. */
37int local_pipe_test_init(const char *mock_image);
38
39/** @brief Create a mock capture file for a shot.
40 * @param filename Destination path buffer.
41 * @param filename_size Destination capacity.
42 * @param image_number Shot sequence.
43 * @param identity Backend-owned filename prefix and simulation namespace.
44 * @return 0 after a complete stable regular-file copy, otherwise -1.
45 * @details Existing destinations are never overwritten; failed copies remove only their new output. */
46int local_pipe_shoot(char *filename, size_t filename_size, int image_number, const struct camera_backend *identity);
47/** @brief Prepare output storage for map-backed simulation.
48 * @param source Unused compatibility argument.
49 * @return Zero on readiness, or -1 on path or storage failure.
50 * @details Tile availability is checked per capture because the set of
51 * required tiles depends on the shot position and attitude. */
52int local_pipe_map_init(const char *source);
53/** @brief Render a map-backed capture using the trigger's camera geometry.
54 * @param[out] filename Output path buffer; use only after a successful capture.
55 * @param filename_size Capacity including the terminator.
56 * @param shot Trigger containing the photo number, position, attitude and AGL.
57 * @param identity Simulated camera prefix and raster dimensions.
58 * @param cache_directory Map tile cache root.
59 * @param horizontal_fov_deg Horizontal field of view in degrees.
60 * @param vertical_fov_deg Vertical field of view in degrees.
61 * @return Zero on publication, or -1 on invalid input, rendering or storage failure.
62 * @details Construct a simulation filename for this camera and pass its geometry
63 * to the cached-tile renderer; this path does not use a fixture JPEG. */
64int local_pipe_map_shoot(char *filename, size_t filename_size, const union dc_shot_union *shot,
65 const struct camera_backend *identity, const char *cache_directory,
66 double horizontal_fov_deg, double vertical_fov_deg);
67
68/** @brief Forget selected local fixture sources.
69 * @details No subprocess is owned and previously captured files are retained. */
70void local_pipe_deinit(void);
71
72#endif
Shared capability and lifecycle contract for USHER camera backends.
int local_pipe_map_shoot(char *filename, size_t filename_size, const union dc_shot_union *shot, const struct camera_backend *identity, const char *cache_directory, double horizontal_fov_deg, double vertical_fov_deg)
Render a map-backed capture using the trigger's camera geometry.
Definition local_pipe.c:179
int local_pipe_test_init(const char *mock_image)
Initialize test mode with a supplied JPEG or a random fixture beside USHER.
Definition local_pipe.c:87
void local_pipe_deinit(void)
Forget selected local fixture sources.
Definition local_pipe.c:295
int local_pipe_shoot(char *filename, size_t filename_size, int image_number, const struct camera_backend *identity)
Create a mock capture file for a shot.
Definition local_pipe.c:193
int local_pipe_map_init(const char *source)
Prepare output storage for map-backed simulation.
Definition local_pipe.c:171
int local_pipe_init(const char *mock_image)
Initialize a deterministic mock image source for local camera simulation.
Definition local_pipe.c:64
Function table describing one backend's owned camera operations.
static const char * mock_image
Definition usher.c:562
union dc_shot_union shot
Definition usher.c:534