[Gimp-developer] SoC: only two weeks left - hurry!
MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.3 X-Originating-IP: 69.196.168.218 " But after this call destPR doesn't reflect the contents of tempPR. I think that the problem stems from the call to pixel_regions_register called from within copy_region. If the pixel region is initialized using pixel_region_init_data (like tempPR is) then the subsequent call to pixel_regions_register sets the data pointer to an incorrect location. Specifically, pixel_region_init_data sets tempPR->data to the allocated memory, but then pixel_region_register sets tempPR-> data to data + y*rowstride + x * bytes, which for this type of pixel region is an error. " I figure out that the problem was that I had to re-initialize the pixel region before using it again. Thanks to Pedro and especially to mitch for helping me along. Kevin ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
Re: [Gimp-developer] SoC: only two weeks left - hurry!
On Mon, 2006-08-07 at 22:31 +0200, Michael Schumacher wrote: > Show it! > Please add your code to Bugzilla and paste your URLs on IRC and on this developer mailing list! If your work has a UI, please upload screenshots on some public server and post links. If your work does some sort of image manipulation, post "before" and "after" images of its output. If your work generates files, please upload the files and describe them. Remember that the biggest part of your work (regardless of SoC) is passing public scrutiny. People who are looking forward to trying your work may request some changes to improve it. signature.asc Description: This is a digitally signed message part ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
[Gimp-developer] Gimp-developer] SoC: only two weeks left - hurry!
Hello everyone, Sorry if this gets posted twice but my mail to the list hasn't been getting posted. I still want to finish up the healing brush and I have everything in order except for one small problem. I'll try and be as precise as possible in describing it and hopefully I can get some help from the list. First, what I do is get the area under the cursor and store it in tempPR like this: < code snippet> /* Get the area underneath the cursor */ { GimpItem *item = GIMP_ITEM (drawable); TempBuf *orig; gint x1, x2, y1, y2; x1 = CLAMP (area->x, 0, gimp_item_width (item)); y1 = CLAMP (area->y, 0, gimp_item_height (item)); x2 = CLAMP (area->x + area->width, 0, gimp_item_width (item)); y2 = CLAMP (area->y + area->height, 0, gimp_item_height (item)); if (! (x2 - x1) || (! (y2 - y1))) return; orig = gimp_paint_core_get_orig_image (paint_core, drawable, x1, y1, x2, y2); pixel_region_init_temp_buf (&srcPR, orig, 0, 0, x2 - x1, y2 - y1); } /* copy the area to tempPR */ temp_data = g_malloc (srcPR.h * srcPR.bytes * srcPR.w); pixel_region_init_data (&tempPR, temp_data, srcPR.bytes, srcPR.bytes * srcPR.w, srcPR.x, srcPR.y, srcPR.w, srcPR.h); copy_region (&srcPR, &tempPR); < code snippet> Then I perform all of the calculations and store them back in tempPR. Then, I get the location where the destination pixels are like this: < code snippet> /* get the destination to paint to */ pixel_region_init_temp_buf (&destPR, area, 0, 0, srcPR.w, srcPR.h); < code snippet> And what I want to do is copy the data from tempPR into destPR like this: < code snippet> /* add an alpha region to the area if necessary */ if (! gimp_drawable_has_alpha (drawable)) { add_alpha_region (&tempPR, &destPR); } else { copy_region (&tempPR, &destPR); } < code snippet> But after this call destPR doesn't reflect the contents of tempPR. I think that the problem stems from the call to pixel_regions_register called from within copy_region. If the pixel region is initialized using pixel_region_init_data (like tempPR is) then the subsequent call to pixel_regions_register sets the data pointer to an incorrect location. Specifically, pixel_region_init_data sets tempPR->data to the allocated memory, but then pixel_region_register sets tempPR-> data to data + y*rowstride + x * bytes, which for this type of pixel region is an error. So, I guess my question is this: If I have some data in a pixel region that has been initialized using pixel_region_init_data, how can I copy that data into the destination canvas? Thanks a bunch, Kevin ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer
[Gimp-developer] SoC: only two weeks left - hurry!
Hi, there are only two weeks left now - the deadline is Aug 21. See http://code.google.com/soc/studentfaq.html#timeline for details. By now, everyone should have something to show (special thanks to Kevin Sookochef for adding his code to Bugzilla, despite not having passed the midterm evaluation). Show it! Show up in the IRC channel #gimp on irc.gimp.org (if your mail client does support IRC links, try irc://irc.gimp.org/#gimp) and tell everyone about your project. Get your code into CVS - it is easy to create branches, your mentor can assist if you don't dare to do this yourself. Provide screenshots, examples, demos - Pedro has already shown us some nice examples of the perspective cloning tool. More, please! Regards, Michael -- GIMP > http://www.gimp.org | IRC: irc://irc.gimp.org/gimp Wiki > http://wiki.gimp.org | .de: http://gimpforum.de Plug-ins > http://registry.gimp.org | ___ Gimp-developer mailing list Gimp-developer@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer