Category : Files from Magazines
Archive   : CUJ9309.ZIP
Filename : 1109048A

 
Output of file : 1109048A contained in archive : CUJ9309.ZIP
Listing 5 Manipulating the DIB Color Table


void BuildMapping (struct BitMapRec FAR *dispRec)
{
int e,i;
DWORD colorRef;

for (i = 0; i < 256; i++)
{
if (options & PAL_MAPDIRECT)
{
e = i;

if (options & PAL_LOWERCONTRAST)
{
if (i < 32) e = i * 3;
else if (i >= 224) e = (i * 3) - 512;
else e = ((i - 32) / 3) + 96;
}
else if (options & PAL_HIGHERCONTRAST)
{
if (i < 96) e = i / 3;
else if (i >= 160)
e = ((i - 160) / 3) + 224;
else e = ((i - 96) * 3) + 32;
}

if (options & PAL_DARKER)
{
e = e / 2;
}
else if (options & PAL_LIGHTER)
{
e = (e / 2) + 128;
}

e = e & 0x00FF; /* "safety"... */
}
else {
colorRef = (DWORD)i +
((DWORD)i << 8L) +
((DWORD)i << 16L);
e = GetNearestPaletteIndex(newPalette,
colorRef);
}

/*--------------------------------------------*/

if (options & PAL_IMAGEINVERT)
dispRec->bmi.bmiColors[i] = e;
else dispRec->bmi.bmiColors[255-i] = e;
} /* end for i */
} /* BuildMapping */


  3 Responses to “Category : Files from Magazines
Archive   : CUJ9309.ZIP
Filename : 1109048A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/