MCPcopy Create free account
hub / github.com/DentonW/DevIL / readScanline

Function readScanline

DevIL/src-IL/src/il_pic.cpp:265–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263
264
265ILuint readScanline(ILubyte *scan, ILint width, CHANNEL *channel, ILint bytes)
266{
267 ILint noCol;
268 ILint off[4];
269 ILuint status=0;
270
271 while (channel) {
272 noCol = 0;
273 if(channel->Chan & PIC_RED_CHANNEL) {
274 off[noCol] = 0;
275 noCol++;
276 }
277 if(channel->Chan & PIC_GREEN_CHANNEL) {
278 off[noCol] = 1;
279 noCol++;
280 }
281 if(channel->Chan & PIC_BLUE_CHANNEL) {
282 off[noCol] = 2;
283 noCol++;
284 }
285 if(channel->Chan & PIC_ALPHA_CHANNEL) {
286 off[noCol] = 3;
287 noCol++;
288 //@TODO: Find out if this is possible.
289 if (bytes == 3) // Alpha channel in a 24-bit image. Do not know what to do with this.
290 return 0;
291 }
292
293 switch(channel->Type & 0x0F)
294 {
295 case PIC_UNCOMPRESSED:
296 status = channelReadRaw(scan, width, noCol, off, bytes);
297 break;
298 case PIC_PURE_RUN_LENGTH:
299 status = channelReadPure(scan, width, noCol, off, bytes);
300 break;
301 case PIC_MIXED_RUN_LENGTH:
302 status = channelReadMixed(scan, width, noCol, off, bytes);
303 break;
304 }
305 if (!status)
306 break;
307
308 channel = (CHANNEL*)channel->Next;
309 }
310 return status;
311}
312
313
314ILboolean channelReadRaw(ILubyte *scan, ILint width, ILint noCol, ILint *off, ILint bytes)

Callers 1

readScanlinesFunction · 0.85

Calls 3

channelReadRawFunction · 0.85
channelReadPureFunction · 0.85
channelReadMixedFunction · 0.85

Tested by

no test coverage detected