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

Function scale2x3

src/Engine/Scalers/scalebit.cpp:183–212  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

181 * \param height Vertical size in pixels of the source bitmap.
182 */
183static 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.

Callers 1

scaleFunction · 0.85

Calls 2

stage_scale2x3Function · 0.85
scale2x_mmx_emmsFunction · 0.85

Tested by

no test coverage detected