URI:
       Added Pixelation - slock - 🔒 glitch version of slock
  HTML git clone https://git.drkhsh.at/slock.git
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 731d4dc277a5d600092dd10c74bcdc4fb93d0872
   DIR parent 9aca1b76a5ba66c80f68d4d9cce5b1eaa986a9b1
  HTML Author: Lars Niesen <iah71niesen@gso-koeln.de>
       Date:   Wed, 29 Apr 2020 17:33:09 +0200
       
       Added Pixelation
       
       Diffstat:
         M config.def.h                        |       4 ++--
         M slock.c                             |      42 +++++++++++++++++++++++++++++++
       
       2 files changed, 44 insertions(+), 2 deletions(-)
       ---
   DIR diff --git a/config.def.h b/config.def.h
       @@ -12,4 +12,5 @@ static const char *colorname[NUMCOLS] = {
        static const int failonclear = 1;
        
        /*Set Blur radius*/
       -static const int blurRadius=5;
       -\ No newline at end of file
       +static const int blurRadius=0;
       +static const int pixelSize=5;
   DIR diff --git a/slock.c b/slock.c
       @@ -382,7 +382,49 @@ main(int argc, char **argv) {
                imlib_context_set_visual(DefaultVisual(dpy,0));
                imlib_context_set_drawable(RootWindow(dpy,XScreenNumberOfScreen(scr)));        
                imlib_copy_drawable_to_image(0,0,0,scr->width,scr->height,0,0,1);
       +        
       +        /*Blur function*/
                imlib_image_blur(blurRadius);
       +
       +
       +        /*Pixelation*/
       +        int width = scr->width;
       +        int height = scr->height;
       +        
       +        for(int y = 0; y < height; y += pixelSize)
       +        {
       +                for(int x = 0; x < width; x += pixelSize)
       +                {
       +                        int red = 0;
       +                        int green = 0;
       +                        int blue = 0;
       +
       +                        Imlib_Color pixel; 
       +                        Imlib_Color* pp;
       +                        pp = &pixel;
       +                        for(int j = 0; j < pixelSize && j < height; j++)
       +                        {
       +                                for(int i = 0; i < pixelSize && i < width; i++)
       +                                {
       +                                        imlib_image_query_pixel(x+i,y+j,pp);
       +                                        red += pixel.red;
       +                                        green += pixel.green;
       +                                        blue += pixel.blue;
       +                                }
       +                        }
       +                        red /= (pixelSize*pixelSize);
       +                        green /= (pixelSize*pixelSize);
       +                        blue /= (pixelSize*pixelSize);
       +                        printf("R/G/B: %i/%i/%i\n",red,green,blue);
       +                        imlib_context_set_color(red,green,blue,pixel.alpha);
       +                        imlib_image_fill_rectangle(x,y,pixelSize,pixelSize);
       +                        red = 0;
       +                        green = 0;
       +                        blue = 0;
       +                }
       +        }
       +        
       +        
                
                /* check for Xrandr support */
                rr.active = XRRQueryExtension(dpy, &rr.evbase, &rr.errbase);