Beispiel #1
0
CPalette * PaletteFromMapFile(const char * filename)
{
  FILE * fh = fopen(filename, "rt");

  if (! fh)
    return 0;

  CPalette * p = PaletteLinear(false);
  uint i;

  for (i=0; i<257 && !feof(fh); i++)
  {
    char line[256];
    uint r,g,b;

    fgets(line, sizeof(line)-1, fh);
    if (sscanf(line, "%u %u %u", &r,&g,&b) != 3)
    {
      delete p; p=0;
      break;
    }

    p->Add(i/256., r/255., g/255., b/255.);
  }

  fclose(fh);
  return p;
}
Beispiel #2
0
CPalette * PaletteLinear(COLORREF c)
{
  CPalette * p = PaletteLinear(false);

  p->Add(0.5, GetRValue(c)/255., GetGValue(c)/255., GetBValue(c)/255.);

  return p;
}
Beispiel #3
0
CPalette * PaletteSimple(COLORREF c1, COLORREF c2)
{
  CPalette * p = PaletteLinear(false);

  p->Add(0.0, GetRValue(c1)/255., GetGValue(c1)/255., GetBValue(c1)/255.);
  p->Add(1.0, GetRValue(c2)/255., GetGValue(c2)/255., GetBValue(c2)/255.);
  
  return p;
}
Beispiel #4
0
CPalette * CFractalLyapunov::DefaultPalette(bool in)
{
  CPalette * p;

  if (in)
  {
    p = PaletteSingle(0x1B1C1F);
  }
  else
  {
    p = PaletteLinear(false);
    p->Add(0.00, HEXRGB(0x191400));
    p->Add(1.00, HEXRGB(0xFFE119)); //0xFFD40A));
  }

  return p;
}