/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "dither.h"
int std_odas_computed = 0;
int *inverse;
if (!cData) {
return;
}
if (!inverse) {
return;
}
for (i = 0; i < 256; i++) {
inverse[i] = -1;
}
/* First, fill the gray values */
for (i = 0; i < rgbsize; i++) {
if (rgb == 0x0) {
/* ignore transparent black */
continue;
}
b = rgb & 0xff;
if (b == r && b == g) {
inverse[b] = i;
}
}
/* fill the missing gaps by taking the valid values
* on either side and filling them halfway into the gap
*/
lastindex = -1;
lastgray = -1;
missing = 0;
for (i = 0; i < 256; i++) {
if (inverse[i] < 0) {
missing = 1;
} else {
if (missing) {
while (lastindex < i) {
}
}
lastindex = i;
missing = 0;
}
}
}
if (pData->img_clr_tbl) {
}
if (pData->pGrayInverseLutData) {
}
}
}
/* REMIND: does not deal well with bifurcation which happens when two
* palette entries map to the same cube vertex
*/
static int
int i;
* sizeof(unsigned short)
* priorState->activeEntries);
return 0;
}
* sizeof(unsigned char)
* priorState->activeEntries);
return 0;
}
}
}
if (currentState.activeEntries) {
if (!recurseLevel(¤tState)) {
return 0;
}
}
}
return 1;
}
/*
* REMIND: take core inversedLUT calculation to the shared tree and
* recode the functions (Win32)awt_Image:initCubemap(),
* (Win32)awt_Image:make_cubemap(), (Win32)AwtToolkit::GenerateInverseLUT(),
* (Solaris)color:initCubemap() to call the shared codes.
*/
unsigned char*
int cmap_len,
int cube_dim) {
int i;
unsigned char *useFlags;
if (newILut) {
if (useFlags == 0) {
#ifdef DEBUG
#endif
return NULL;
}
currentState.depth = 0;
currentState.maxDepth = 0;
currentState.rgb = (unsigned short *)
#ifdef DEBUG
#endif
return NULL;
}
currentState.indices = (unsigned char *)
#ifdef DEBUG
#endif
return NULL;
}
for (i = 0; i < cmap_mid; i++) {
unsigned short rgb;
}
if (!recurseLevel(¤tState)) {
#ifdef DEBUG
#endif
return NULL;
}
return newILut;
}
#ifdef DEBUG
#endif
return NULL;
}
void
if(std_odas_computed) {
} else {
std_odas_computed = 1;
}
}
int i, j, k;
/*
* Initialize the per-component ordered dithering arrays
* Choose a size based on how far between elements in the
* virtual cube. Assume the cube has cuberoot(cmapsize)
* elements per axis and those elements are distributed
* over 256 colors.
* since the first and last elements are at the extremes of
* the 256 levels, but in a practical sense this formula
* produces a smaller error array which results in smoother
* images that have slightly less color fidelity but much
* less dithering noise, especially for grayscale images.
*/
/*
* Flip green horizontally and blue vertically so that
* the errors don't line up in the 3 primary components.
*/
for (i = 0; i < 8; i++) {
for (j = 0; j < 4; j++) {
}
}
}