Open kakukogou opened 8 years ago
LGTM.
DEPTH to GRAY8 conversion should be possible. Converting DEPTH to/from other formats probably does not make sense, and throwing in such cases makes sense.
We use the following DEPTH to GRAY8 conversion in https://w3c.github.io/mediacapture-depth/#dfn-convert-the-depth-map-value-to-grayscale to retrofit depth to canvas-based workflow that is limited to 8 bits per pixel. The mediacapture-worker spec would enable processing of 16-bit depth values per pixel for more advanced use cases as noted in https://w3c.github.io/mediacapture-depth/#introduction
/cc @huningxin
@rocallahan suggested that the ImageBitmap::FindOptimalFormat() should not return an empty string. It should always be convertible between any format except to/from DEPTH and we could throw while converting to/from the DEPTH format.