-
Notifications
You must be signed in to change notification settings - Fork 8.3k
FORMAT PNG #57834
Description
Use case
Generate pictures from point clouds.
Caveats
Data visualization is a trap. There are too many possible customizations.
We will add a minimal feature set without presenting it as a complete solution.
Frankly speaking, this feature is needed only because I often need it for my demos.
Describe the solution you'd like
The width and height should be controlled by the settings.
Optionally, we can have settings for color space and palette mapping.
It should expect one of the following result structure variants:
A row per pixel in the pixel order. It will expect width * height number of rows, indexing the image in (y, x) order.:
- A single column of Bool type, determining binary image.
- A single column of integer or floating point type with a value between 0 and 255, determines the grayscale.
- Three columns, named
r,g,b, similar to the previous. - Four columns, named
r,g,b,a, similar to the previous.
Rows determining explicit pixel coordinates:
- columns
x,yandvorr,g,b, orr,g,b,a- it will set every pixel to the latest value for its coordinate, and all other pixels to a background color.
The format will create an image buffer in memory, fill it with the data, then convert it to PNG with fpng, and stream the bytes to the output.