Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void
- scanline_calculate_result(gint32 image_ID, gdouble* scanline) {
- gint32 active_drawable;
- GimpDrawable* active_drawable_pt;
- GimpPixelRgn pr;
- gint w,h;
- struct scanline sline;
- active_drawable=gimp_image_get_active_drawable(image_ID);
- active_drawable_pt = gimp_drawable_get(active_drawable);
- w = gimp_drawable_width(active_drawable);
- h = gimp_drawable_height(active_drawable);
- gimp_pixel_rgn_init(&pr,
- active_drawable_pt,
- 0,
- 0,
- w,
- h,
- FALSE,
- FALSE);
- guchar *buf = malloc(w*h*4);
- gimp_pixel_rgn_get_rect(&pr, buf,0,0,w,h);
- /* manipulate buf as a bitmap of size wxh */
- /* here depending on the image used, i get different results */
- gimp_drawable_detach(active_drawable_pt);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement