~emersion/go-kdf

95f5b9fa0b08760ccdb64c6ee16510d3ab1a2362 — Simon Ser 1 year, 4 months ago 143225e
cmd: decode float sample bounds
1 files changed, 8 insertions(+), 1 deletions(-)

M cmd/go-kdf/main.go
M cmd/go-kdf/main.go => cmd/go-kdf/main.go +8 -1
@@ 5,6 5,7 @@ import (
	"fmt"
	"io"
	"log"
	"math"
	"os"
	"strings"



@@ 179,5 180,11 @@ func printSampleInfo(info *kdf.SampleInfo, cm kdf.ColorModel) {
	fmt.Printf("  Bit offset: %v\n", info.BitOffset)
	fmt.Printf("  Channel: %v\n", info.Channel.Name(cm))
	fmt.Printf("  Sample position: %v\n", info.SamplePosition)
	fmt.Printf("  Sample lower and upper: 0x%X - 0x%X\n", info.SampleLower, info.SampleUpper)
	if info.Float {
		lower := math.Float32frombits(info.SampleLower)
		upper := math.Float32frombits(info.SampleUpper)
		fmt.Printf("  Sample lower and upper: %v .. %v\n", lower, upper)
	} else {
		fmt.Printf("  Sample lower and upper: 0x%X .. 0x%X\n", info.SampleLower, info.SampleUpper)
	}
}