scijava-common
scijava-common copied to clipboard
ConvertService API improvements
For some conversions, it would be useful if we were able to hand over some optional parameters, e.g. to specify if a conversion from UnsignedShortType to UnsignedByteType should clip or not, or if a conversion to ImgLabeling should add prefixes to the labels, and if yes, which prefix.
How about a new signature:
ConvertService#convert(Object src, Type dest, Options options)
where these options could be specified?
Maybe this could even help in distinguishing between lossless and lossy conversions? (See also https://github.com/scijava/scijava-common/issues/288.) Although for this we might also need:
ConvertService#supports(Object src, Type dest, boolean lossless)
or
ConvertService#isGuaranteedLossless(Object src, Type dest)
/cc @frauzufall @ctrueden