/*
* 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 <vis_proto.h>
#include "java2d_Mlib.h"
/*#define USE_TWO_BC_TABLES*/ /* a little more precise, but slow on Ultra-III */
/***************************************************************/
#define BILINEAR \
\
\
\
void
{
mlib_s32 i;
#pragma pipeloop(0)
for (i = 0; i < numpix/2; i++) {
p_src += 4;
p_dst += 2;
}
if (numpix & 1) {
}
}
/***************************************************************/
#ifdef USE_TWO_BC_TABLES
#endif
/*
* REMIND: The following formulas are designed to give smooth
* results when 'A' is -0.5 or -1.0.
*/
static void
{
#ifdef USE_TWO_BC_TABLES
#endif
mlib_d64 x, y;
int i;
for (i = 0; i <= 256; i++) {
x = i*(1.0/256.0);
/* r(x) = (A + 2)|x|^3 - (A + 3)|x|^2 + 1 , 0 <= |x| < 1 */
y = ((A+2)*x - (A+3))*x*x + 1;
y *= 16384;
#ifdef USE_TWO_BC_TABLES
y *= 2;
if (y >= 32767) y = 32767;
#endif
/* r(x) = A|x|^3 - 5A|x|^2 + 8A|x| - 4A , 1 <= |x| < 2 */
x += 1.0;
y = ((A*x - 5*A)*x + 8*A)*x - 4*A;
y *= 16384;
#ifdef USE_TWO_BC_TABLES
y *= 2;
if (y >= 32767) y = 32767;
#endif
}
}
/***************************************************************/
do { \
} while (0)
void
{
union {
} p_dst;
mlib_s32 i;
if (!vis_bicubic_table_inited) {
init_vis_bicubic_table(-0.5);
}
#ifdef USE_TWO_BC_TABLES
#else
#endif
#pragma pipeloop(0)
for (i = 0; i < numpix; i++) {
p_src += 8;
#ifdef USE_TWO_BC_TABLES
#else
#endif
{
int a, r, g, b;
a = (b >> 24) & 0xff;
r = (b >> 16) & 0xff;
g = (b >> 8) & 0xff;
b = (b ) & 0xff;
SAT(r, a);
SAT(g, a);
SAT(b, a);
}
}
}
/***************************************************************/