Skip to content

Conversation

@maloel
Copy link
Contributor

@maloel maloel commented Jul 23, 2024

The default JSON serializer is done not in a very customizable fashion.
The default output is very naive and verbose, putting every single value on its own line, causing JSON dumps to take many many lines that make it hard to read.

E.g.:

    "principal-point": [
        317.4702453613281,
        237.2671356201172
    ]

Will now be:

    "principal-point": [317.4702453613281,237.2671356201172]

To do this, we have to override the default operator<< that json uses. This collides with the default implementation, so we disable json's default I/O, but this has other impacts.

Still, everything seems to work, but it adds many lines of code most of which are simply copies of the original.

Note we cannot override json::dump().

@maloel maloel requested a review from OhadMeir July 23, 2024 10:51
@maloel maloel merged commit 7e8a476 into realsenseai:development Jul 24, 2024
@maloel maloel deleted the serializer branch July 24, 2024 08:46
maloel added a commit to maloel/librealsense that referenced this pull request Jul 25, 2024
maloel added a commit that referenced this pull request Jul 25, 2024
maloel added a commit to maloel/librealsense that referenced this pull request Jul 29, 2024
maloel added a commit that referenced this pull request Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants