Пример #1
0
void Convert24to8CP( LPRGB lpPixel, int iCount, LPINT lpError, LPTR lpOutput,
                        int xDiva, int yDiva, LPBLTSESSION lpBltSession )
/************************************************************************/
{
LPTR lpPaletteLUT;
WORD wRGB;

lpPaletteLUT = lpBltSession->lpBlt->lpPaletteLUT;
while (--iCount >= 0)
	{
	wRGB = RGBtoMiniRGB(lpPixel);
	++lpPixel;
	*lpOutput++ = lpPaletteLUT[wRGB] + NumStaticColors;
	}
}
Пример #2
0
void Convert8Pto8( LPTR lpPixel, int iCount, LPINT lpError, LPTR lpOutput,
                     int xDiva, int yDiva, LPBLTSESSION lpBltSession )
/************************************************************************/
{
LPRGB lpRGBmap, lpRGB;
LPTR lpPaletteLUT;
BYTE i;
WORD wRGB;

lpRGBmap = lpBltSession->TypeInfo.ColorMap->RGBData;
lpPaletteLUT = lpBltSession->lpBlt->lpPaletteLUT;
while (--iCount >= 0)
	{
	i = *lpPixel++;
	lpRGB = lpRGBmap + i;
	wRGB = RGBtoMiniRGB(lpRGB);
	*lpOutput++ = lpPaletteLUT[wRGB] + NumStaticColors;
	}
}
Пример #3
0
static void ProcessVignette8P(
	LPTR  lpSrc,
	int    iCount,
	LPGRADIENT_DATA lpGrad)
{
	long d, D, lTableRange;
	int  r;
	LFIXED rate;
	LPRGB  lpMyMidPoint = (LPRGB)lpGrad->lpMidpointTable;
	LPTR lpPaletteLUT = lpGrad->lpPaletteLUT;
	int    iTableIndex;
	int nRepetitions, SoftTransition;
	LPLONG lpld, lplD;
	RGBS rgb;
	WORD wRGB;

	lpld = lpGrad->lpld;
	lplD = lpGrad->lplD;
	lTableRange = lpGrad->lTableRange;
	nRepetitions = lpGrad->nRepetitions;
	SoftTransition = lpGrad->SoftTransition;

	if (nRepetitions == 1)
	{
		while (iCount-- > 0)
		{
			DO_RANDOM;

			REPS_EQUAL_ONE;

			iTableIndex = WHOLE(rate * lTableRange);

			if (r)
			{
				QUICK_BOUND(lpMyMidPoint[iTableIndex].red   + r, rgb.red);
				NEW_RANDOM;
				QUICK_BOUND(lpMyMidPoint[iTableIndex].green + r, rgb.green);
				NEW_RANDOM;
				QUICK_BOUND(lpMyMidPoint[iTableIndex].blue  + r, rgb.blue);
			}
			else
			{
				QUICK_BOUND(lpMyMidPoint[iTableIndex].red  , rgb.red);
				QUICK_BOUND(lpMyMidPoint[iTableIndex].green, rgb.green);
				QUICK_BOUND(lpMyMidPoint[iTableIndex].blue , rgb.blue);
			}
			wRGB = RGBtoMiniRGB(&rgb);
			*lpSrc++ = lpPaletteLUT[wRGB];
		}
	}
	else
	{
		while (iCount-- > 0)
		{
			DO_RANDOM;

			REPS_NOT_ONE;

			iTableIndex = WHOLE(rate*lTableRange);

			if (r)
			{
				QUICK_BOUND(lpMyMidPoint[iTableIndex].red   + r, rgb.red);
				NEW_RANDOM;
				QUICK_BOUND(lpMyMidPoint[iTableIndex].green + r, rgb.green);
				NEW_RANDOM;
				QUICK_BOUND(lpMyMidPoint[iTableIndex].blue  + r, rgb.blue);
			}
			else
			{
				QUICK_BOUND(lpMyMidPoint[iTableIndex].red  , rgb.red);
				QUICK_BOUND(lpMyMidPoint[iTableIndex].green, rgb.green);
				QUICK_BOUND(lpMyMidPoint[iTableIndex].blue , rgb.blue);
			}

			wRGB = RGBtoMiniRGB(&rgb);
			*lpSrc++ = lpPaletteLUT[wRGB];
		}
	}
}