/*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "Xcmsint.h"
#include "Cv.h"
/*
*/
static int
{
unsigned int nElements;
goto Bad;
}
switch (format) {
case 8:
while (nElements--) {
/* 0xFFFF/0xFF = 0x101 */
}
break;
case 16:
while (nElements--) {
}
break;
case 32:
while (nElements--) {
}
break;
default:
goto Bad;
}
return (1);
Bad:
if (ph) {
}
if (pf) {
}
return (0);
}
static int
{
int count;
unsigned int max_index;
unsigned int nElements;
goto Bad;
}
switch (format) {
case 8:
}
break;
case 16:
}
break;
case 32:
}
break;
default:
goto Bad;
}
return (1);
Bad:
if (ph) {
}
if (pf) {
}
return (0);
}
/*
** If the given n pairs (hi, fi) approximate a power function with the
** relation h = f**exp, the exponent exp is returned.
*/
static double
unsigned int *pf)
{
unsigned short h;
unsigned int f;
incr = n / MAX_SAMPLES;
if (incr < 1) {
incr = 1;
}
sum = 0;
nsamples = 0;
h = ph[i];
f = pf[i];
if (h == 0 || f == 0) {
continue;
}
if (denom) {
nsamples++;
}
}
if (nsamples == 0) {
/* Note: as good as anything else */
return(XSOLARIS_STD_GAMMA);
} else {
}
}
/*
** Updates the current prop element pointer to point beyond the current channel.
** Upon entry, pChar should point to the length element of the channel.
**
** Returns 0 if the property contents are invalid, 1 otherwise.
*/
static int
{
if ((long)*pCount <= 0) {
return (0);
}
return (0);
}
while (nElements--) {
}
return (1);
}
/*
** Updates the current prop element pointer to point beyond the current visual.
** Upon entry, pChar should point to the type element immediately following
** the visualID elemnt.
**
** Returns 0 if the property contents are invalid, 1 otherwise.
*/
static int
{
/* Get table type */
if ((long)*pCount <= 0) {
return (0);
}
return (0);
}
/* Get number of channels */
if ((long)*pCount <= 0) {
return (0);
}
return (0);
}
/* Skip red channel */
return (0);
}
if (nTables > 1) {
/* Skip green channel */
return (0);
}
/* Skip blue channel */
return (0);
}
}
return (1);
}
static int XSolarisGetVisualGammaCalledFlag = 0;
int
XSolarisGetVisualGammaCalled (void)
{
return (XSolarisGetVisualGammaCalledFlag);
}
/*
** Note: this function ignores the green and blue intensity correction
** data; it assumes that these are the same as the red channel.
*/
double *gamma)
{
unsigned long nitems = 0;
unsigned long nbytes_return;
unsigned short *ph;
unsigned int *pf;
/*
* Get Intensity Tables
*/
if (CorrectAtom != None) {
&property_return) == XcmsFailure) {
return (Success);
} else if ((long)nitems <= 0) {
/* use standard gamma */
if (property_return) {
}
return (Success);
}
}
/* Note: nitems is decremented as a side-effect of calling getElement */
while (nitems) {
switch (format) {
case 8:
/*
* Must have at least:
* VisualID0
* VisualID1
* VisualID2
* VisualID3
* type
* count
* length
* intensity1
* intensity2
*/
if (nitems < 9) {
return (BadMatch);
}
count = 3;
break;
case 16:
/*
* Must have at least:
* VisualID0
* VisualID3
* type
* count
* length
* intensity1
* intensity2
*/
if (nitems < 7) {
return (BadMatch);
}
count = 1;
break;
case 32:
/*
* Must have at least:
* VisualID0
* type
* count
* length
* intensity1
* intensity2
*/
if (nitems < 6) {
return (BadMatch);
}
count = 0;
break;
default:
return (BadMatch);
}
/* Get VisualID */
while (count--) {
}
return (BadMatch);
}
continue;
}
/* Found the visual */
maxcolor = 0xffff;
/* Get table type and number of channels */
/*
** Note: it is assumed that the per-channel maps in the table all have
** the same length. This is a safe bet for most hardware, as it depends
** not on the visual masks but on the visual bits_per_rgb. Thus, we
** extract the information from the red channel map and ignore the rest.
*/
switch (cType) {
case 0:
return (BadMatch);
}
if (nelem == 2 &&
/* exactly linear */
*gamma = 1.0;
} else {
}
break;
case 1:
return (BadMatch);
}
break;
default:
return (BadMatch);
}
/* These were allocated in the QueryTableType<n> routines and
must be freed now */
if (ph) {
}
if (pf) {
}
return (Success);
}
/* bug fix for 4248958: OPENGL program shows mem leak in libdga*/
return (Success);
}