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

Function scale3x

src/Engine/Scalers/scalebit.cpp:273–298  ·  view source on GitHub ↗

* Apply the Scale3x 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 3x3 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

271 * \param height Vertical size in pixels of the source bitmap.
272 */
273static void scale3x(void* void_dst, unsigned dst_slice, const void* void_src, unsigned src_slice, unsigned pixel, unsigned width, unsigned height)
274{
275 unsigned char* dst = (unsigned char*)void_dst;
276 const unsigned char* src = (const unsigned char*)void_src;
277 unsigned count;
278
279 assert(height >= 2);
280
281 count = height;
282
283 stage_scale3x(SCDST(0), SCDST(1), SCDST(2), SCSRC(0), SCSRC(0), SCSRC(1), pixel, width);
284
285 dst = SCDST(3);
286
287 count -= 2;
288 while (count) {
289 stage_scale3x(SCDST(0), SCDST(1), SCDST(2), SCSRC(0), SCSRC(1), SCSRC(2), pixel, width);
290
291 dst = SCDST(3);
292 src = SCSRC(1);
293
294 --count;
295 }
296
297 stage_scale3x(SCDST(0), SCDST(1), SCDST(2), SCSRC(0), SCSRC(1), SCSRC(1), pixel, width);
298}
299
300/**
301 * Apply the Scale4x effect on a bitmap.

Callers 1

scaleFunction · 0.85

Calls 1

stage_scale3xFunction · 0.85

Tested by

no test coverage detected