MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / scale2x4

Function scale2x4

src/Engine/Scalers/scalebit.cpp:228–257  ·  view source on GitHub ↗

* Apply the Scale2x4 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 2x4 times the size of the source bitmap. * \param void_dst Pointer at the first pixel of the destination bitmap.

Source from the content-addressed store, hash-verified

226 * \param height Vertical size in pixels of the source bitmap.
227 */
228static void scale2x4(void* void_dst, unsigned dst_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height)
229{
230 unsigned char* dst = (unsigned char*)void_dst;
231 const unsigned char* src = (const unsigned char*)void_src;
232 unsigned count;
233
234 assert(height >= 2);
235
236 count = height;
237
238 stage_scale2x4(SCDST(0), SCDST(1), SCDST(2), SCDST(3), SCSRC(0), SCSRC(0), SCSRC(1), pixel, width);
239
240 dst = SCDST(4);
241
242 count -= 2;
243 while (count) {
244 stage_scale2x4(SCDST(0), SCDST(1), SCDST(2), SCDST(3), SCSRC(0), SCSRC(1), SCSRC(2), pixel, width);
245
246 dst = SCDST(4);
247 src = SCSRC(1);
248
249 --count;
250 }
251
252 stage_scale2x4(SCDST(0), SCDST(1), SCDST(2), SCDST(3), SCSRC(0), SCSRC(1), SCSRC(1), pixel, width);
253
254#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
255 scale2x_mmx_emms();
256#endif
257}
258
259/**
260 * Apply the Scale3x effect on a bitmap.

Callers 1

scaleFunction · 0.85

Calls 2

stage_scale2x4Function · 0.85
scale2x_mmx_emmsFunction · 0.85

Tested by

no test coverage detected