本文整理汇总了C++中Palette::RedShade方法的典型用法代码示例。如果您正苦于以下问题:C++ Palette::RedShade方法的具体用法?C++ Palette::RedShade怎么用?C++ Palette::RedShade使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Palette
的用法示例。
在下文中一共展示了Palette::RedShade方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Start
int Start(char * cmdLine)
{
if ((cmdLine == NULL) || (cmdLine[0] == '\0'))
{
CopyStr(imagename, "./test1.pcx");
CopyStr(filtername,"./bump2.pcx");
}
else
{
int i,j;
for (i=0; cmdLine[i]!=' '; i++)
imagename[i] = cmdLine[i];
imagename[i++] = '\0';
for (j=0; cmdLine[i]!='\0'; i++, j++)
filtername[j] = cmdLine[i];
filtername[j] = '\0';
}
Pcx image(imagename);
Pcx filter(filtername);
FilteredImage bump(filter.Width(), filter.Height(), filter);
// building palette for shaded mapping
PaletteBuilder palette(image.GetPalette().Count()*(NCLUT*2+1), NCLUT*2);
CountPalette cpal(image.GetPalette());
cpal.AddImage(image);
real coef=0;
int i;
for (i=0; i<NCLUT*2; i++, coef+=STEP/2)
palette.AddPalette(cpal*coef);
RGBColor argb(0,255,255);
for (i=0; i<NCLUT; i++)
palette.AddPalette(cpal^argb);
Palette best = palette.Best();
image.ImportPalette(best);
MultiShadeClut clut1(best, NCLUT*2);
coef=0;
for (i=0; i<NCLUT*2; i++, coef+=STEP/2)
clut1.SetClut(i,coef);
MultiShadeClut clut2(best, NCLUT);
coef=STEP;
for (i=0; i<NCLUT; i++, coef+=STEP)
clut2.SetClut(i,coef);
TransluentClut tclut(best);
tclut.Init(argb);
//ofstream out("test.txt");
//out << tclut << (cpal^argb);
Palette defPal;
defPal.RedShade();
Device * dev= NewDevice(240,320,&defPal);
MainApp app(*dev, &image, &clut1, &clut2, &tclut, &bump);
app.fDefaultPalette = &defPal;
app.fClutPalette = &best;
return app.Launch();
}