*fix* more systray modifications for nice looking icons in real transparency mode
*add* added new options to the sample files git-svn-id: http://tint2.googlecode.com/svn/trunk@311 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
@@ -261,5 +261,4 @@ void clear_pixmap(Pixmap p, int x, int y, int w, int h)
|
||||
cairo_fill(cr);
|
||||
cairo_destroy(cr);
|
||||
cairo_surface_destroy (tmp);
|
||||
|
||||
}
|
||||
|
||||
@@ -234,3 +234,18 @@ void adjust_asb(DATA32 *data, int w, int h, int alpha, float satur, float bright
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void createHeuristicMask(DATA32* data, int w, int h)
|
||||
{
|
||||
unsigned char* udata = (unsigned char*)data;
|
||||
int b = udata[0];
|
||||
int g = udata[1];
|
||||
int r = udata[2];
|
||||
int i;
|
||||
for (i=0; i<h*w; ++i) {
|
||||
if ( abs(b-*udata)<5 && abs(g-*(udata+1))<5 && abs(r-*(udata+2))<5 ) {
|
||||
*(udata+3) = 0;
|
||||
}
|
||||
udata += 4;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,5 +64,6 @@ void get_color (char *hex, double *rgb);
|
||||
// adjust Alpha/Saturation/Brightness on an ARGB icon
|
||||
// alpha from 0 to 100, satur from 0 to 1, bright from 0 to 1.
|
||||
void adjust_asb(DATA32 *data, int w, int h, int alpha, float satur, float bright);
|
||||
void createHeuristicMask(DATA32* data, int w, int h);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user