2362N/A * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. 430N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 430N/A * This code is free software; you can redistribute it and/or modify it 430N/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 430N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 430N/A * This code is distributed in the hope that it will be useful, but WITHOUT 430N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 430N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 430N/A * version 2 for more details (a copy is included in the LICENSE file that 430N/A * accompanied this code). 430N/A * You should have received a copy of the GNU General Public License version 430N/A * 2 along with this work; if not, write to the Free Software Foundation, 430N/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 430N/A/**************************** ConvolveOp support ****************************/ 430N/A * The maximum kernel size supported by the ConvolveOp shader. 430N/A "D3DBufImgOps_EnableConvolveOp: kernelW=%d kernelH=%d",
430N/A // texcoords are specified in the range [0,1], so to achieve an 430N/A // x/y offset of approximately one pixel we have to normalize 430N/A // (texcoords are in the range [0,1]) 430N/A // imgEdge[0] = imgMin.x 430N/A // imgEdge[1] = imgMin.y 430N/A // imgEdge[2] = imgMax.x 430N/A // imgEdge[3] = imgMax.y 430N/A // update the "uniform" kernel offsets and values 430N/A // disable the ConvolveOp shader 430N/A/**************************** RescaleOp support *****************************/ 430N/A // choose the appropriate shader, depending on the source image 430N/A // update the "uniform" scale factor values (note that the Java-level 430N/A // dispatching code always passes down 4 values here, regardless of 430N/A // the original source image type) 430N/A // update the "uniform" offset values (note that the Java-level 430N/A // dispatching code always passes down 4 values here, and that the 430N/A // offsets will have already been normalized to the range [0,1]) 430N/A // disable the RescaleOp shader 430N/A/**************************** LookupOp support ******************************/ 430N/A "D3DBufImgOps_EnableLookupOp: short=%d num=%d len=%d off=%d",
430N/A // choose the appropriate shader, depending on the source image 430N/A // and the number of bands involved 430N/A // update the "uniform" offset value 430N/A for (i = 0; i <
4; i++) {
430N/A // update the lookup table with the user-provided values 430N/A // replicate the single band for R/G/B; alpha band is unused 430N/A for (i = 0; i <
3; i++) {
430N/A // user supplied band for each of R/G/B; alpha band is unused 430N/A for (i = 0; i <
3; i++) {
430N/A // user supplied band for each of R/G/B/A 430N/A for (i = 0; i <
4; i++) {
430N/A // upload the bands one row at a time into our lookup table texture 430N/A for (i = 0; i <
4; i++) {
430N/A // bind the lookup table to texture unit 1 and enable texturing 430N/A // disable the LookupOp shader 430N/A // disable the lookup table on texture unit 1