Commit 36926d47 authored by Claes Sjofors's avatar Claes Sjofors

Ge image, reset color tone didn't work

parent 6e56779c
......@@ -2812,6 +2812,14 @@ unsigned char *GlowDrawGtk::image_get_data( glow_tImImage image)
return (unsigned char *) gdk_pixbuf_get_pixels( (GdkPixbuf *)image);
}
void GlowDrawGtk::image_copy( glow_tImImage orig_image, glow_tImImage *image)
{
if ( *image)
gdk_pixbuf_unref( (GdkPixbuf *)*image);
*(GdkPixbuf **)image = gdk_pixbuf_copy( (GdkPixbuf *)orig_image);
}
void GlowDrawGtk::image_rotate( glow_tImImage *image, int to_rotation, int from_rotation)
{
#if GDK_PIXBUF_MAJOR == 2 && GDK_PIXBUF_MINOR < 8
......@@ -2899,8 +2907,9 @@ int GlowDrawGtk::image_load( char *imagefile,
return 0;
}
if ( im)
if ( im) {
*im = (glow_tImImage *) gdk_pixbuf_copy( (GdkPixbuf *)*orig_im);
}
return 1;
}
......
......@@ -201,6 +201,7 @@ class GlowDrawGtk : public GlowDraw {
int image_get_height( glow_tImImage image);
int image_get_rowstride( glow_tImImage image);
unsigned char *image_get_data( glow_tImImage image);
void image_copy( glow_tImImage orig_image, glow_tImImage *image);
void image_rotate( glow_tImImage *image, int to_rotation, int from_rotation);
void image_flip_vertical( glow_tImImage *image);
void image_flip_horizontal( glow_tImImage *image);
......
......@@ -151,6 +151,7 @@ class GlowDraw {
virtual int image_get_height( glow_tImImage image) {return 0;}
virtual int image_get_rowstride( glow_tImImage image) {return 0;}
virtual unsigned char *image_get_data( glow_tImImage image) {return 0;}
virtual void image_copy( glow_tImImage orig_image, glow_tImImage *image) {}
virtual void image_rotate( glow_tImImage *image, int to_rotation, int from_rotation) {}
virtual void image_flip_vertical( glow_tImImage *image) {}
virtual void image_flip_horizontal( glow_tImImage *image) {}
......
......@@ -198,6 +198,7 @@ int GrowImage::insert_image( const char *imagefile)
ctx->gdraw->image_load( filename, &original_image, &image);
if ( !original_image)
return 0;
current_width = int( ctx->mw.zoom_factor_x / ctx->mw.base_zoom_factor *
ctx->gdraw->image_get_width( image));
current_height = int( ctx->mw.zoom_factor_y / ctx->mw.base_zoom_factor *
......@@ -1219,6 +1220,9 @@ int GrowImage::set_image_color( glow_tImImage om, void *n)
c_color_shift || c_color_intensity || c_color_lightness || inverse) {
ctx->gdraw->image_pixel_iter( om, &image, pixel_cb, this);
}
else if ( image != om)
ctx->gdraw->image_copy( om, &image);
return 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment