repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: c0a427d0706c7f9700246e1f69582cb88906fd1c:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit c0a427d0706c7f9700246e1f69582cb88906fd1c
Author: Marc Lehmann 
Date:   Sun Jun 3 10:14:44 2012 +0000

    *** empty log message ***

diff --git a/src/Makefile.in b/src/Makefile.in
index 9b5953bd503fe91444e07efb568d9cff1e878e9d..
index ..70d4732e1c0963c8be14e22fd86e3292235eded4 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -125,13 +125,13 @@ depend:
 background.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 background.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h
 background.o: ev_cpp.h ../config.h ../libev/ev++.h ../libev/ev.h callback.h
-background.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h
-background.o: rsinc.h optinc.h
+background.o: rxvtimg.h scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h
+background.o: hookinc.h rsinc.h optinc.h
 command.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 command.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h
 command.o: ev_cpp.h ../config.h ../libev/ev++.h ../libev/ev.h callback.h
-command.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h
-command.o: rsinc.h optinc.h version.h command.h keyboard.h
+command.o: rxvtimg.h scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h
+command.o: hookinc.h rsinc.h optinc.h version.h command.h keyboard.h
 encoding.o: ../config.h encoding.h rxvtutil.h ../libptytty/src/ecb.h
 encoding.o: ../libptytty/src/estl.h table/iso8859_1.h table/iso8859_15.h
 encoding.o: table/iso8859_2.h table/iso8859_3.h table/iso8859_4.h
@@ -155,101 +155,108 @@ fdpass_wrapper.o: ../libptytty/src/libptytty.h
 fifo.o: emman.h fifo.h ../libptytty/src/ecb.h
 init.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 init.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h ev_cpp.h
-init.o: ../config.h ../libev/ev++.h ../libev/ev.h callback.h scrollbar.h
-init.o: ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h optinc.h
-init.o: init.h keyboard.h
+init.o: ../config.h ../libev/ev++.h ../libev/ev.h callback.h rxvtimg.h
+init.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h
+init.o: optinc.h init.h keyboard.h
 keyboard.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 keyboard.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h
 keyboard.o: ev_cpp.h ../config.h ../libev/ev++.h ../libev/ev.h callback.h
-keyboard.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h
-keyboard.o: rsinc.h optinc.h keyboard.h
+keyboard.o: rxvtimg.h scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h
+keyboard.o: hookinc.h rsinc.h optinc.h keyboard.h
 main.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 main.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h ev_cpp.h
-main.o: ../config.h ../libev/ev++.h ../libev/ev.h callback.h scrollbar.h
-main.o: ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h optinc.h
-main.o: init.h keyboard.h
+main.o: ../config.h ../libev/ev++.h ../libev/ev.h callback.h rxvtimg.h
+main.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h
+main.o: optinc.h init.h keyboard.h
 misc.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 misc.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h ev_cpp.h
-misc.o: ../config.h ../libev/ev++.h ../libev/ev.h callback.h scrollbar.h
-misc.o: ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h optinc.h
+misc.o: ../config.h ../libev/ev++.h ../libev/ev.h callback.h rxvtimg.h
+misc.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h
+misc.o: optinc.h
 ptytty_wrapper.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h
 ptytty_wrapper.o: encoding.h rxvtutil.h ../libptytty/src/estl.h rxvtfont.h
 ptytty_wrapper.o: rxvttoolkit.h ev_cpp.h ../libev/ev++.h ../libev/ev.h
-ptytty_wrapper.o: callback.h scrollbar.h ../libptytty/src/libptytty.h
-ptytty_wrapper.o: rxvtperl.h hookinc.h rsinc.h optinc.h
-ptytty_wrapper.o: ../libptytty/src/logging.C ../libptytty/src/ptytty.h
-ptytty_wrapper.o: ../libptytty/src/ptytty_conf.h ../libptytty/src/proxy.C
-ptytty_wrapper.o: ../libptytty/src/ptytty.C
+ptytty_wrapper.o: callback.h rxvtimg.h scrollbar.h
+ptytty_wrapper.o: ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h
+ptytty_wrapper.o: optinc.h ../libptytty/src/logging.C
+ptytty_wrapper.o: ../libptytty/src/ptytty.h ../libptytty/src/ptytty_conf.h
+ptytty_wrapper.o: ../libptytty/src/proxy.C ../libptytty/src/ptytty.C
 rxvt.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 rxvt.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h ev_cpp.h
-rxvt.o: ../config.h ../libev/ev++.h ../libev/ev.h callback.h scrollbar.h
-rxvt.o: ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h optinc.h
+rxvt.o: ../config.h ../libev/ev++.h ../libev/ev.h callback.h rxvtimg.h
+rxvt.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h
+rxvt.o: optinc.h
 rxvtc.o: ../config.h rxvtdaemon.h rxvtutil.h ../libptytty/src/ecb.h
 rxvtc.o: ../libptytty/src/estl.h ../libptytty/src/libptytty.h
 rxvtd.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 rxvtd.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h ev_cpp.h
-rxvtd.o: ../config.h ../libev/ev++.h ../libev/ev.h callback.h scrollbar.h
-rxvtd.o: ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h optinc.h
-rxvtd.o: rxvtdaemon.h
+rxvtd.o: ../config.h ../libev/ev++.h ../libev/ev.h callback.h rxvtimg.h
+rxvtd.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h
+rxvtd.o: rsinc.h optinc.h rxvtdaemon.h
 rxvtdaemon.o: rxvtdaemon.h rxvtutil.h ../libptytty/src/ecb.h
 rxvtdaemon.o: ../libptytty/src/estl.h
 rxvtfont.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 rxvtfont.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h
 rxvtfont.o: ev_cpp.h ../config.h ../libev/ev++.h ../libev/ev.h callback.h
-rxvtfont.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h
-rxvtfont.o: rsinc.h optinc.h table/linedraw.h
+rxvtfont.o: rxvtimg.h scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h
+rxvtfont.o: hookinc.h rsinc.h optinc.h table/linedraw.h
 rxvtimg.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 rxvtimg.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h
 rxvtimg.o: ev_cpp.h ../config.h ../libev/ev++.h ../libev/ev.h callback.h
-rxvtimg.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h
-rxvtimg.o: rsinc.h optinc.h
+rxvtimg.o: rxvtimg.h scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h
+rxvtimg.o: hookinc.h rsinc.h optinc.h
+rxvtperl.o: ../config.h ev_cpp.h ../config.h ../libev/ev++.h ../libev/ev.h
+rxvtperl.o: rxvt.h feature.h ../libptytty/src/ecb.h encoding.h rxvtutil.h
+rxvtperl.o: ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h callback.h
+rxvtperl.o: rxvtimg.h scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h
+rxvtperl.o: hookinc.h rsinc.h optinc.h keyboard.h perlxsi.c iom_perl.h
 rxvttoolkit.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 rxvttoolkit.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h
 rxvttoolkit.o: ev_cpp.h ../config.h ../libev/ev++.h ../libev/ev.h callback.h
-rxvttoolkit.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h
-rxvttoolkit.o: rsinc.h optinc.h
+rxvttoolkit.o: rxvtimg.h scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h
+rxvttoolkit.o: hookinc.h rsinc.h optinc.h
 rxvtutil.o: rxvtutil.h ../libptytty/src/ecb.h ../libptytty/src/estl.h
 screen.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 screen.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h
 screen.o: ev_cpp.h ../config.h ../libev/ev++.h ../libev/ev.h callback.h
-screen.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h
-screen.o: rsinc.h optinc.h
+screen.o: rxvtimg.h scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h
+screen.o: hookinc.h rsinc.h optinc.h
 scrollbar-next.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h
 scrollbar-next.o: encoding.h rxvtutil.h ../libptytty/src/estl.h rxvtfont.h
 scrollbar-next.o: rxvttoolkit.h ev_cpp.h ../config.h ../libev/ev++.h
-scrollbar-next.o: ../libev/ev.h callback.h scrollbar.h
+scrollbar-next.o: ../libev/ev.h callback.h rxvtimg.h scrollbar.h
 scrollbar-next.o: ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h
 scrollbar-next.o: optinc.h
 scrollbar-plain.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h
 scrollbar-plain.o: encoding.h rxvtutil.h ../libptytty/src/estl.h rxvtfont.h
 scrollbar-plain.o: rxvttoolkit.h ev_cpp.h ../config.h ../libev/ev++.h
-scrollbar-plain.o: ../libev/ev.h callback.h scrollbar.h
+scrollbar-plain.o: ../libev/ev.h callback.h rxvtimg.h scrollbar.h
 scrollbar-plain.o: ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h
 scrollbar-plain.o: optinc.h
 scrollbar-rxvt.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h
 scrollbar-rxvt.o: encoding.h rxvtutil.h ../libptytty/src/estl.h rxvtfont.h
 scrollbar-rxvt.o: rxvttoolkit.h ev_cpp.h ../config.h ../libev/ev++.h
-scrollbar-rxvt.o: ../libev/ev.h callback.h scrollbar.h
+scrollbar-rxvt.o: ../libev/ev.h callback.h rxvtimg.h scrollbar.h
 scrollbar-rxvt.o: ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h
 scrollbar-rxvt.o: optinc.h
 scrollbar-xterm.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h
 scrollbar-xterm.o: encoding.h rxvtutil.h ../libptytty/src/estl.h rxvtfont.h
 scrollbar-xterm.o: rxvttoolkit.h ev_cpp.h ../config.h ../libev/ev++.h
-scrollbar-xterm.o: ../libev/ev.h callback.h scrollbar.h
+scrollbar-xterm.o: ../libev/ev.h callback.h rxvtimg.h scrollbar.h
 scrollbar-xterm.o: ../libptytty/src/libptytty.h rxvtperl.h hookinc.h rsinc.h
 scrollbar-xterm.o: optinc.h
 scrollbar.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 scrollbar.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h
 scrollbar.o: ev_cpp.h ../config.h ../libev/ev++.h ../libev/ev.h callback.h
-scrollbar.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h
-scrollbar.o: rsinc.h optinc.h
+scrollbar.o: rxvtimg.h scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h
+scrollbar.o: hookinc.h rsinc.h optinc.h
 xdefaults.o: ../config.h rxvt.h feature.h ../libptytty/src/ecb.h encoding.h
 xdefaults.o: rxvtutil.h ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h
 xdefaults.o: ev_cpp.h ../config.h ../libev/ev++.h ../libev/ev.h callback.h
-xdefaults.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h
-xdefaults.o: rsinc.h optinc.h version.h keyboard.h
+xdefaults.o: rxvtimg.h scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h
+xdefaults.o: hookinc.h rsinc.h optinc.h version.h keyboard.h
 rxvtperl.o: ../config.h ev_cpp.h ../config.h ../libev/ev++.h ../libev/ev.h
 rxvtperl.o: rxvt.h feature.h ../libptytty/src/ecb.h encoding.h rxvtutil.h
 rxvtperl.o: ../libptytty/src/estl.h rxvtfont.h rxvttoolkit.h callback.h
-rxvtperl.o: scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h hookinc.h
-rxvtperl.o: rsinc.h optinc.h keyboard.h iom_perl.h
+rxvtperl.o: rxvtimg.h scrollbar.h ../libptytty/src/libptytty.h rxvtperl.h
+rxvtperl.o: hookinc.h rsinc.h optinc.h keyboard.h perlxsi.c iom_perl.h
diff --git a/src/rxvt.h b/src/rxvt.h
index fab8f362ed8c0fdf193c1e6eba1dd5b9718394df..
index ..557d20dbd0c4688f731c711d0972bb4be72ce889 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -85,6 +85,7 @@ typedef  int32_t tlen_t_; // specifically for use in the line_t structure
 #include "rxvtutil.h"
 #include "rxvtfont.h"
 #include "rxvttoolkit.h"
+#include "rxvtimg.h"
 #include "scrollbar.h"
 #include "ev_cpp.h"
 #include "libptytty.h"
diff --git a/src/rxvtimg.C b/src/rxvtimg.C
index 650f47ab5c72c85a25f11793972a7d894a2d84be..
index ..2d5cfb2ac772a09d9487143187e6449a0980def7 100644
--- a/src/rxvtimg.C
+++ b/src/rxvtimg.C
@@ -3,14 +3,14 @@

 #if HAVE_IMG

-rxvt_img::rxvt_img (rxvt_screen *screen, Pixmap *pm, XRenderPictFormat *format, int width, int height)
-: s(screen), pm(pixmap) w(width), h(height), format(format)
+rxvt_img::rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height)
+: s(screen), w(width), h(height), format(format)
 {
+  pm = XCreatePixmap (s->display->dpy, s->display->root, w, h, format->depth);
 }

-rxvt_img::rxvt_img (rxvt_screen *screen, GdkPixbuf *pixbuf,
-          int x, int y, int width, int height)
-: s(screen), w(width), h(height)
+rxvt_img::rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap)
+: s(screen), pm(pixmap), w(width), h(height), format(format)
 {
 }

@@ -27,14 +27,56 @@ rxvt_img::fill (const rxvt_color &c)
   gcv.foreground = c;
   GC gc = XCreateGC (s->display->dpy, pm, GCForeground, &gcv);
   XFillRectangle (s->display->dpy, pm, gc, 0, 0, w, h);
+  XFreeGC (s->display->dpy, gc);
 }

-rxvt_img *copy ()
+void
+rxvt_img::blur (int rh, int rv)
+{
+  //TODO
+}
+
+void
+rxvt_img::brightness (double r, double g, double b, double a)
+{
+  //TODO
+}
+
+void
+rxvt_img::contrast (double r, double g, double b, double a)
 {
-  Pixmap pm2 = XCreatePixmap (s->display->dpy, pm, w, h, depth);
-  XCopyArea (s->display->dpy, pm, pm2, 0, 0, w, h, 0, 0);
-  return new rxvt_img (s, pm2, format, w, h);
+  //TODO
 }

+void
+rxvt_img::render (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y)
+{
+  //TODO
+}
+
+rxvt_img *
+rxvt_img::copy ()
+{
+  GC gc = XCreateGC (s->display->dpy, pm, 0, 0);
+  Pixmap pm2 = XCreatePixmap (s->display->dpy, pm, w, h, format->depth);
+  XCopyArea (s->display->dpy, pm, pm2, gc, 0, 0, w, h, 0, 0);
+  XFreeGC (s->display->dpy, gc);
+  return new rxvt_img (s, format, w, h, pm2);
+}
+
+rxvt_img *
+rxvt_img::transform (int new_width, int new_height, double matrix[16])
+{
+  //TODO
+}
+
+rxvt_img *
+rxvt_img::scale (int new_width, int new_height)
+{
+  // use transform
+  //TODO
+}
+
+
 #endif

diff --git a/src/rxvtimg.h b/src/rxvtimg.h
index d59f37642b35144d23ac9c23e132df7401d60af4..
index ..367a85b8cd53b928402b48c01d961ffc7db83fca 100644
--- a/src/rxvtimg.h
+++ b/src/rxvtimg.h
@@ -17,11 +17,9 @@ struct rxvt_img
   XRenderPictFormat *format;

   rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height);
-  rxvt_img (rxvt_screen *screen, Pixmap *pixmap, XRenderPictFormat *format, int width, int height);
+  rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap);
   ~rxvt_img ();

-  void render (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y);
-
   Pixmap steal ()
   {
     Pixmap res = pm;
@@ -34,6 +32,7 @@ struct rxvt_img
   void blur (int rh, int rv);
   void brightness (double r, double g, double b, double a = 1.);
   void contrast (double r, double g, double b, double a = 1.);
+  void render (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y);

   // copy
   rxvt_img *copy ();

-----END OF PAGE-----