[Gimp-developer] [Plugin-Development-C] Naive question : accessing "flattened" image pixels



Hi,

this will probably seem like a silly question...
I have been working on an animation plug-in for GIMP as a pet project, and
I have been hitting a wall.
The plugin has a complex dialog with a preview window and playback controls
and whatnot.
The preview works ok when each layer of the image is used as a frame in the
animation.
I am using gimp_pixel_rgn_xxx functions to retrieve layers content, and
blit them to my preview area : fine.

Now what I want to do is to have a "sprite sheet" mode, where an animation
frame is a portion of the full image, however that image might be arranged
in terms of layers. So basically, I want to be able to retrieve a pixel
region of the current view of the image (fully flattened, with proper blend
modes, not showing hidden layers, (at a given zoom factor?)).
Problem is, pixel regions work at the drawable level, and a full image is
not a drawable.
I looked at the API reference for hours to no avail.
Other plugins tend to work at the drawable level too.

The native animation playback plugin works by creating a dummy image and
duplicating/merging layers from the source image based on the animation
compositing policy, but that seems a little overkill (and might not handle
layer blend modes properly).
I want the preview to be updated when the image is modified, trashing and
creating a flattened version of the full image on each alteration of the
source image seems prohibitive, but might be a good approach...

I pondered using the thumbnail API, but it seems to be limited to 1024x1024
max size, and feels like a convoluted way of doing this.

What API nugget am I missing? What would be the best approach to do this?

Cheers,


A pondering maniac.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]