MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / R_ImageScale

Function R_ImageScale

neo/renderer/Image_program.cpp:137–152  ·  view source on GitHub ↗

================= R_ImageScale ================= */

Source from the content-addressed store, hash-verified

135=================
136*/
137static void R_ImageScale( byte *data, int width, int height, float scale[4] ) {
138 int i, j;
139 int c;
140
141 c = width * height * 4;
142
143 for ( i = 0 ; i < c ; i++ ) {
144 j = (byte)(data[i] * scale[i&3]);
145 if ( j < 0 ) {
146 j = 0;
147 } else if ( j > 255 ) {
148 j = 255;
149 }
150 data[i] = j;
151 }
152}
153
154/*
155=================

Callers 1

R_ParseImageProgram_rFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected