mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
spectrascope: use add_pixel for non-white pixels
https://bugzilla.gnome.org/show_bug.cgi?id=651536
This commit is contained in:
parent
b4afe9f690
commit
7cee23a419
1 changed files with 25 additions and 1 deletions
|
@ -134,6 +134,30 @@ gst_spectra_scope_setup (GstBaseScope * bscope)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static inline void
|
||||
add_pixel (guint32 * _p, guint32 _c)
|
||||
{
|
||||
guint8 *p = (guint8 *) _p;
|
||||
guint8 *c = (guint8 *) & _c;
|
||||
|
||||
if (p[0] < 255 - c[0])
|
||||
p[0] += c[0];
|
||||
else
|
||||
p[0] = 255;
|
||||
if (p[1] < 255 - c[1])
|
||||
p[1] += c[1];
|
||||
else
|
||||
p[1] = 255;
|
||||
if (p[2] < 255 - c[2])
|
||||
p[2] += c[2];
|
||||
else
|
||||
p[2] = 255;
|
||||
if (p[3] < 255 - c[3])
|
||||
p[3] += c[3];
|
||||
else
|
||||
p[3] = 255;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_spectra_scope_render (GstBaseScope * bscope, GstBuffer * audio,
|
||||
GstBuffer * video)
|
||||
|
@ -180,7 +204,7 @@ gst_spectra_scope_render (GstBaseScope * bscope, GstBuffer * audio,
|
|||
vdata[off] = 0x00FFFFFF;
|
||||
for (l = y + 1; l <= h; l++) {
|
||||
off += w;
|
||||
vdata[off] = 0x007F7F7F;
|
||||
add_pixel (&vdata[off], 0x007F7F7F);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue