nr-gradient-gpl.cpp revision 9e87caa574d67b9b1aa1015d4faae055336c9d30
#define __NR_GRADIENT_C__
/*
* Pixel buffer rendering library
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
*
* Copyright (C) 2001-2002 Lauris Kaplinski
* Copyright (C) 2001-2002 Ximian, Inc.
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <libnr/nr-pixops.h>
#include <libnr/nr-pixblock-pixel.h>
#include "nr-gradient-gpl.h"
#define noNR_USE_GENERIC_RENDERER
static void nr_lgradient_render_R8G8B8A8N_EMPTY (NRLGradientRenderer *lgr, unsigned char *px, int x0, int y0, int width, int height, int rs);
static void nr_lgradient_render_R8G8B8A8N (NRLGradientRenderer *lgr, unsigned char *px, int x0, int y0, int width, int height, int rs);
static void nr_lgradient_render_R8G8B8 (NRLGradientRenderer *lgr, unsigned char *px, int x0, int y0, int width, int height, int rs);
const unsigned char *cv,
unsigned int spread,
{
return (NRRenderer *) lgr;
}
static void
{
lgr = (NRLGradientRenderer *) r;
#ifdef NR_USE_GENERIC_RENDERER
#else
case NR_PIXBLOCK_MODE_A8:
break;
case NR_PIXBLOCK_MODE_R8G8B8:
break;
nr_lgradient_render_R8G8B8A8N_EMPTY (lgr, NR_PIXBLOCK_PX (pb), pb->area.x0, pb->area.y0, width, height, pb->rs);
break;
break;
default:
break;
}
} else {
case NR_PIXBLOCK_MODE_A8:
break;
case NR_PIXBLOCK_MODE_R8G8B8:
nr_lgradient_render_R8G8B8 (lgr, NR_PIXBLOCK_PX (pb), pb->area.x0, pb->area.y0, width, height, pb->rs);
break;
nr_lgradient_render_R8G8B8A8N (lgr, NR_PIXBLOCK_PX (pb), pb->area.x0, pb->area.y0, width, height, pb->rs);
break;
break;
default:
break;
}
}
#endif
}
static void
nr_lgradient_render_R8G8B8A8N_EMPTY (NRLGradientRenderer *lgr, unsigned char *px, int x0, int y0, int width, int height, int rs)
{
int x, y;
double pos;
for (y = 0; y < height; y++) {
const unsigned char *s;
unsigned char *d;
int idx;
for (x = 0; x < width; x++) {
d[0] = s[0];
d[1] = s[1];
d[2] = s[2];
d[3] = s[3];
d += 4;
}
for (x = 0; x < width; x++) {
d[0] = s[0];
d[1] = s[1];
d[2] = s[2];
d[3] = s[3];
d += 4;
}
} else {
for (x = 0; x < width; x++) {
d[0] = s[0];
d[1] = s[1];
d[2] = s[2];
d[3] = s[3];
d += 4;
}
}
}
}
static void
nr_lgradient_render_R8G8B8A8N (NRLGradientRenderer *lgr, unsigned char *px, int x0, int y0, int width, int height, int rs)
{
int x, y;
unsigned char *d;
double pos;
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
int idx;
unsigned int ca;
const unsigned char *s;
case NR_GRADIENT_SPREAD_PAD:
break;
break;
break;
default:
idx = 0;
break;
}
/* Full composition */
if (s[3] == 255) {
d[0] = s[0];
d[1] = s[1];
d[2] = s[2];
d[3] = 255;
} else if (s[3] != 0) {
}
d += 4;
}
}
}
static void
nr_lgradient_render_R8G8B8 (NRLGradientRenderer *lgr, unsigned char *px, int x0, int y0, int width, int height, int rs)
{
int x, y;
unsigned char *d;
double pos;
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
int idx;
const unsigned char *s;
case NR_GRADIENT_SPREAD_PAD:
break;
break;
break;
default:
idx = 0;
break;
}
/* Full composition */
d[0] = NR_COMPOSEN11_1111 (s[0], s[3], d[0]);
d += 3;
}
}
}
static void
{
int x, y;
unsigned char *d;
double pos;
int bpp;
0, 0);
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
int idx;
const unsigned char *s;
case NR_GRADIENT_SPREAD_PAD:
break;
break;
break;
default:
idx = 0;
break;
}
d += bpp;
}
}
}