From de30f809efd68571da9b1b2ce2023fffae274d30 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Tue, 4 Jun 2024 23:19:58 +0700 Subject: [PATCH] #3837 add plane range dump utility function --- xpra/codecs/argb/argb.pxd | 4 +++- xpra/codecs/argb/argb.pyx | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/xpra/codecs/argb/argb.pxd b/xpra/codecs/argb/argb.pxd index 7fc57d935a..20d668e4a9 100644 --- a/xpra/codecs/argb/argb.pxd +++ b/xpra/codecs/argb/argb.pxd @@ -1,6 +1,6 @@ # This file is part of Xpra. # Copyright (C) 2008, 2009 Nathaniel Smith -# Copyright (C) 2013-2021 Antoine Martin +# Copyright (C) 2013-2024 Antoine Martin # Xpra is released under the terms of the GNU GPL v2, or, at your option, any # later version. See the file COPYING for details. @@ -8,3 +8,5 @@ cdef argbdata_to_rgba(const unsigned int* argb, const int argb_len) #pylint: di cdef argbdata_to_rgb(const unsigned int* argb, const int argb_len) cdef bgradata_to_rgb(const unsigned int* bgra, const int bgra_len) cdef bgradata_to_rgba(const unsigned int* bgra, const int bgra_len) + +cdef show_plane_range(name, plane, int width, int stride, int height) diff --git a/xpra/codecs/argb/argb.pyx b/xpra/codecs/argb/argb.pyx index d14d472751..1663349ce3 100644 --- a/xpra/codecs/argb/argb.pyx +++ b/xpra/codecs/argb/argb.pyx @@ -776,3 +776,20 @@ cdef bitdata_to_rectangles(const unsigned char* bitdata, const int bitdata_len, if start ( int(buf)) + for y in range(height): + for x in range(width): + value = plane_buf[y*stride + x] + if value < minv: + minv = value + if value > maxv: + maxv = value + log.info("%s plane: min=%s, max=%s", name, minv, maxv)