decoderForSignature method
Returns the highest-priority decoder descriptor matching bytes.
Implementation
PixaDecoderDescriptor? decoderForSignature(Uint8List bytes) {
PixaDecoderDescriptor? selected;
for (final PixaDecoderDescriptor decoder in _decoders.values) {
if (!decoder.signatures.any(
(PixaDecoderSignature signature) => signature.matches(bytes),
)) {
continue;
}
if (selected == null || decoder.priority > selected.priority) {
selected = decoder;
}
}
return selected;
}