FS#8308 - Port of a imlib2 based smooth scaling algorithm for bitmaps.
This patch will add support for smooth scaling of bitmaps based on a imlib2
algorithm. The main code is placed under bmp_smooth_scale.c and made visible
via bmp.h.
It is a drop-in replacement for the just introduced “simple_resize_bitmap”:
int smooth_resize_bitmap(struct bitmap *src, struct bitmap *dst);
The algorithm performs a bilinear scaling with different code-pathes, depending
on scaling directions (up or down) as well as scaling down only horizontally or
vertically. Currently the maximum source size is LCD_WIDTHxLCD_HEIGHT, due to
static allocation of some lookup tables.
The patch also renames the plugin based test case from resize_test.c to
test_resize.c, to make it consistent with the other tests and adds it to the
apps CATEGORIES (you still have to add it to SOURCES). The test expects a
bitmap “/test.bmp” for now (which can be up to 200x200px).
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
Is this meant be an alternative to the bmp_resize patch? Also, what’s do you mean with the “just introduced simple_resize_bitmap”?
This scaling algorithm can be used on runtime, not on load-time of a
bmp file, so it can be used dynamically (e.g. image viewer).
It also gives a much higher quality due to the bilinear interpolation.
But it is clearly related to the bmp_resize patch and open for further
discussion.
As for “just introduced simple_resize_bitmap” see r15913, the nearest
neighbour algorithm is in SVN now.
If we want to use this patch do we need to also apply the bmp-resize patch and then this patch or just use this patch instead of the bmp-resize patch?
jac0b: It’s a bit more complicated than that. This patch isn’t designed the same way as
FS#5697. Making use of the functionality provided by this patch requires code changes, not just applying patches.I updated the patch. Now the algorithm does not need look-up tables anymore
and hence there is no need for static allocations.
How do you change the picture height and width?
Sync. I also included a change to the slide puzzle plugin to make it use the smooth resize. Apply with -p1.
I’m easily confused, so bear with me. Is this latest “smooth_resize.patch” posted by nicolas_p a new version of the original patch on this tracker page (port of a imlib2-based…)? Or is it instead of the smooth resize patch in
FS#5697?The patch I posted here is an updated version of the original one from this task.