/*
* 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.
*/
#if !defined(JAVA2D_NO_MLIB) || defined(MLIB_ADD_SUFF)
#include <vis_proto.h>
#include "java2d_Mlib.h"
#include "vis_AlphaMacros.h"
/***************************************************************/
#define RGB2GRAY(r, g, b) \
(((19672 * (r)) + (38621 * (g)) + (7500 * (b))) >> 8)
/***************************************************************/
#define Gray2Argb(x) \
0xff000000 | (x << 16) | (x << 8) | x
/***************************************************************/
{
mlib_s32 i, j, x;
if (width <= 8) {
for (j = 0; j < height; j++) {
for (i = 0; i < width; i++) {
x = src[i];
dst[i] = x | (x << 8);
}
}
return;
}
height = 1;
}
for (j = 0; j < height; j++) {
x = *src++;
*dst++ = x | (x << 8);
}
#pragma pipeloop(0)
src += 8;
}
} else {
#pragma pipeloop(0)
src += 8;
}
}
x = *src++;
*dst++ = x | (x << 8);
}
}
}
/***************************************************************/
{
mlib_s32 i, j, x;
if (width < 8) {
for (j = 0; j < height; j++) {
for (i = 0; i < width; i++) {
x = src[i] >> 8;
}
}
return;
}
height = 1;
}
for (j = 0; j < height; j++) {
x = *src++ >> 8;
}
#pragma pipeloop(0)
src += 4;
}
x = *src++ >> 8;
}
}
}
/***************************************************************/
{
mlib_s32 i, j, x;
if (width < 16) {
for (j = 0; j < height; j++) {
for (i = 0; i < width; i++) {
}
}
return;
}
for (j = 0; j < height; j++) {
#pragma pipeloop(0)
}
}
}
}
/***************************************************************/
{
mlib_s32 i, j, x;
if (width < 16) {
for (j = 0; j < height; j++) {
for (i = 0; i < width; i++) {
dst[i] = x | (x << 8);
}
}
return;
}
for (j = 0; j < height; j++) {
*dst++ = x | (x << 8);
}
#pragma pipeloop(0)
}
*dst++ = x | (x << 8);
}
}
}
/***************************************************************/
{
mlib_s32 i, j;
if (width < 8) {
for (j = 0; j < height; j++) {
for (i = 0; i < width; i++) {
int r, g, b;
b = (argb) & 0xff;
}
}
return;
}
for (i = lutSize; i < 256; i++) {
LutU16[i] = 0;
}
height = 1;
}
for (j = 0; j < height; j++) {
src++;
}
#pragma pipeloop(0)
src += 2;
}
src++;
}
}
}
/***************************************************************/
{
mlib_s32 i, j;
if (width < 8) {
for (j = 0; j < height; j++) {
for (i = 0; i < width; i++) {
int r, g, b;
b = (argb) & 0xff;
}
}
return;
}
for (i = lutSize; i < 256; i++) {
LutU16[i] = 0;
}
for (j = 0; j < height; j++) {
}
#pragma pipeloop(0)
}
}
}
}
/***************************************************************/
{
if (width < 16) {
for (j = 0; j < height; j++) {
for (i = 0; i < width; i++) {
if (argb < 0) {
int r, g, b;
b = (argb) & 0xff;
}
}
}
return;
}
for (i = lutSize; i < 256; i++) {
LutU16[i] = 0;
}
#pragma pipeloop(0)
for (i = 0; i < 256; i++) {
}
height = 1;
}
for (j = 0; j < height; j++) {
#pragma pipeloop(0)
src++;
}
}
}
/***************************************************************/
{
mlib_s32 i, j;
if (width < 16) {
for (j = 0; j < height; j++) {
for (i = 0; i < width; i++) {
if (argb < 0) {
int r, g, b;
b = (argb) & 0xff;
} else {
}
}
}
return;
}
for (i = lutSize; i < 256; i++) {
LutU16[i] = 0;
}
#pragma pipeloop(0)
for (i = 0; i < 256; i++) {
}
height = 1;
}
for (j = 0; j < height; j++) {
src++;
}
#pragma pipeloop(0)
src += 2;
}
src++;
}
}
}
/***************************************************************/
{
if (width < 16) {
for (j = 0; j < height; j++) {
for (i = 0; i < width; i++) {
if (argb < 0) {
int r, g, b;
b = (argb) & 0xff;
}
}
}
return;
}
for (i = lutSize; i < 256; i++) {
LutU16[i] = 0;
}
#pragma pipeloop(0)
for (i = 0; i < 256; i++) {
}
for (j = 0; j < height; j++) {
#pragma pipeloop(0)
}
}
}
/***************************************************************/
#endif