Multi lattice search: WIP - Integration added by Claude Opus (doesn't work :) )

This commit is contained in:
2026-06-05 16:22:35 +02:00
parent c1e9babe13
commit 4c45d1c835
11 changed files with 286 additions and 117 deletions
+22 -2
View File
@@ -153,6 +153,11 @@ inline void CBOR_ENC(CborEncoder &encoder, const char* key, const std::vector<fl
cborErr(cbor_encode_byte_string(&encoder, (uint8_t *) v.data(), v.size() * sizeof(float)));
}
inline void CBOR_ENC_FLOAT_ARRAY_NOKEY(CborEncoder &encoder, const std::vector<float>& v) {
cborErr(cbor_encode_tag(&encoder, TagFloatLE));
cborErr(cbor_encode_byte_string(&encoder, (uint8_t *) v.data(), v.size() * sizeof(float)));
}
inline void CBOR_ENC(CborEncoder &encoder, const char* key, const std::vector<uint8_t>& v) {
cborErr(cbor_encode_text_stringz(&encoder, key));
cborErr(cbor_encode_tag(&encoder, TagUnsignedInt8Bit));
@@ -659,7 +664,7 @@ void CBORStream2Serializer::SerializeSequenceStart(const StartMessage& message)
CBOR_ENC(mapEncoder, "channels", message.channels);
CBOR_ENC(mapEncoder, "max_spot_count", message.max_spot_count);
CBOR_ENC(mapEncoder, "max_extra_lattices", message.max_extra_lattices);
CBOR_ENC(mapEncoder, "storage_cell_number", message.storage_cell_number);
CBOR_ENC_RATIONAL(mapEncoder, "storage_cell_delay", message.storage_cell_delay_ns, 1000*1000*1000UL);
CBOR_ENC(mapEncoder, "threshold_energy", message.threshold_energy);
@@ -717,7 +722,14 @@ void CBORStream2Serializer::SerializeSequenceEnd(const EndMessage& message) {
CBOR_ENC(mapEncoder, "rotation_lattice_type", message.rotation_lattice_type);
if (message.rotation_lattice.has_value())
CBOR_ENC(mapEncoder, "rotation_lattice", message.rotation_lattice->GetVector());
if (!message.extra_lattices.empty()) {
CborEncoder arrayEncoder;
cborErr(cbor_encode_text_stringz(&mapEncoder, "extra_lattices"));
cborErr(cbor_encoder_create_array(&mapEncoder, &arrayEncoder, message.extra_lattices.size()));
for (const auto &el : message.extra_lattices)
CBOR_ENC_FLOAT_ARRAY_NOKEY(arrayEncoder, el.GetVector());
cborErr(cbor_encoder_close_container(&mapEncoder, &arrayEncoder));
}
CBOR_ENC(mapEncoder, "data_collection_efficiency_image", message.data_collection_efficiency);
CBOR_ENC(mapEncoder, "spot_count", message.spot_count);
CBOR_ENC(mapEncoder, "spot_count_ice_ring", message.spot_count_ice_ring);
@@ -769,6 +781,14 @@ void CBORStream2Serializer::SerializeImageInternal(CborEncoder &mapEncoder, cons
CBOR_ENC(mapEncoder, "indexing_lattice_count", message.indexing_lattice_count);
if (message.indexing_lattice)
CBOR_ENC(mapEncoder, "indexing_lattice", message.indexing_lattice->GetVector());
if (!message.extra_lattices.empty()) {
CborEncoder arrayEncoder;
cborErr(cbor_encode_text_stringz(&mapEncoder, "extra_lattices"));
cborErr(cbor_encoder_create_array(&mapEncoder, &arrayEncoder, message.extra_lattices.size()));
for (const auto &el : message.extra_lattices)
CBOR_ENC_FLOAT_ARRAY_NOKEY(arrayEncoder, el.GetVector());
cborErr(cbor_encoder_close_container(&mapEncoder, &arrayEncoder));
}
CBOR_ENC(mapEncoder, "profile_radius", message.profile_radius);
CBOR_ENC(mapEncoder, "mosaicity", message.mosaicity_deg);
CBOR_ENC(mapEncoder, "integrated_reflections", message.integrated_reflections);