Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category LCD
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Daily build (which?)
  • Due in Version Undecided
  • Due Date Undecided
  • Votes 1
  • Private
Attached to Project: Rockbox
Opened by Jonas Hurrelmann - 2007-12-12
Last edited by Nicolas Pennequin - 2008-04-06

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).

Closed by  Nicolas Pennequin
2008-04-06 22:31
Reason for closing:  Accepted
Thomas Martitz commented on 2007-12-12 14:00

Is this meant be an alternative to the bmp_resize patch? Also, what’s do you mean with the “just introduced simple_resize_bitmap”?

Jonas Hurrelmann commented on 2007-12-12 14:11

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.

Jacob Brooks commented on 2007-12-13 13:23

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?

Nicolas Pennequin commented on 2007-12-13 13:28

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.

Jonas Hurrelmann commented on 2007-12-13 17:46

I updated the patch. Now the algorithm does not need look-up tables anymore
and hence there is no need for static allocations.

Jacob Brooks commented on 2008-01-14 17:32

How do you change the picture height and width?

Nicolas Pennequin commented on 2008-01-26 01:40

Sync. I also included a change to the slide puzzle plugin to make it use the smooth resize. Apply with -p1.

David Maliniak commented on 2008-02-05 02:16

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 ?

Nicolas Pennequin commented on 2008-02-05 13:50

The patch I posted here is an updated version of the original one from this task.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing