* Apply the Scale2x3 effect on a bitmap. * The destination bitmap is filled with the scaled version of the source bitmap. * The source bitmap isn't modified. * The destination bitmap must be manually allocated before calling the function, * note that the resulting size is exactly 2x3 times the size of the source bitmap. * \param void_dst Pointer at the first pixel of the destination bitmap.
| 181 | * \param height Vertical size in pixels of the source bitmap. |
| 182 | */ |
| 183 | static void scale2x3(void* void_dst, unsigned dst_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height) |
| 184 | { |
| 185 | unsigned char* dst = (unsigned char*)void_dst; |
| 186 | const unsigned char* src = (const unsigned char*)void_src; |
| 187 | unsigned count; |
| 188 | |
| 189 | assert(height >= 2); |
| 190 | |
| 191 | count = height; |
| 192 | |
| 193 | stage_scale2x3(SCDST(0), SCDST(1), SCDST(2), SCSRC(0), SCSRC(0), SCSRC(1), pixel, width); |
| 194 | |
| 195 | dst = SCDST(3); |
| 196 | |
| 197 | count -= 2; |
| 198 | while (count) { |
| 199 | stage_scale2x3(SCDST(0), SCDST(1), SCDST(2), SCSRC(0), SCSRC(1), SCSRC(2), pixel, width); |
| 200 | |
| 201 | dst = SCDST(3); |
| 202 | src = SCSRC(1); |
| 203 | |
| 204 | --count; |
| 205 | } |
| 206 | |
| 207 | stage_scale2x3(SCDST(0), SCDST(1), SCDST(2), SCSRC(0), SCSRC(1), SCSRC(1), pixel, width); |
| 208 | |
| 209 | #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) |
| 210 | scale2x_mmx_emms(); |
| 211 | #endif |
| 212 | } |
| 213 | |
| 214 | /** |
| 215 | * Apply the Scale2x4 effect on a bitmap. |
no test coverage detected