/*
* 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 <jlong.h>
#include "D3DBufImgOps.h"
#include "D3DContext.h"
#include "D3DRenderQueue.h"
#include "D3DSurfaceData.h"
#include "GraphicsPrimitiveMgr.h"
/**************************** ConvolveOp support ****************************/
/**
* The maximum kernel size supported by the ConvolveOp shader.
*/
unsigned char *kernel)
{
"D3DBufImgOps_EnableConvolveOp: kernelW=%d kernelH=%d",
// texcoords are specified in the range [0,1], so to achieve an
// x/y offset of approximately one pixel we have to normalize
// to that range here
if (edgeZeroFill) {
}
flags |= CONVOLVE_5X5;
}
// (texcoords are in the range [0,1])
// imgEdge[0] = imgMin.x
// imgEdge[1] = imgMin.y
// imgEdge[2] = imgMax.x
// imgEdge[3] = imgMax.y
// update the "uniform" kernel offsets and values
kIndex = 0;
kIndex += 4;
}
}
}
{
// disable the ConvolveOp shader
}
/**************************** RescaleOp support *****************************/
unsigned char *scaleFactors,
unsigned char *offsets)
{
// choose the appropriate shader, depending on the source image
if (nonPremult) {
}
// update the "uniform" scale factor values (note that the Java-level
// dispatching code always passes down 4 values here, regardless of
// the original source image type)
// update the "uniform" offset values (note that the Java-level
// dispatching code always passes down 4 values here, and that the
// offsets will have already been normalized to the range [0,1])
}
{
// disable the RescaleOp shader
}
/**************************** LookupOp support ******************************/
void *tableValues)
{
int i;
"D3DBufImgOps_EnableLookupOp: short=%d num=%d len=%d off=%d",
// choose the appropriate shader, depending on the source image
// and the number of bands involved
if (numBands != 4) {
}
if (nonPremult) {
}
// update the "uniform" offset value
for (i = 0; i < 4; i++) {
}
// update the lookup table with the user-provided values
if (numBands == 1) {
// replicate the single band for R/G/B; alpha band is unused
for (i = 0; i < 3; i++) {
bands[i] = tableValues;
}
} else if (numBands == 3) {
// user supplied band for each of R/G/B; alpha band is unused
for (i = 0; i < 3; i++) {
}
} else if (numBands == 4) {
// user supplied band for each of R/G/B/A
for (i = 0; i < 4; i++) {
}
}
// upload the bands one row at a time into our lookup table texture
for (i = 0; i < 4; i++) {
continue;
}
if (shortData) {
} else {
int j;
for (j = 0; j < bandLength; j++) {
}
}
}
pLutTex->UnlockRect(0);
// bind the lookup table to texture unit 1 and enable texturing
return res;
}
{
// disable the LookupOp shader
// disable the lookup table on texture unit 1
}