Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWade Brainerd <wadetb@gmail.com>2008-05-19 07:44:59 (GMT)
committer Wade Brainerd <wadetb@gmail.com>2008-05-19 07:44:59 (GMT)
commit5a426437a6d6bb42ca781be2cb5efbcf279d19ef (patch)
treeaf06f86ae7fd2d9357879a47ddfa483e637eb844
parentb60bfd619cebda212385c397e9aad00e382a6a27 (diff)
Work on zooming & scrolling.
-rwxr-xr-x_colorsc.sobin620174 -> 630603 bytes
-rwxr-xr-xcolors.py85
-rw-r--r--colorsc.py1
-rw-r--r--src/canvas.h370
-rw-r--r--src/colorsc_wrap.cxx93
5 files changed, 448 insertions, 101 deletions
diff --git a/_colorsc.so b/_colorsc.so
index 38b30bb..34e029b 100755
--- a/_colorsc.so
+++ b/_colorsc.so
Binary files differ
diff --git a/colors.py b/colors.py
index 7830151..d0c6233 100755
--- a/colors.py
+++ b/colors.py
@@ -424,12 +424,12 @@ class Colors(activity.Activity, ExportedGObject):
self.palettebtn.set_tooltip(_("Palette"))
self.palettebtn.connect('clicked', self.on_palette)
- # todo- Color picker button, similar semantics to palette button.
+ # todo- Color picker button, similar semantics to scroll button.
- #self.zoomoutbtn = toolbutton.ToolButton('zoom-out')
- #self.zoomoutbtn.set_tooltip(_("Zoom Out"))
- #self.zoominbtn = toolbutton.ToolButton('zoom-in')
- #self.zoominbtn.set_tooltip(_("Zoom In"))
+ self.zoomoutbtn = toolbutton.ToolButton('zoom-out')
+ self.zoomoutbtn.set_tooltip(_("Zoom Out"))
+ self.zoominbtn = toolbutton.ToolButton('zoom-in')
+ self.zoominbtn.set_tooltip(_("Zoom In"))
self.refsep = gtk.SeparatorToolItem()
@@ -465,8 +465,8 @@ class Colors(activity.Activity, ExportedGObject):
paintbox = gtk.Toolbar()
paintbox.insert(self.palettebtn, -1)
- #paintbox.insert(self.zoomoutbtn, -1)
- #paintbox.insert(self.zoominbtn, -1)
+ paintbox.insert(self.zoomoutbtn, -1)
+ paintbox.insert(self.zoominbtn, -1)
paintbox.insert(self.refsep, -1)
paintbox.insert(self.takerefbtn, -1)
paintbox.insert(self.showrefbtn, -1)
@@ -831,7 +831,7 @@ class Colors(activity.Activity, ExportedGObject):
self.save_thumbnail(activity.get_bundle_path() + '/thumb.png')
# OLPC 'hand' buttons for scrolling.
- if event.keyval == ord('x') or event.keyval == 311 or event.keyval == 312 or event.keyval == ord('s'):
+ if event.keyval == ord('c') or event.keyval == 311 or event.keyval == 312 or event.keyval == ord('s'):
button = Colors.BUTTON_SCROLL
# OLPC 'size' buttons for intensity.
@@ -841,10 +841,10 @@ class Colors(activity.Activity, ExportedGObject):
#if event.keyval == 289: button = Colors.BUTTON_SIZE_3
# Arrow keys, gamepad 'face' buttons, or 'z' and 'x' for Zoom.
- #if event.keyval == ord('z') or event.keyval == 264 or event.keyval == 265 or event.keyval == 273:
- # button = Colors.BUTTON_ZOOM_IN
- #if event.keyval == ord('x') or event.keyval == 258 or event.keyval == 259 or event.keyval == 274:
- # button = Colors.BUTTON_ZOOM_OUT
+ if event.keyval == ord('z') or event.keyval == 264 or event.keyval == 265 or event.keyval == 273:
+ button = Colors.BUTTON_ZOOM_IN
+ if event.keyval == ord('x') or event.keyval == 258 or event.keyval == 259 or event.keyval == 274:
+ button = Colors.BUTTON_ZOOM_OUT
# Either Alt key for pick.
if event.keyval == 313 or event.keyval == 308:
@@ -937,7 +937,6 @@ class Colors(activity.Activity, ExportedGObject):
self.set_mode(Colors.MODE_REFERENCE)
return
if button & Colors.BUTTON_SCROLL:
- log.debug("enter scroll")
self.set_mode(Colors.MODE_SCROLL)
return
@@ -954,8 +953,7 @@ class Colors(activity.Activity, ExportedGObject):
def on_release (self, button):
if self.mode == Colors.MODE_SCROLL:
if button & Colors.BUTTON_SCROLL:
- log.debug("leave scroll")
- self.set_mode(Colors.MODE_SCROLL)
+ self.set_mode(Colors.MODE_CANVAS)
return
def on_hold (self, button):
@@ -974,10 +972,10 @@ class Colors(activity.Activity, ExportedGObject):
self.scroll = pos
# Clamp scroll position to within absolute limits.
- self.scroll.x = min(max(self.scroll.x, -self.easel.width * 0.125), self.easel.width * 0.125)
- self.scroll.y = min(max(self.scroll.y, -self.easel.height * 0.125), self.easel.height * 0.125)
+ self.scroll.x = min(max(self.scroll.x, -self.easel.width * 0.125), self.easel.width * 0.875)
+ self.scroll.y = min(max(self.scroll.y, -self.easel.height * 0.125), self.easel.height * 0.875)
- log.debug("scroll.x:%f scroll.y:%f" % (self.scroll.x, self.scroll.y))
+ log.debug("scroll: %f, %f" % (self.scroll.x, self.scroll.y))
def snap_scroll (self):
"""Animates the scroll position back towards reasonable bounds."""
@@ -990,11 +988,6 @@ class Colors(activity.Activity, ExportedGObject):
#-----------------------------------------------------------------------------------------------------------------
# Zoom code
- #
- # todo- Zooming is currently broken. It needs to be bound to a key and the issues need to be fixed.
- #
- # The main issue is probably that the underlying canvas doesn't support enough scaled blit options and also
- # doesn't support clipping.
def init_zoom (self):
self.zoom = 1.0
@@ -1006,27 +999,30 @@ class Colors(activity.Activity, ExportedGObject):
# Adjust scroll position to keep the same point centered on screen while the zoom changes.
# This is either the reference point (the center of the last stroke) or else the screen center.
- #if self.zoomref != None:
- # scrollcenter = self.zoomref
- #else:
- scrollcenter = self.scroll + Pos(self.width*0.5/self.zoom, self.height*0.5/self.zoom)
+ if self.zoomref != None:
+ scrollcenter = self.zoomref
+ else:
+ scrollcenter = self.scroll + Pos(self.width*0.5/self.zoom, self.height*0.5/self.zoom)
self.zoom = zoom
self.scroll_to(scrollcenter - Pos(self.width*0.5/self.zoom, self.height*0.5/self.zoom))
self.zoomref = None
+
+ log.debug('zoom %f', self.zoom)
+ self.flush_entire_canvas()
def zoom_in (self):
- if self.zoom == 0.75:
- self.zoom_to(1.0)
- self.scroll_to(Pos(0,0))
- elif self.zoom == 1.0:
+ #if self.zoom == 0.75:
+ # self.zoom_to(1.0)
+ # self.scroll_to(Pos(0,0))
+ if self.zoom == 1.0:
self.zoom_to(2.0)
def zoom_out (self):
if self.zoom == 2.0:
self.zoom_to(1.0)
self.scroll_to(Pos(0,0))
- elif self.zoom == 1.0:
- self.zoom_to(0.75)
+ #elif self.zoom == 1.0:
+ # self.zoom_to(0.75)
#-----------------------------------------------------------------------------------------------------------------
# Drawing commands
@@ -1037,7 +1033,7 @@ class Colors(activity.Activity, ExportedGObject):
# be played back.
def draw (self, pos):
- relpos = pos * Pos(self.easel.width, self.easel.height) / Pos(self.zoom, self.zoom) + self.scroll
+ relpos = pos * Pos(self.easel.width, self.easel.height) / Pos(self.zoom, self.zoom) - self.scroll
relpos = relpos / Pos(self.easel.width, self.easel.height)
self.easel.play_command(DrawCommand.create_draw(relpos, int(self.pressure)), True)
@@ -1289,7 +1285,7 @@ class Colors(activity.Activity, ExportedGObject):
move = mpos - self.scrollref
if move.x != 0 or move.y != 0:
self.scroll_to(self.scroll - move)
- #self.scrollref = mpos
+ self.scrollref = mpos
else:
self.scrollref = None
# Smoothly pull back towards the image when out of reasonable bounds.
@@ -1353,11 +1349,18 @@ class Colors(activity.Activity, ExportedGObject):
gc = self.easelarea.get_style().fg_gc[gtk.STATE_NORMAL]
# Blit dirty rectangle of canvas into the image.
- self.easel.blit_2x(
- self.easelimage,
- int(event.area.x/2), int(event.area.y/2), int(event.area.width/2), int(event.area.height/2),
- int(self.scroll.x), int(self.scroll.y),
- self.overlay_active)
+ if self.zoom == 1.0:
+ self.easel.blit_2x(
+ self.easelimage,
+ int(event.area.x), int(event.area.y), int(event.area.width), int(event.area.height),
+ int(-self.scroll.x), int(-self.scroll.y),
+ self.overlay_active)
+ elif self.zoom == 2.0:
+ self.easel.blit_4x(
+ self.easelimage,
+ int(event.area.x), int(event.area.y), int(event.area.width), int(event.area.height),
+ int(-self.scroll.x/2), int(-self.scroll.y/2),
+ self.overlay_active)
# Then draw the image to the screen.
self.easelarea.bin_window.draw_image(
@@ -1375,7 +1378,7 @@ class Colors(activity.Activity, ExportedGObject):
y = self.height-50-size[1]/pango.SCALE
self.easelarea.bin_window.draw_layout(gc, x, y, layout)
- self.draw_cursor()
+ #self.draw_cursor()
# Hack to keep toolbar up to date. For some reason it fails to draw pretty often.
#self.toolbox.queue_draw()
diff --git a/colorsc.py b/colorsc.py
index c28c15f..765f598 100644
--- a/colorsc.py
+++ b/colorsc.py
@@ -501,6 +501,7 @@ class Canvas(_object):
def get_num_commands(*args): return _colorsc.Canvas_get_num_commands(*args)
def play_range(*args): return _colorsc.Canvas_play_range(*args)
def blit_2x(*args): return _colorsc.Canvas_blit_2x(*args)
+ def blit_4x(*args): return _colorsc.Canvas_blit_4x(*args)
def downsize_video(*args): return _colorsc.Canvas_downsize_video(*args)
def videopaint_motion(*args): return _colorsc.Canvas_videopaint_motion(*args)
def blit_videopaint(*args): return _colorsc.Canvas_blit_videopaint(*args)
diff --git a/src/canvas.h b/src/canvas.h
index e221b39..6e80f3d 100644
--- a/src/canvas.h
+++ b/src/canvas.h
@@ -1033,87 +1033,337 @@ public:
unsigned short* pixels = (unsigned short*)img->mem;
int pitch = img->bpl/sizeof(unsigned short);
+ // Round to multiple of 2.
+ x &= ~1;
+ y &= ~1;
+ w = (w+1) & ~1;
+ h = (h+1) & ~1;
+
+ // Clip rectangle.
+ if (x < 0)
+ {
+ w += x;
+ x = 0;
+ }
+ if (y < 0)
+ {
+ h += y;
+ y = 0;
+ }
+ if (x+w > (width-1)*2)
+ w = (width-1)*2-x;
+ if (y+h > (height-1)*2)
+ h = (height-1)*2-y;
+
// Translate origin to output location.
- unsigned short* dest_pixels = pixels + y*pitch+x;
-
- int src_x = (x - scroll_x)/2;
- int src_y = (y - scroll_y)/2;
+ int src_x = (x - scroll_x);
+ int src_y = (y - scroll_y);
- if (src_x < 0) src_x = 0;
-
- while (src_y < 0)
+ int csy = src_y;
+ for (int cy = y; cy < y+h; cy += 2)
{
- unsigned short* __restrict row0 = dest_pixels;
- unsigned short* __restrict row1 = dest_pixels + pitch;
- dest_pixels += pitch*2;
- for (int cx = 0; cx < w; cx++)
+ unsigned short* __restrict row0 = &pixels[cy*pitch+x];
+ unsigned short* __restrict row1 = row0 + pitch;
+
+ if (csy < 0 || csy >= height)
+ {
+ for (int cx = 0; cx < w; cx += 2)
+ {
+ unsigned int rgb = 0;
+ row0[0] = rgb;
+ row0[1] = rgb;
+ row1[0] = rgb;
+ row1[1] = rgb;
+ row0 += 2;
+ row1 += 2;
+ }
+ }
+ else
{
- unsigned int rgb = 0;
- row0[0] = rgb;
- row0[1] = rgb;
- row1[0] = rgb;
- row1[1] = rgb;
- row0 += 2;
- row1 += 2;
+ unsigned int* __restrict src = &image[csy*width+src_x];
+
+ int cx = 0;
+ int csx = src_x;
+
+ while (csx < 0 && cx < w)
+ {
+ unsigned int rgb = 0;
+ row0[0] = rgb;
+ row0[1] = rgb;
+ row1[0] = rgb;
+ row1[1] = rgb;
+ row0 += 2;
+ row1 += 2;
+ src++;
+ csx++;
+ cx += 2;
+ }
+
+ if (overlay)
+ {
+ while (csx < width && cx < w)
+ {
+ unsigned int p = *src;
+ p &= ~0x03030303;
+ p >>= 2;
+ unsigned int r = (((p>>16)&0xff)>>3)<<11;
+ unsigned int g = (((p>> 8)&0xff)>>2)<<5;
+ unsigned int b = (((p>> 0)&0xff)>>3);
+ unsigned int rgb = r|g|b;
+ row0[0] = rgb;
+ row0[1] = rgb;
+ row1[0] = rgb;
+ row1[1] = rgb;
+ row0 += 2;
+ row1 += 2;
+ src++;
+ csx++;
+ cx += 2;
+ }
+ }
+ else
+ {
+ while (csx < width && cx < w)
+ {
+ unsigned int p = *src;
+ unsigned int r = (((p>>16)&0xff)>>3)<<11;
+ unsigned int g = (((p>> 8)&0xff)>>2)<<5;
+ unsigned int b = (((p>> 0)&0xff)>>3);
+ unsigned int rgb = r|g|b;
+ row0[0] = rgb;
+ row0[1] = rgb;
+ row1[0] = rgb;
+ row1[1] = rgb;
+ row0 += 2;
+ row1 += 2;
+ src++;
+ csx++;
+ cx += 2;
+ }
+ }
+
+ while (cx < w)
+ {
+ unsigned int rgb = 0;
+ row0[0] = rgb;
+ row0[1] = rgb;
+ row1[0] = rgb;
+ row1[1] = rgb;
+ row0 += 2;
+ row1 += 2;
+ src++;
+ csx++;
+ cx += 2;
+ }
}
- src_y++;
- h--;
+
+ csy++;
}
+ }
- unsigned int* src_pixels = &image[src_y*width+src_x];
+ void blit_4x(GdkImage* img, int x, int y, int w, int h, int scroll_x, int scroll_y, bool overlay)
+ {
+ unsigned short* pixels = (unsigned short*)img->mem;
+ int pitch = img->bpl/sizeof(unsigned short);
- for (int cy = 0; cy < h; cy++)
+ // Clip rectangle.
+ if (x < 0)
{
- unsigned int* __restrict src = src_pixels;
- unsigned short* __restrict row0 = dest_pixels;
- unsigned short* __restrict row1 = dest_pixels + pitch;
- src_pixels += width;
- dest_pixels += pitch*2;
- for (int cx = 0; cx < w; cx++)
- {
- unsigned int p = *src++;
- unsigned int r = (((p>>16)&0xff)>>3)<<11;
- unsigned int g = (((p>> 8)&0xff)>>2)<<5;
- unsigned int b = (((p>> 0)&0xff)>>3);
- unsigned int rgb = r|g|b;
- row0[0] = rgb;
- row0[1] = rgb;
- row1[0] = rgb;
- row1[1] = rgb;
- row0 += 2;
- row1 += 2;
- }
+ w += x;
+ x = 0;
}
-
-/*
- if (overlay)
+ if (y < 0)
+ {
+ h += y;
+ y = 0;
+ }
+
+ x &= ~3;
+ y &= ~3;
+ w = (w) & ~3;
+ h = (h) & ~3;
+
+ if (x+w > (width-7)*4)
+ w = (width-7)*4-x;
+ if (y+h > (height-7)*4)
+ h = (height-7)*4-y;
+
+ // Translate origin to output location.
+ int src_x = (x - scroll_x);
+ int src_y = (y - scroll_y);
+
+ int csy = src_y;
+ for (int cy = y; cy < y+h; cy += 4)
{
+ unsigned short* __restrict row0 = &pixels[cy*pitch+x];
+ unsigned short* __restrict row1 = row0 + pitch;
+ unsigned short* __restrict row2 = row1 + pitch;
+ unsigned short* __restrict row3 = row2 + pitch;
- for (int cy = 0; cy < h; cy++)
+ if (csy < 0 || csy >= height)
{
- unsigned int* __restrict src = &image[(y+cy)*width+x];
- unsigned short* __restrict row0 = &pixels[((y+cy)*2+0)*pitch+x*2];
- unsigned short* __restrict row1 = &pixels[((y+cy)*2+1)*pitch+x*2];
- for (int cx = 0; cx < w; cx++)
+ for (int cx = 0; cx < w; cx += 4)
{
- unsigned int p = *src++;
- p &= ~0x03030303;
- p >>= 2;
- unsigned int r = (((p>>16)&0xff)>>3)<<11;
- unsigned int g = (((p>> 8)&0xff)>>2)<<5;
- unsigned int b = (((p>> 0)&0xff)>>3);
- unsigned int rgb = r|g|b;
+ unsigned int rgb = 0;
row0[0] = rgb;
row0[1] = rgb;
+ row0[2] = rgb;
+ row0[3] = rgb;
row1[0] = rgb;
row1[1] = rgb;
- row0 += 2;
- row1 += 2;
+ row1[2] = rgb;
+ row1[3] = rgb;
+ row2[0] = rgb;
+ row2[1] = rgb;
+ row2[2] = rgb;
+ row2[3] = rgb;
+ row3[0] = rgb;
+ row3[1] = rgb;
+ row3[2] = rgb;
+ row3[3] = rgb;
+ row0 += 4;
+ row1 += 4;
+ row2 += 4;
+ row3 += 4;
}
}
+ else
+ {
+ unsigned int* __restrict src = &image[csy*width+src_x];
+
+ int cx = 0;
+ int csx = src_x;
+
+ while (csx < 0 && cx < w)
+ {
+ unsigned int rgb = 0;
+ row0[0] = rgb;
+ row0[1] = rgb;
+ row0[2] = rgb;
+ row0[3] = rgb;
+ row1[0] = rgb;
+ row1[1] = rgb;
+ row1[2] = rgb;
+ row1[3] = rgb;
+ row2[0] = rgb;
+ row2[1] = rgb;
+ row2[2] = rgb;
+ row2[3] = rgb;
+ row3[0] = rgb;
+ row3[1] = rgb;
+ row3[2] = rgb;
+ row3[3] = rgb;
+ row0 += 4;
+ row1 += 4;
+ row2 += 4;
+ row3 += 4;
+ src++;
+ csx++;
+ cx += 4;
+ }
+
+ if (overlay)
+ {
+ while (csx < width && cx < w)
+ {
+ unsigned int p = *src;
+ p &= ~0x03030303;
+ p >>= 2;
+ unsigned int r = (((p>>16)&0xff)>>3)<<11;
+ unsigned int g = (((p>> 8)&0xff)>>2)<<5;
+ unsigned int b = (((p>> 0)&0xff)>>3);
+ unsigned int rgb = r|g|b;
+ row0[0] = rgb;
+ row0[1] = rgb;
+ row0[2] = rgb;
+ row0[3] = rgb;
+ row1[0] = rgb;
+ row1[1] = rgb;
+ row1[2] = rgb;
+ row1[3] = rgb;
+ row2[0] = rgb;
+ row2[1] = rgb;
+ row2[2] = rgb;
+ row2[3] = rgb;
+ row3[0] = rgb;
+ row3[1] = rgb;
+ row3[2] = rgb;
+ row3[3] = rgb;
+ row0 += 4;
+ row1 += 4;
+ row2 += 4;
+ row3 += 4;
+ src++;
+ csx++;
+ cx += 4;
+ }
+ }
+ else
+ {
+ while (csx < width && cx < w)
+ {
+ unsigned int p = *src;
+ unsigned int r = (((p>>16)&0xff)>>3)<<11;
+ unsigned int g = (((p>> 8)&0xff)>>2)<<5;
+ unsigned int b = (((p>> 0)&0xff)>>3);
+ unsigned int rgb = r|g|b;
+ row0[0] = rgb;
+ row0[1] = rgb;
+ row0[2] = rgb;
+ row0[3] = rgb;
+ row1[0] = rgb;
+ row1[1] = rgb;
+ row1[2] = rgb;
+ row1[3] = rgb;
+ row2[0] = rgb;
+ row2[1] = rgb;
+ row2[2] = rgb;
+ row2[3] = rgb;
+ row3[0] = rgb;
+ row3[1] = rgb;
+ row3[2] = rgb;
+ row3[3] = rgb;
+ row0 += 4;
+ row1 += 4;
+ row2 += 4;
+ row3 += 4;
+ src++;
+ csx++;
+ cx += 4;
+ }
+ }
+
+ while (cx < w)
+ {
+ unsigned int rgb = 0;
+ row0[0] = rgb;
+ row0[1] = rgb;
+ row0[2] = rgb;
+ row0[3] = rgb;
+ row1[0] = rgb;
+ row1[1] = rgb;
+ row1[2] = rgb;
+ row1[3] = rgb;
+ row2[0] = rgb;
+ row2[1] = rgb;
+ row2[2] = rgb;
+ row2[3] = rgb;
+ row3[0] = rgb;
+ row3[1] = rgb;
+ row3[2] = rgb;
+ row3[3] = rgb;
+ row0 += 4;
+ row1 += 4;
+ row2 += 4;
+ row3 += 4;
+ src++;
+ csx++;
+ cx += 4;
+ }
+ }
+
+ csy++;
}
- else
- */
}
//---------------------------------------------------------------------------------------------
diff --git a/src/colorsc_wrap.cxx b/src/colorsc_wrap.cxx
index 6a3b4d2..20918af 100644
--- a/src/colorsc_wrap.cxx
+++ b/src/colorsc_wrap.cxx
@@ -9433,6 +9433,98 @@ fail:
}
+SWIGINTERN PyObject *_wrap_Canvas_blit_4x(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ Canvas *arg1 = (Canvas *) 0 ;
+ GdkImage *arg2 = (GdkImage *) 0 ;
+ int arg3 ;
+ int arg4 ;
+ int arg5 ;
+ int arg6 ;
+ int arg7 ;
+ int arg8 ;
+ bool arg9 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
+ int val5 ;
+ int ecode5 = 0 ;
+ int val6 ;
+ int ecode6 = 0 ;
+ int val7 ;
+ int ecode7 = 0 ;
+ int val8 ;
+ int ecode8 = 0 ;
+ bool val9 ;
+ int ecode9 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+ PyObject * obj5 = 0 ;
+ PyObject * obj6 = 0 ;
+ PyObject * obj7 = 0 ;
+ PyObject * obj8 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:Canvas_blit_4x",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Canvas, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Canvas_blit_4x" "', argument " "1"" of type '" "Canvas *""'");
+ }
+ arg1 = reinterpret_cast< Canvas * >(argp1);
+ {
+ // todo- Error checking would be nice.
+ PyGObject* pygo = (PyGObject*)obj1;
+ GdkImage* img = (GdkImage*)pygo->obj;
+ arg2 = img;
+ }
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Canvas_blit_4x" "', argument " "3"" of type '" "int""'");
+ }
+ arg3 = static_cast< int >(val3);
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Canvas_blit_4x" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = static_cast< int >(val4);
+ ecode5 = SWIG_AsVal_int(obj4, &val5);
+ if (!SWIG_IsOK(ecode5)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Canvas_blit_4x" "', argument " "5"" of type '" "int""'");
+ }
+ arg5 = static_cast< int >(val5);
+ ecode6 = SWIG_AsVal_int(obj5, &val6);
+ if (!SWIG_IsOK(ecode6)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Canvas_blit_4x" "', argument " "6"" of type '" "int""'");
+ }
+ arg6 = static_cast< int >(val6);
+ ecode7 = SWIG_AsVal_int(obj6, &val7);
+ if (!SWIG_IsOK(ecode7)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Canvas_blit_4x" "', argument " "7"" of type '" "int""'");
+ }
+ arg7 = static_cast< int >(val7);
+ ecode8 = SWIG_AsVal_int(obj7, &val8);
+ if (!SWIG_IsOK(ecode8)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Canvas_blit_4x" "', argument " "8"" of type '" "int""'");
+ }
+ arg8 = static_cast< int >(val8);
+ ecode9 = SWIG_AsVal_bool(obj8, &val9);
+ if (!SWIG_IsOK(ecode9)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Canvas_blit_4x" "', argument " "9"" of type '" "bool""'");
+ }
+ arg9 = static_cast< bool >(val9);
+ (arg1)->blit_4x(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_Canvas_downsize_video(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
Canvas *arg1 = (Canvas *) 0 ;
@@ -11506,6 +11598,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"Canvas_get_num_commands", _wrap_Canvas_get_num_commands, METH_VARARGS, NULL},
{ (char *)"Canvas_play_range", _wrap_Canvas_play_range, METH_VARARGS, NULL},
{ (char *)"Canvas_blit_2x", _wrap_Canvas_blit_2x, METH_VARARGS, NULL},
+ { (char *)"Canvas_blit_4x", _wrap_Canvas_blit_4x, METH_VARARGS, NULL},
{ (char *)"Canvas_downsize_video", _wrap_Canvas_downsize_video, METH_VARARGS, NULL},
{ (char *)"Canvas_videopaint_motion", _wrap_Canvas_videopaint_motion, METH_VARARGS, NULL},
{ (char *)"Canvas_blit_videopaint", _wrap_Canvas_blit_videopaint, METH_VARARGS, NULL},