summaryrefslogtreecommitdiff
path: root/projects/linux/mm/bsp41x_vsp-Improve-debugging.yaml
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2022-05-18 14:39:41 +0200
committerWolfram Sang <wsa+renesas@sang-engineering.com>2022-05-25 17:29:08 +0200
commit2398365f9683a4b9838fa8fb4b474122078514c8 (patch)
treec6b525bf3ce94787b909a38517a8928a498c6147 /projects/linux/mm/bsp41x_vsp-Improve-debugging.yaml
parent5d49779522cf1b63eed015bdf8c497f2e4cf5898 (diff)
projects: linux: io: updates up to W21
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Diffstat (limited to 'projects/linux/mm/bsp41x_vsp-Improve-debugging.yaml')
0 files changed, 0 insertions, 0 deletions
um">1], 'rb').read() if len(data) == (2 + 64) * 4 or len(data) == (2 + 256) * 4: maxmin = struct.unpack('<I', data[0:4]) sums = struct.unpack('<I', data[4:8]) histo = struct.unpack('<%uI' % (len(data[8:]) / 4), data[8:]) num_bins = len(histo); title = 'min %u max %u sum %u' % \ ((maxmin[0] >> 0) & 0xff, (maxmin[0] >> 16) & 0xff, sums[0]) print 'pixels (%u)' % sum(histo) plt.figure(figsize=(10, 10)) plt.xlim([0, num_bins]) plt.ylim([0, max(histo)]) plt.bar(range(num_bins), histo, color='r'); elif len(data) == (6 + 64 * 3) * 4: maxmin = struct.unpack('<III', data[0:12]) sums = struct.unpack('<III', data[12:24]) histo = [struct.unpack('<I', data[24+i*4:24+i*4+4])[0] for i in xrange(len(data[24:])/4)] num_bins = len(histo) / 3; histo_r = histo[0:num_bins] histo_g = histo[num_bins:2*num_bins] histo_b = histo[num_bins*2:] title = 'RGB min (%u,%u,%u) max (%u,%u,%u) sum (%u,%u,%u)' % \ ((maxmin[0] >> 0) & 0xff, (maxmin[1] >> 0) & 0xff, (maxmin[2] >> 0) & 0xff, (maxmin[0] >> 16) & 0xff, (maxmin[1] >> 16) & 0xff, (maxmin[2] >> 16) & 0xff, sums[0], sums[1], sums[2]) print 'pixels RGB (%u,%u,%u)' % (sum(histo_r), sum(histo_g), sum(histo_b)) plt.figure(figsize=(10, 20)) plt.subplot(3, 1, 1) plt.xlim([0, num_bins]) plt.ylim([0, max(histo_r)]) plt.bar(range(num_bins), histo_r, color='r'); plt.subplot(3, 1, 2) plt.xlim([0, num_bins]) plt.ylim([0, max(histo_g)]) plt.bar(range(num_bins), histo_g, color='g'); plt.subplot(3, 1, 3) plt.xlim([0, num_bins]) plt.ylim([0, max(histo_b)]) plt.bar(range(num_bins), histo_b, color='b'); else: print 'Invalid histogram length %u' % len(data) return 1 plt.suptitle(title) plt.savefig(argv[1].replace('bin', 'png'), dpi=72) return 0 if __name__ == '__main__': sys.exit(main(sys.argv))