Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Defines | Functions
art_rgb.c File Reference
#include "scconfig.h"
#include "art_rgb.h"
#include <string.h>

Go to the source code of this file.

Defines

#define COLOR_RUN_SIMPLE

Functions

void art_rgb_fill_run_ (art_u8 *buf, art_u32 rgb, int n)
void art_rgb_run_alpha_ (art_u8 *buf, art_u8 r, art_u8 g, art_u8 b, int alpha, int n)
 art_rgb_run_alpha: Render semitransparent color over RGB buffer.

Define Documentation

Definition at line 28 of file art_rgb.c.


Function Documentation

void art_rgb_fill_run_ ( art_u8 *  buf,
art_u32  rgb,
int  n 
)

Definition at line 52 of file art_rgb.c.

{
  int i;
  art_u32 *b = (art_u32 *)buf;
  for (i = 0; i < n; i++)
  {
    *b = rgb;
    b++;
  }
}

Here is the caller graph for this function:

void art_rgb_run_alpha_ ( art_u8 *  buf,
art_u8  r,
art_u8  g,
art_u8  b,
int  alpha,
int  n 
)

art_rgb_run_alpha: Render semitransparent color over RGB buffer.

: Buffer for rendering. : Red, range 0..255. : Green, range 0..255. : Blue, range 0..255. : Alpha, range 0..256.
: Number of RGB triples to render.

Renders a sequential run of solid (, , ) color over with opacity .

Definition at line 160 of file art_rgb.c.

{
  int i;
  int v;
  for (i = 0; i < n; i++)
  {
    v = *buf;
    *buf++ = v + (((b - v) * alpha + 0x80) >> 8);
    v = *buf;
    *buf++ = v + (((g - v) * alpha + 0x80) >> 8);
    v = *buf;
    *buf++ = v + (((r - v) * alpha + 0x80) >> 8);
   buf++;
  }
}

Here is the caller graph for this function: