start of pseudocolor init
This commit is contained in:
parent
325a909dcd
commit
5e0fc865a8
1 changed files with 22 additions and 1 deletions
|
@ -23,13 +23,34 @@ PseudoRenderControl::PseudoRenderControl(int screen)
|
|||
: RenderControl(screen)
|
||||
{
|
||||
printf("Initializing PseudoColor RenderControl\n");
|
||||
|
||||
const ScreenInfo *info = display->screenInfo(_screen);
|
||||
int depth = info->depth();
|
||||
|
||||
_cpc = 4; // XXX THIS SHOULD BE A USER OPTION
|
||||
_ncolors = _cpc * _cpc * _cpc;
|
||||
|
||||
if (_cpc < 2 || ncolors > 1 << depth) {
|
||||
fprintf(stderr,
|
||||
_("PseudoRenderControl: Invalid colormap size. Using maximum size
|
||||
available.\n"));
|
||||
_cpc = 1 << (depth/3);
|
||||
_ncolors = 1 << depth; // _cpc * _cpc * _cpc
|
||||
}
|
||||
|
||||
if (!(_colors = new XColor[_ncolors])) {
|
||||
fprintf(stderr,
|
||||
_("PseudoRenderControl: error allocating colormap\n"));
|
||||
::exit(1);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
PseudoRenderControl::~PseudoRenderControl()
|
||||
{
|
||||
printf("Destroying PseudoColor RenderControl\n");
|
||||
|
||||
delete _colors;
|
||||
}
|
||||
|
||||
void PseudoRenderControl::reduceDepth(Surface &sf, XImage *im) const
|
||||
|
|
Loading…
Reference in a new issue