clipping rect, but highly suboptimally (I'm not doing proper polygon
clipping here yet, just clipping slowly on each point drawn - really nasty).
There are probably some rounding errors in here. I need to work more on
this, but I have *so* little time for the next few weeks.
Please don't kill me for this code. It's not finished, but I'm about to move
house, and I have to get something working before I pack my PC away.
SVN revision: 3303
Hard to come up with a nice API for this, but here's what I have:
ImlibPolygon imlib_polygon_new(int type);
void imlib_polygon_free(ImlibPolygon poly);
void imlib_polygon_add_point(ImlibPolygon poly, int x, int y);
void imlib_image_draw_polygon(ImlibPolygon poly);
Clipping works with these, as demonstrated by test/imlib2
The type paramter may be: POLY_OPEN, POLY_CLOSED or POLY_FILLED (last one
not implemented yet).
I was wondering if draw_polygon should genererate updates, like draw_line.
Thoughts?
SVN revision: 3279
Removed all the _clipped functions.
Added imlib_context_set_cliprect(int x, int y, int w, int h) and a
corresponding _get_cliprect.
Set width to 0 to disable clipping (default).
Just use the normal _draw_ functions and it'll do the Right thing.
SVN revision: 3278
Sometimes it's handy to work out where your line was/would be drawn.
int
imlib_clip_line(int x0, int y0, int x1, int y1, int xmin, int xmax, int ymin,
int ymax, int *clip_x0, int *clip_y0, int *clip_x1,
int *clip_y1);
SVN revision: 3277
void
imlib_image_draw_rectangle_clipped(int x, int y, int width, int height,
int clip_xmin, int clip_xmax, int clip_ymin,
int clip_ymax);
Works well. If you make install then cd test, make, ./imlib2, you'll see the
demo/test of the clipping code.
Next up: draw_polygon and draw_polygon_clipped.
Then (eeek) fill_polygon, fill_polygon_clipped, and some clipping for image
blending (fun).
SVN revision: 3276
Same as _draw_line but with extra parameters for the clipping region.
Tested and seems to work well. Will check further tomorrow when I convert
geist to use this instead of doing it internally.
Imlib_Updates
imlib_image_draw_line_clipped(int x1, int y1, int x2, int y2,
int clip_xmin, int clip_xmax, int clip_ymin,
int clip_ymax, char make_updates);
SVN revision: 3273
Reversed that change, as it caused segfaults in free().
I can't grok this code, so I'll leave it to raster.
Basically, if my code calls imlib_free_image_and_decache(), it doesn't free
the image, and it leaks.
The fix I applied made sure _Imlib_ConsumeImage was called, but this caused
a segfault.
*baffle
SVN revision: 3239
right fix here. Basically, the imlib_free_image_and_decache() call in api.c
sets the flag F_INVALID then calls the internal __ImlibFreeImage(), this
checks if the flag F_UNCACHEABLE is set, and only frees it if so.
So the image never got free()d. I have changed the
imlib_free_image_and_decache() to set the F_UNCACHEABLE flag *as well* as
F_INVALID. I hope that's the correct fix. raster?
SVN revision: 3238
(KainX)
It's generally a good idea to increment the reference count when you
implement reference counting. This should fix the mysterious problems
people have been having with Imlib2 stealing pixmaps out from under
Eterm.
SVN revision: 2916
of them should include Imlib2.h. In fact, nothing in the Imlib2 code
should, but if it's absolutely necessary, make sure the local one is found
before the system-wide one.
SVN revision: 2915
with it, because of licensing issues. I guess I'll be talking to Raster
next week what we'll do with the loader. Hope this makes us friends
with the Gimp developers again.
SVN revision: 2888
opacity, layer masks, and merging layers in the default mode
(simply "looking" through all the layers). The other layer modes
are missing right now (I hardly ever use anything other than "Normal"
anyway, but that's just me of course).
If you load an image as /path/to/file:<layer number> only the
specified layer is displayed, at the defined offset in the image.
Try this with imlib2_view since it ignores file loading errors.
Passing parameters to the loader will have to be handled better
(or did I miss someting?) but the loader can basically return
layers selectively.
SVN revision: 2847