def test_dump_histogram(): samples = [ # standard Hdr test histogram 'HISTFAAAACF4nJNpmSzMwMDAzAABMJoRTM6Y1mD/ASLwN5oJAFuQBYU=', 'HISTFAAAACh4nJNpmSzMwMDAyQABzFCaEUzOmNZg/wEisL2Kaasc00ImJgCC8Qbe' ] for hdrh in samples: HdrHistogram.dump(hdrh, output=open(os.devnull, 'wb')) HdrHistogram.dump(hdrh)
def main(): args = sys.argv[1:] if args: encoded_histograms = args for hdrh in encoded_histograms: print('\nDumping histogram: ' + hdrh + '\n') HdrHistogram.dump(hdrh) else: print('\nUsage: %s [<string encoded hdr histogram>]*\n' % (sys.argv[0]))
def dump(args=None): """ Dump a list of Hdr histograms encodings args: list of strings, each string representing an Hdr encoding """ if not args: args = sys.argv[1:] res = 1 if args: encoded_histograms = args for hdrh in encoded_histograms: print('\nDumping histogram: ' + hdrh + '\n') HdrHistogram.dump(hdrh) res = 0 else: print('\nUsage: %s [<string encoded hdr histogram>]*\n' % (sys.argv[0])) return res