2362N/A * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A for (i = 0; i <
256; i++) {
0N/A /* First, fill the gray values */ 0N/A /* ignore transparent black */ 0N/A if (b == r && b == g) {
0N/A /* fill the missing gaps by taking the valid values 0N/A * on either side and filling them halfway into the gap 0N/A for (i = 0; i <
256; i++) {
0N/A/* REMIND: does not deal well with bifurcation which happens when two 0N/A * palette entries map to the same cube vertex 0N/A *
sizeof(
unsigned short)
0N/A *
sizeof(
unsigned char)
0N/A * REMIND: take core inversedLUT calculation to the shared tree and 0N/A * recode the functions (Win32)awt_Image:initCubemap(), 0N/A * (Win32)awt_Image:make_cubemap(), (Win32)AwtToolkit::GenerateInverseLUT(), 0N/A * (Solaris)color:initCubemap() to call the shared codes. 0N/A * Initialize the per-component ordered dithering arrays 0N/A * Choose a size based on how far between elements in the 0N/A * virtual cube. Assume the cube has cuberoot(cmapsize) 0N/A * elements per axis and those elements are distributed 0N/A * The calculation should really divide by (#comp/axis - 1) 0N/A * since the first and last elements are at the extremes of 0N/A * the 256 levels, but in a practical sense this formula 0N/A * produces a smaller error array which results in smoother 0N/A * images that have slightly less color fidelity but much 0N/A * less dithering noise, especially for grayscale images. 0N/A * Flip green horizontally and blue vertically so that 0N/A * the errors don't line up in the 3 primary components. 0N/A for (i = 0; i <
8; i++) {
0N/A for (j = 0; j <
4; j++) {