Skip to content

Commit

Permalink
Add a few comments to make it clearer what the source and destination…
Browse files Browse the repository at this point in the history
… are when copying pixels
  • Loading branch information
lmanul committed Aug 22, 2024
1 parent 622c0c3 commit 492d433
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,11 @@ gint32 render(gint32 image_ID,
////////////////// /////////////////

// Retrieve the initial image into the patch.
// patch = destination buffer, rgn_in = source
gimp_pixel_rgn_get_rect (&rgn_in, patch, 0, 0, width_p, height_p);

// Then paste a first patch at position (0,0) of the out image.
// patch = source buffer, rgn_out = destination
gimp_pixel_rgn_set_rect (&rgn_out, patch, 0, 0, width_p, height_p);

// And declare we have already filled in the corresponding pixels.
Expand All @@ -174,6 +176,7 @@ gint32 render(gint32 image_ID,
}

// Retrieve all of the current image into image.
// image = destination buffer, rgn_out = source
gimp_pixel_rgn_get_rect (&rgn_out, image, 0, 0, width_i, height_i);


Expand Down Expand Up @@ -228,6 +231,7 @@ gint32 render(gint32 image_ID,
////////////////////// Last clean up /////////////////////
////////////////////// /////////////////////

// image = source buffer, rgn_out = destination
gimp_pixel_rgn_set_rect(&rgn_out, image, 0, 0, width_i, height_i);

gimp_drawable_flush(new_drawable);
Expand Down

0 comments on commit 492d433

Please sign in to comment.