Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index 7d48be6..100b874 100644 @@ -151,3 +151,4 @@ superdom.c #endif /* m:robe 500 */ md5sum.c +test_greylib_bitmap_scale.c diff --git a/apps/recorder/resize.c b/apps/recorder/resize.c index 99ccc84..79e19d4 100644 */ int recalc_dimension(struct dim *dst, struct dim *src) { + /* This only looks backwards. The input image size is being pre-scaled by + * the inverse of the pixel aspect ratio, so that once the size it scaled + * to meet the output constraints, the scaled image will have appropriate + * proportions. + */ + int sw = src->width * LCD_PIXEL_ASPECT_HEIGHT; + int sh = src->height * LCD_PIXEL_ASPECT_WIDTH; int tmp; if (dst->width <= 0) dst->width = LCD_WIDTH; if (dst->height <= 0) dst->height = LCD_HEIGHT; #ifndef HAVE_UPSCALER - if (dst->width > src->width || dst->height > src->height) + if (dst->width > sw || dst->height > sh) { - dst->width = src->width; - dst->height = src->height; + dst->width = sw; + dst->height = sh; } - if (src->width == dst->width && src->height == dst->height) + if (sw == dst->width && sh == dst->height) return 1; #endif - tmp = (src->width * dst->height + (src->height >> 1)) / src->height; + tmp = (sw * dst->height + (sh >> 1)) / sh; if (tmp > dst->width) - dst->height = (src->height * dst->width + (src->width >> 1)) - / src->width; + dst->height = (sh * dst->width + (sw >> 1)) / sw; else dst->width = tmp; return src->width == dst->width && src->height == dst->height; diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h index 50cee2b..da281bd 100644 #define LCD_HEIGHT 64 #define LCD_DEPTH 1 +#define LCD_PIXEL_ASPECT_WIDTH 4 +#define LCD_PIXEL_ASPECT_HEIGHT 5 + #define LCD_PIXELFORMAT VERTICAL_PACKING /* define this if you have a Recorder style 10-key keyboard */ diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h index 8233728..1b3b266 100644 #define LCD_HEIGHT 64 #define LCD_DEPTH 1 +#define LCD_PIXEL_ASPECT_WIDTH 4 +#define LCD_PIXEL_ASPECT_HEIGHT 5 + #define LCD_PIXELFORMAT VERTICAL_PACKING /* define this if you have an Ondio style 6-key keyboard */ diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h index 5fb7806..85065f4 100644 #define LCD_HEIGHT 64 #define LCD_DEPTH 1 +#define LCD_PIXEL_ASPECT_WIDTH 4 +#define LCD_PIXEL_ASPECT_HEIGHT 5 + #define LCD_PIXELFORMAT VERTICAL_PACKING /* define this if you have an Ondio style 6-key keyboard */ diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h index 75aa2cf..ff74eef 100644 #define LCD_HEIGHT 64 #define LCD_DEPTH 1 +#define LCD_PIXEL_ASPECT_WIDTH 4 +#define LCD_PIXEL_ASPECT_HEIGHT 5 + #define LCD_PIXELFORMAT VERTICAL_PACKING /* define this if you have the Recorder's 10-key keyboard */ diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h index 3244f19..4e77e3d 100644 #define LCD_HEIGHT 64 #define LCD_DEPTH 1 +#define LCD_PIXEL_ASPECT_WIDTH 4 +#define LCD_PIXEL_ASPECT_HEIGHT 5 + #define LCD_PIXELFORMAT VERTICAL_PACKING /* define this if you have a Recorder style 10-key keyboard */ diff --git a/firmware/export/config.h b/firmware/export/config.h index 9bc6c7c..15b1375 100644 #endif #endif +/* Pixel aspect ratio is defined in terms of a multiplier for pixel width and + * height, and is set to 1:1 if the target does not set a value + */ +#ifndef LCD_PIXEL_ASPECT_HEIGHT +#define LCD_PIXEL_ASPECT_HEIGHT 1 +#endif +#ifndef LCD_PIXEL_ASPECT_WIDTH +#define LCD_PIXEL_ASPECT_WIDTH 1 +#endif + /* define this in the target config.h to use a different size */ #ifndef CONFIG_DEFAULT_ICON_HEIGHT #define CONFIG_DEFAULT_ICON_HEIGHT 8 |