This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.

The branch, next has been updated
  discards  15c3175d2c5454c9cbe490ddb6ed884934038e3c (commit)
  discards  98ac76b77878b7cf3f00720a8a557d7c82c1c8ba (commit)
  discards  d40fdae1edee89208cfba1f9e51d289ea76dda88 (commit)
       via  29301d9b038776dae7a58bf762b95af676f78cde (commit)
       via  5ee39b7a27674fa5f260094d7691ef96b1bcaeb0 (commit)
       via  057048e09b5a97f3992da35d6d08a092a5966088 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (15c3175d2c5454c9cbe490ddb6ed884934038e3c)
                         N -- N -- N (29301d9b038776dae7a58bf762b95af676f78cde)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/29301d9b038776dae7a58bf762b95af676f78cde

commit 29301d9b038776dae7a58bf762b95af676f78cde
Author: David Maciejak <[email protected]>
Date:   Wed May 21 17:10:22 2014 +0700

    wrlib: RRotateImage function not fully implemented
    
    when the rotation angle value passed to RRotateImage is a modulo of 90,
    the function is working well but in other cases the rotateImage()
    function is called. That last function is half implemented but
    the half already implemented part is also segfaulting (use the testrot.c
    to replay the crash).
    So the patch is moving the 'not implemented' msg to disable the whole
    rotateImage() function and comment it out.

diff --git a/wrlib/rotate.c b/wrlib/rotate.c
index fead8ae7..09e8a0ad 100644
--- a/wrlib/rotate.c
+++ b/wrlib/rotate.c
@@ -213,6 +213,7 @@ RImage *RRotateImage(RImage * image, float angle)
  *
  */
 
+#if 0
 static void
 copyLine(int x1, int y1, int x2, int y2, int nwidth, int format, unsigned char 
*dst, unsigned char **src)
 {
@@ -292,9 +293,14 @@ copyLine(int x1, int y1, int x2, int y2, int nwidth, int 
format, unsigned char *
 
        *src = s;
 }
+#endif
 
 static RImage *rotateImage(RImage * image, float angle)
 {
+       (void) angle;
+       puts("NOT FULLY IMPLEMENTED");
+       return RCloneImage(image);
+#if 0
        RImage *img;
        int nwidth, nheight;
        int x1, y1;
@@ -371,8 +377,6 @@ static RImage *rotateImage(RImage * image, float angle)
                        }
                }
        } else {
-               puts("NOT IMPLEMTENED");
-               return img;
                dpr = dx << 1;
                dpru = dpr - (dy << 1);
                p = dpr - dy;
@@ -396,4 +400,5 @@ static RImage *rotateImage(RImage * image, float angle)
        }
 
        return img;
+#endif
 }

http://repo.or.cz/w/wmaker-crm.git/commit/5ee39b7a27674fa5f260094d7691ef96b1bcaeb0

commit 5ee39b7a27674fa5f260094d7691ef96b1bcaeb0
Author: David Maciejak <[email protected]>
Date:   Wed May 21 16:50:50 2014 +0700

    util/wmiv: correct errors and warnings
    
    This patch is correcting all errors and almost all warnings reported
    by checkpatch.

diff --git a/util/wmiv.c b/util/wmiv.c
index 8c382c9b..2eab5d38 100755
--- a/util/wmiv.c
+++ b/util/wmiv.c
@@ -18,7 +18,9 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#if !defined(_GNU_SOURCE)
 #define _GNU_SOURCE
+#endif
 #include <X11/keysym.h>
 #include <X11/XKBlib.h>
 #include <X11/Xatom.h>
@@ -38,8 +40,8 @@
 
 #ifdef USE_XPM
 extern int XpmCreatePixmapFromData(Display *, Drawable, char **, Pixmap *, 
Pixmap *, void *);
-/* this is the icon from eog project
-   git.gnome.org/browse/eog
+/*     this is the icon from eog project
+       git.gnome.org/browse/eog
 */
 #include "wmiv.h"
 #endif
@@ -82,7 +84,7 @@ RColor red;
 
 typedef struct link link_t;
 struct link {
-       const void * data;
+       const void *data;
        link_t *prev;
        link_t *next;
 };
@@ -100,7 +102,8 @@ link_t *current_link;
        change_title: used to change window title
        return EXIT_SUCCESS on success, 1 on failure
 */
-int change_title(XTextProperty *prop, char *filename) {
+int change_title(XTextProperty *prop, char *filename)
+{
        char *combined_title = NULL;
        if (!asprintf(&combined_title, "%s - %u/%u - %s", APPNAME, 
current_index, max_index, filename))
                if (!asprintf(&combined_title, "%s - %u/%u", APPNAME, 
current_index, max_index))
@@ -117,7 +120,8 @@ int change_title(XTextProperty *prop, char *filename) {
        rescale_image: used to rescale the current image based on the screen 
size
        return EXIT_SUCCESS on success
 */
-int rescale_image() {
+int rescale_image(void)
+{
        long final_width = img->width;
        long final_height = img->height;
 
@@ -168,9 +172,11 @@ int rescale_image() {
        maximize_image: find the best image size for the current display
        return EXIT_SUCCESS on success
 */
-int maximize_image() {
+int maximize_image(void)
+{
        rescale_image();
-       XCopyArea(dpy, pix, win, ctx->copy_gc, 0, 0, img->width, img->height, 
max_width/2-img->width/2, max_height/2-img->height/2);
+       XCopyArea(dpy, pix, win, ctx->copy_gc, 0, 0,
+               img->width, img->height, max_width/2-img->width/2, 
max_height/2-img->height/2);
        return EXIT_SUCCESS;
 }
 
@@ -178,22 +184,23 @@ int maximize_image() {
        merge_with_background: merge the current image with with a checkboard 
background
        return EXIT_SUCCESS on success, 1 on failure
 */
-int merge_with_background(RImage *i) {
+int merge_with_background(RImage *i)
+{
        if (i) {
                RImage *back;
                back = RCreateImage(i->width, i->height, True);
                if (back) {
                        int opaq = 255;
-                       int x=0, y=0;
+                       int x = 0, y = 0;
 
                        RFillImage(back, &lightGray);
-                       for (x=0; x <= i->width; x+=8) {
+                       for (x = 0; x <= i->width; x += 8) {
                                if (x/8 % 2)
                                        y = 8;
                                else
                                        y = 0;
-                               for (; y <= i->height; y+=16)
-                                       ROperateRectangle(back, RAddOperation, 
x,y,x+8,y+8, &darkGray);
+                               for (; y <= i->height; y += 16)
+                                       ROperateRectangle(back, RAddOperation, 
x, y, x+8, y+8, &darkGray);
                        }
 
                        RCombineImagesWithOpaqueness(i, back, opaq);
@@ -209,15 +216,15 @@ int merge_with_background(RImage *i) {
        return the image on success, NULL on failure
 
 */
-RImage* draw_failed_image() {
+RImage *draw_failed_image(void)
+{
        RImage *failed_image = NULL;
        XWindowAttributes attr;
 
-       if (win && (XGetWindowAttributes(dpy, win, &attr) >= 0)) {
+       if (win && (XGetWindowAttributes(dpy, win, &attr) >= 0))
                failed_image = RCreateImage(attr.width, attr.height, False);
-       } else {
+       else
                failed_image = RCreateImage(50, 50, False);
-       }
        if (!failed_image)
                return NULL;
 
@@ -232,7 +239,8 @@ RImage* draw_failed_image() {
        full_screen: sending event to the window manager to switch from/to full 
screen mode
        return EXIT_SUCCESS on success, 1 on failure
 */
-int full_screen() {
+int full_screen(void)
+{
        XEvent xev;
 
        Atom wm_state = XInternAtom(dpy, "_NET_WM_STATE", True);
@@ -268,7 +276,8 @@ int full_screen() {
        arg: 1 to zoom in, 0 to zoom out
        return EXIT_SUCCESS on success, 1 on failure
 */
-int zoom_in_out(int z) {
+int zoom_in_out(int z)
+{
        RImage *old_img = img;
        RImage *tmp = RLoadImage(ctx, current_link->data, 0);
        if (!tmp)
@@ -276,7 +285,8 @@ int zoom_in_out(int z) {
 
        if (z) {
                zoom_factor += 0.2;
-               img = RScaleImage(tmp, tmp->width + (int)(tmp->width * 
zoom_factor), tmp->height + (int)(tmp->height * zoom_factor));
+               img = RScaleImage(tmp, tmp->width + (int)(tmp->width * 
zoom_factor),
+                               tmp->height + (int)(tmp->height * zoom_factor));
                if (!img) {
                        img = old_img;
                        return EXIT_FAILURE;
@@ -313,7 +323,8 @@ int zoom_in_out(int z) {
        zoom_in: transitional fct used to call zoom_in_out with zoom in flag
        return EXIT_SUCCESS on success, 1 on failure
 */
-int zoom_in() {
+int zoom_in(void)
+{
        return zoom_in_out(1);
 }
 
@@ -321,7 +332,8 @@ int zoom_in() {
        zoom_out: transitional fct used to call zoom_in_out with zoom out flag
        return EXIT_SUCCESS on success, 1 on failure
 */
-int zoom_out() {
+int zoom_out(void)
+{
        return zoom_in_out(0);
 }
 
@@ -330,7 +342,8 @@ int zoom_out() {
        arg: way which could be PREV or NEXT constant
        return EXIT_SUCCESS on success, 1 on failure
 */
-int change_image(int way) {
+int change_image(int way)
+{
        if (img && current_link) {
                int old_img_width = img->width;
                int old_img_height = img->height;
@@ -358,22 +371,23 @@ int change_image(int way) {
                img = RLoadImage(ctx, current_link->data, 0);
 
                if (!img) {
-                       fprintf(stderr, "Error: %s %sn", (char 
*)current_link->data, RMessageForError(RErrorCode));
+                       fprintf(stderr, "Error: %s %sn", (char 
*)current_link->data,
+                               RMessageForError(RErrorCode));
                        img = draw_failed_image();
                } else {
                        merge_with_background(img);
                }
                rescale_image();
                if (!fullscreen_flag) {
-                       if ((old_img_width != img->width) || (old_img_height != 
img->height)) {
+                       if ((old_img_width != img->width) || (old_img_height != 
img->height))
                                XResizeWindow(dpy, win, img->width, 
img->height);
-                       } else {
+                       else
                                XCopyArea(dpy, pix, win, ctx->copy_gc, 0, 0, 
img->width, img->height, 0, 0);
-                       }
                        change_title(&title_property, (char 
*)current_link->data);
                } else {
                        XClearWindow(dpy, win);
-                       XCopyArea(dpy, pix, win, ctx->copy_gc, 0, 0, 
img->width, img->height, max_width/2-img->width/2, max_height/2-img->height/2); 
                   
+                       XCopyArea(dpy, pix, win, ctx->copy_gc, 0, 0,
+                               img->width, img->height, 
max_width/2-img->width/2, max_height/2-img->height/2);
                }
                return EXIT_SUCCESS;
        }
@@ -386,7 +400,8 @@ int change_image(int way) {
        arg: not used
        return void
 */
-void* diaporama(void *arg) {
+void *diaporama(void *arg)
+{
        (void) arg;
 
        XKeyEvent event;
@@ -404,7 +419,7 @@ void* diaporama(void *arg) {
        event.state = 0;
        event.type = KeyPress;
 
-       while(diaporama_flag) {
+       while (diaporama_flag) {
                int r;
                r = XSendEvent(event.display, event.window, True, KeyPressMask, 
(XEvent *)&event);
                if (!r)
@@ -421,7 +436,8 @@ void* diaporama(void *arg) {
 /*
        linked_list_init: init the linked list
 */
-void linked_list_init (linked_list_t *list) {
+void linked_list_init(linked_list_t *list)
+{
        list->first = list->last = 0;
        list->count = 0;
 }
@@ -430,13 +446,14 @@ void linked_list_init (linked_list_t *list) {
        linked_list_add: add an element to the linked list
        return EXIT_SUCCESS on success, 1 otherwise
 */
-int linked_list_add (linked_list_t *list, const void *data) {
+int linked_list_add(linked_list_t *list, const void *data)
+{
        link_t *link;
 
        /* calloc sets the "next" field to zero. */
-       link = calloc (1, sizeof (link_t));
-       if (! link) {
-               fprintf (stderr, "calloc failed.n");
+       link = calloc(1, sizeof(link_t));
+       if (!link) {
+               fprintf(stderr, "calloc failed.n");
                return EXIT_FAILURE;
        }
        link->data = data;
@@ -456,7 +473,8 @@ int linked_list_add (linked_list_t *list, const void *data) 
{
 /*
        linked_list_free: deallocate the whole linked list
 */
-void linked_list_free (linked_list_t *list) {
+void linked_list_free(linked_list_t *list)
+{
        link_t *link;
        link_t *next;
        for (link = list->first; link; link = next) {
@@ -464,7 +482,7 @@ void linked_list_free (linked_list_t *list) {
                next = link->next;
                if (link->data)
                        free((char *)link->data);
-               free (link);
+               free(link);
        }
 }
 
@@ -473,7 +491,8 @@ void linked_list_free (linked_list_t *list) {
        arg: the directory path that contains images, the linked list where to 
add the new file refs
        return: the first argument of the list or NULL on failure
 */
-link_t* connect_dir(char *dirpath, linked_list_t *li) {
+link_t *connect_dir(char *dirpath, linked_list_t *li)
+{
        struct dirent **dir;
        int dv, idx;
        char path[PATH_MAX] = "";
@@ -486,7 +505,7 @@ link_t* connect_dir(char *dirpath, linked_list_t *li) {
                /* maybe it's a file */
                struct stat stDirInfo;
                if (lstat(dirpath, &stDirInfo) == 0) {
-                       linked_list_add (li, strdup(dirpath));
+                       linked_list_add(li, strdup(dirpath));
                        return li->first;
                } else {
                        return NULL;
@@ -500,9 +519,8 @@ link_t* connect_dir(char *dirpath, linked_list_t *li) {
                                snprintf(path, PATH_MAX, "%s%c%s", dirpath, 
FILE_SEPARATOR, dir[idx]->d_name);
 
                        free(dir[idx]);
-                       if ((lstat(path, &stDirInfo) == 0) && 
!S_ISDIR(stDirInfo.st_mode)) {
-                               linked_list_add (li, strdup(path));
-                       }
+                       if ((lstat(path, &stDirInfo) == 0) && 
!S_ISDIR(stDirInfo.st_mode))
+                               linked_list_add(li, strdup(path));
        }
        free(dir);
        return li->first;
@@ -511,7 +529,8 @@ link_t* connect_dir(char *dirpath, linked_list_t *li) {
 /*
        main
 */
-int main(int argc, char **argv) {
+int main(int argc, char **argv)
+{
        int option = -1;
        RContextAttributes attr;
        XEvent e;
@@ -525,8 +544,8 @@ int main(int argc, char **argv) {
 #ifdef USE_XPM
        Pixmap icon_pixmap, icon_shape;
 #endif
-
-       if (!(class_hints = XAllocClassHint())) {
+       class_hints = XAllocClassHint();
+       if (!class_hints) {
                fprintf(stderr, "Error: failure allocating memoryn");
                return EXIT_FAILURE;
        }
@@ -541,38 +560,39 @@ int main(int argc, char **argv) {
        red.red = 255;
        red.green = red.blue = 0;
 
-       if ((option = getopt(argc, argv, "hv")) != -1) {
+       option = getopt(argc, argv, "hv");
+       if (option != -1) {
                switch (option) {
-                       case 'h':
-                               fprintf(stderr, "Usage: %s 
[image(s)|directory]n"
-                               "Keys:n"
-                               "+: zoom inn"
-                               "-: zoom outn"
-                               "esc: actual sizen"
+               case 'h':
+                       fprintf(stderr, "Usage: %s [image(s)|directory]n"
+                       "Keys:n"
+                       "+: zoom inn"
+                       "-: zoom outn"
+                       "esc: actual sizen"
 #ifdef HAVE_PTHREAD
-                               "d: launch diaporama moden"
+                       "d: launch diaporama moden"
 #endif
-                               "q: quitn"
-                               "right: next imagen"
-                               "left: previous imagen"
-                               "up: first imagen"
-                               "down: last imagen",
-                               argv[0]);
-                               return EXIT_SUCCESS;
-                       case 'v':
-                               fprintf(stderr, "%s version %d.%dn", APPNAME, 
APPVERSION_MAJOR, APPVERSION_MINOR);
-                               return EXIT_SUCCESS;
-                       case '?':
-                               return EXIT_FAILURE;
+                       "q: quitn"
+                       "right: next imagen"
+                       "left: previous imagen"
+                       "up: first imagen"
+                       "down: last imagen",
+                       argv[0]);
+                       return EXIT_SUCCESS;
+               case 'v':
+                       fprintf(stderr, "%s version %d.%dn", APPNAME, 
APPVERSION_MAJOR, APPVERSION_MINOR);
+                       return EXIT_SUCCESS;
+               case '?':
+                       return EXIT_FAILURE;
                }
        }
 
-       linked_list_init (&list);
+       linked_list_init(&list);
 
        dpy = XOpenDisplay(NULL);
        if (!dpy) {
                fprintf(stderr, "Error: can't open display");
-               linked_list_free (&list);
+               linked_list_free(&list);
                return EXIT_FAILURE;
        }
 
@@ -613,10 +633,12 @@ int main(int argc, char **argv) {
        if (DEBUG)
                fprintf(stderr, "display size: %dx%dn", max_width, max_height);
 
-       win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 
img->width, img->height, 0, 0, BlackPixel(dpy, screen));
+       win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0,
+               img->width, img->height, 0, 0, BlackPixel(dpy, screen));
        XSelectInput(dpy, win, 
KeyPressMask|StructureNotifyMask|ExposureMask|ButtonPressMask|FocusChangeMask);
 
-       if (!(size_hints = XAllocSizeHints())) {
+       size_hints = XAllocSizeHints();
+       if (!size_hints) {
                fprintf(stderr, "Error: failure allocating memoryn");
                return EXIT_FAILURE;
        }
@@ -706,28 +728,28 @@ int main(int argc, char **argv) {
                        continue;
                }
                if (e.type == ButtonPress) {
-                       switch(e.xbutton.button) {
-                               case Button1: {
-                                       if (focus) {
-                                               if (img && (e.xbutton.x > 
img->width/2))
-                                                       change_image(NEXT);
-                                               else
-                                                       change_image(PREV);
-                                               }
+                       switch (e.xbutton.button) {
+                       case Button1: {
+                               if (focus) {
+                                       if (img && (e.xbutton.x > img->width/2))
+                                               change_image(NEXT);
+                                       else
+                                               change_image(PREV);
                                        }
-                                       break;
-                               case Button4:
-                                       zoom_in();
-                                       break;
-                               case Button5:
-                                       zoom_out();
-                                       break;
-                               case 8:
-                                       change_image(PREV);
-                                       break;
-                               case 9:
-                                       change_image(NEXT);
-                                       break;
+                               }
+                               break;
+                       case Button4:
+                               zoom_in();
+                               break;
+                       case Button5:
+                               zoom_out();
+                               break;
+                       case 8:
+                               change_image(PREV);
+                               break;
+                       case 9:
+                               change_image(NEXT);
+                               break;
                        }
                        continue;
                }
@@ -738,60 +760,60 @@ int main(int argc, char **argv) {
                                diaporama_flag = False;
 #endif
                        switch (keysym) {
-                               case XK_Right:
+                       case XK_Right:
+                               change_image(NEXT);
+                               break;
+                       case XK_Left:
+                               change_image(PREV);
+                               break;
+                       case XK_Up:
+                               if (current_link) {
+                                       current_link = list.last;
                                        change_image(NEXT);
-                                       break;
-                               case XK_Left:
+                               }
+                               break;
+                       case XK_Down:
+                               if (current_link) {
+                                       current_link = list.first;
                                        change_image(PREV);
-                                       break;
-                               case XK_Up:
-                                       if (current_link) {
-                                               current_link = list.last;
-                                               change_image(NEXT);
-                                       }
-                                       break;
-                               case XK_Down:
-                                       if (current_link) {
-                                               current_link = list.first;
-                                               change_image(PREV);
-                                       }
-                                       break;
+                               }
+                               break;
 #ifdef HAVE_PTHREAD
-                               case XK_F5:
-                               case XK_d:
-                                       if (!tid) {
-                                               if (current_link && 
!diaporama_flag) {
-                                                       diaporama_flag = True;
-                                                       pthread_create(&tid, 
NULL, &diaporama, NULL);
-                                               } else {
-                                                       fprintf(stderr, "Can't 
use diaporama mode, need a picture directoryn");
-                                               }
-                                       }
-                                       break;
-#endif
-                               case XK_q:
-                                       quit = 1;
-                                       break;
-                               case XK_Escape:
-                                       if (!fullscreen_flag) {
-                                               zoom_factor = -0.2;
-                                               /* zoom_in will increase the 
zoom factor by 0.2 */
-                                               zoom_in();
+                       case XK_F5:
+                       case XK_d:
+                               if (!tid) {
+                                       if (current_link && !diaporama_flag) {
+                                               diaporama_flag = True;
+                                               pthread_create(&tid, NULL, 
&diaporama, NULL);
                                        } else {
-                                               /* we are in fullscreen mode 
already, want to return to normal size */
-                                               full_screen();
+                                               fprintf(stderr, "Can't use 
diaporama moden");
                                        }
-                                       break;
-                               case XK_plus:
+                               }
+                               break;
+#endif
+                       case XK_q:
+                               quit = 1;
+                               break;
+                       case XK_Escape:
+                               if (!fullscreen_flag) {
+                                       zoom_factor = -0.2;
+                                       /* zoom_in will increase the zoom 
factor by 0.2 */
                                        zoom_in();
-                                       break;
-                               case XK_minus:
-                                       zoom_out();
-                                       break;
-                               case XK_F11:
-                               case XK_f:
+                               } else {
+                                       /* we are in fullscreen mode already, 
want to return to normal size */
                                        full_screen();
-                                       break;
+                               }
+                               break;
+                       case XK_plus:
+                               zoom_in();
+                               break;
+                       case XK_minus:
+                               zoom_out();
+                               break;
+                       case XK_F11:
+                       case XK_f:
+                               full_screen();
+                               break;
                        }
 
                }

http://repo.or.cz/w/wmaker-crm.git/commit/057048e09b5a97f3992da35d6d08a092a5966088

commit 057048e09b5a97f3992da35d6d08a092a5966088
Author: David Maciejak <[email protected]>
Date:   Wed May 21 11:59:48 2014 +0700

    wrlib: add image flip functions
    
    This patch adds RVerticalFlipImage and RHorizontalFlipImage functions.

diff --git a/wrlib/Makefile.am b/wrlib/Makefile.am
index 3f229c53..489b4a4e 100644
--- a/wrlib/Makefile.am
+++ b/wrlib/Makefile.am
@@ -34,6 +34,7 @@ libwraster_la_SOURCES =               misc.c                  
scale.c                 rotate.c        +       flip.c                  
convolve.c              save_xpm.c              xutil.c         diff --git 
a/wrlib/flip.c b/wrlib/flip.c
new file mode 100644
index 00000000..6801783c
--- /dev/null
+++ b/wrlib/flip.c
@@ -0,0 +1,133 @@
+/* flip.c - image flip
+ *
+ * Raster graphics library
+ *
+ * Copyright (c) 2014 Window Maker Team
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public
+ *  License along with this library; if not, write to the Free
+ *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *  MA 02110-1301, USA.
+ */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include "wraster.h"
+
+RImage *RVerticalFlipImage(RImage *image)
+{
+       RImage *img;
+       int nwidth, nheight;
+       int x, y;
+       int bpp = image->format == RRGBAFormat ? 4 : 3;
+
+       nwidth = image->width;
+       nheight = image->height;
+
+       img = RCreateImage(nwidth, nheight, True);
+       if (!img)
+               return NULL;
+
+       if (bpp == 3) {
+                       unsigned char *optr, *nptr;
+
+                       optr = image->data;
+                       nptr = img->data + 4 * (nwidth * nheight - nwidth - 1);
+
+                       for (y = 0; y < nheight; y++) {
+                               for (x = 0; x < nwidth; x++) {
+                                       nptr[0] = optr[0];
+                                       nptr[1] = optr[1];
+                                       nptr[2] = optr[2];
+                                       nptr[3] = 255;
+
+                                       optr += 3;
+                                       nptr += 4;
+                               }
+                               nptr -= nwidth*8;
+                       }
+               } else {
+                       unsigned char *optr, *nptr;
+
+                       optr = image->data;
+                       nptr = img->data + 4 * (nwidth * nheight - nwidth - 1);
+
+                       for (y = 0; y < nheight; y++) {
+                               for (x = 0; x < nwidth; x++) {
+                                       nptr[0] = optr[0];
+                                       nptr[1] = optr[1];
+                                       nptr[2] = optr[2];
+                                       nptr[3] = optr[3];
+
+                                       optr += 4;
+                                       nptr += 4;
+                               }
+                               nptr -= nwidth*8;
+                       }
+               }
+       return img;
+}
+
+RImage *RHorizontalFlipImage(RImage *image)
+{
+       RImage *img;
+       int nwidth, nheight;
+       int x, y;
+       int bpp = image->format == RRGBAFormat ? 4 : 3;
+
+       nwidth = image->width;
+       nheight = image->height;
+
+       img = RCreateImage(nwidth, nheight, True);
+       if (!img)
+               return NULL;
+
+       if (bpp == 3) {
+                       unsigned char *optr, *nptr;
+
+                       nptr = img->data + nwidth * nheight * 4 - 4;
+                       for (y = nheight; y; y--) {
+                               for (x = 0; x < nwidth; x++) {
+                                       optr = image->data + (y*nwidth + x) * 3;
+
+                                       nptr[0] = optr[0];
+                                       nptr[1] = optr[1];
+                                       nptr[2] = optr[2];
+                                       nptr[3] = 255;
+
+                                       nptr -= 4;
+                               }
+                       }
+               } else {
+                       unsigned char *optr, *nptr;
+
+                       nptr = img->data + nwidth * nheight * 4 - 4;
+                       for (y = nheight; y; y--) {
+                               for (x = 0; x < nwidth; x++) {
+                                       optr = image->data + (y*nwidth + x) * 4;
+
+                                       nptr[0] = optr[0];
+                                       nptr[1] = optr[1];
+                                       nptr[2] = optr[2];
+                                       nptr[3] = optr[3];
+
+                                       nptr -= 4;
+                               }
+                       }
+               }
+       return img;
+}
diff --git a/wrlib/libwraster.map b/wrlib/libwraster.map
index 062dcd95..cf364014 100644
--- a/wrlib/libwraster.map
+++ b/wrlib/libwraster.map
@@ -72,6 +72,8 @@ LIBWRASTER3
     RRetainImage;
     RRGBtoHSV;
     RRotateImage;
+    RVerticalFlipImage;
+    RHorizontalFlipImage;
     RSaveImage;
     RScaleImage;
     RShutdown;
diff --git a/wrlib/wraster.h b/wrlib/wraster.h
index 20038690..45cbcc6b 100644
--- a/wrlib/wraster.h
+++ b/wrlib/wraster.h
@@ -371,6 +371,9 @@ RImage *RSmoothScaleImage(RImage *src, unsigned new_width,
 
 RImage *RRotateImage(RImage *image, float angle);
 
+RImage *RVerticalFlipImage(RImage *image);
+
+RImage *RHorizontalFlipImage(RImage *image);
 
 RImage *RMakeTiledImage(RImage *tile, unsigned width, unsigned height);
 

-----------------------------------------------------------------------

Summary of changes:
 wrlib/rotate.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)


repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to [email protected].

Reply via email to