MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / pixelConvert

Function pixelConvert

util/bmp.c:83–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81
82
83static void pixelConvert(unsigned char *srcBuf, int width, int srcPitch,
84 int height, PF *srcpf, unsigned char *dstBuf, int dstPitch, PF *dstpf,
85 int flip)
86{
87 if(flip)
88 {
89 srcBuf = &srcBuf[srcPitch * (height - 1)];
90 srcPitch = -srcPitch;
91 }
92 srcpf->convert(srcBuf, width, srcPitch, height, dstBuf, dstPitch, dstpf);
93 while(height--)
94 {
95 if(width * dstpf->size != dstPitch)
96 memset(&dstBuf[width * dstpf->size], 0, dstPitch - width * dstpf->size);
97 dstBuf += dstPitch;
98 }
99}
100
101
102static int ppm_load(int *fd, unsigned char **buf, int *width, int align,

Callers 4

ppm_loadFunction · 0.85
bmp_loadFunction · 0.85
ppm_saveFunction · 0.85
bmp_saveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected