Skip to content

Commit ba7cfbd

Browse files
committed
remove useless screenshot brightness modification
1 parent 8ffc598 commit ba7cfbd

3 files changed

Lines changed: 3 additions & 28 deletions

File tree

src/memtopixmap.c

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ GdkPixbuf* renderMemToPixbuf(const guchar* mem, size_t len) {
6666
return pixbuf;
6767
}
6868

69-
void renderMemToGtkPixmap(const guchar* mem, size_t len,
70-
GdkPixmap **pix, GdkBitmap **mask, guint* width, guint* height, unsigned char brightness) {
69+
void renderMemToGtkPixmap(const guchar* mem, size_t len, GdkPixmap **pix, GdkBitmap **mask, guint* width, guint* height) {
7170
GdkPixbuf* pixbuf = renderMemToPixbuf(mem, len);
7271

7372
if (pixbuf) {
@@ -77,30 +76,6 @@ void renderMemToGtkPixmap(const guchar* mem, size_t len,
7776
*height = gdk_pixbuf_get_height(pixbuf);
7877
*width = gdk_pixbuf_get_width(pixbuf);
7978

80-
if (brightness && gdk_pixbuf_get_n_channels (pixbuf) >= 3) // brightness correction
81-
{
82-
unsigned x, y;
83-
unsigned w = gdk_pixbuf_get_width (pixbuf);
84-
unsigned h = gdk_pixbuf_get_height (pixbuf);
85-
unsigned rs = gdk_pixbuf_get_rowstride (pixbuf);
86-
unsigned c = gdk_pixbuf_get_n_channels (pixbuf);
87-
unsigned char* p = gdk_pixbuf_get_pixels (pixbuf);
88-
register unsigned tmp;
89-
for (y=0; y < h; ++y) {
90-
for (x=0; x < w; ++x, p+=c) {
91-
tmp = p[0] + brightness;
92-
p[0] = (tmp>0xFF)?0xFF:tmp;
93-
tmp = p[1] + brightness;
94-
p[1] = (tmp>0xFF)?0xFF:tmp;
95-
tmp = p[2] + brightness;
96-
p[2] = (tmp>0xFF)?0xFF:tmp;
97-
}
98-
if (x*c<rs) {
99-
p += (rs - x*c);
100-
}
101-
}
102-
}
103-
10479
gdk_pixbuf_render_pixmap_and_mask(pixbuf,pix,mask,0);
10580

10681
g_object_unref(pixbuf);

src/memtopixmap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
#ifndef _MEMTOPIXMAP_H_
2121
#define _MEMTOPIXMAP_H_
2222

23-
void renderMemToGtkPixmap(const guchar* mem, size_t len, GdkPixmap **pix, GdkBitmap **mask, guint* width, guint* height, unsigned char brightness);
23+
void renderMemToGtkPixmap(const guchar* mem, size_t len, GdkPixmap **pix, GdkBitmap **mask, guint* width, guint* height);
2424

2525
#endif

src/xqf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,7 @@ static void server_mapshot_preview_popup_show (guchar *imagedata, size_t len, in
21012101
GdkPixmap *pix = NULL;
21022102
GdkBitmap *mask = NULL;
21032103

2104-
renderMemToGtkPixmap (imagedata, len, &pix, &mask, &w, &h, 64);
2104+
renderMemToGtkPixmap (imagedata, len, &pix, &mask, &w, &h);
21052105

21062106
if (!pix || !w || !h) {
21072107
if (pix) gdk_pixmap_unref (pix);

0 commit comments

Comments
 (0)