Back to index

scribus-ng  1.3.4.dfsg+svn20071115
art_rgba_affine.c File Reference
#include "scconfig.h"
#include "art_rgba_affine.h"
#include <math.h>
#include <libart_lgpl/art_misc.h>
#include <libart_lgpl/art_point.h>
#include <libart_lgpl/art_affine.h>
#include "art_rgb_affine_private.h"

Go to the source code of this file.


void art_rgba_affine (art_u8 *dst, int x0, int y0, int x1, int y1, int dst_rowstride, const art_u8 *src, int src_width, int src_height, int src_rowstride, const double affine[6], ArtFilterLevel level, ArtAlphaGamma *alphagamma)
 art_rgb_affine: Affine transform source RGB image and composite.

Function Documentation

void art_rgba_affine ( art_u8 *  dst,
int  x0,
int  y0,
int  x1,
int  y1,
int  dst_rowstride,
const art_u8 *  src,
int  src_width,
int  src_height,
int  src_rowstride,
const double  affine[6],
ArtFilterLevel  level,
ArtAlphaGamma *  alphagamma 

art_rgb_affine: Affine transform source RGB image and composite.

: Destination image RGB buffer. : Left coordinate of destination rectangle. : Top coordinate of destination rectangle. : Right coordinate of destination rectangle. : Bottom coordinate of destination rectangle. : Rowstride of buffer. : Source image RGB buffer. : Width of source image. : Height of source image. : Rowstride of buffer. : Affine transform. : Filter level. : #ArtAlphaGamma for gamma-correcting the compositing.

Affine transform the source image stored in , compositing over the area of destination image specified by the rectangle (, ) - (, ). As usual in libart, the left and top edges of this rectangle are included, and the right and bottom edges are excluded.

The parameter specifies that the alpha compositing be done in a gamma-corrected color space. Since the source image is opaque RGB, this argument only affects the edges. In the current implementation, it is ignored.

The parameter specifies the speed/quality tradeoff of the image interpolation. Currently, only ART_FILTER_NEAREST is implemented.

Definition at line 65 of file art_rgba_affine.c.

  /* Note: this is a slow implementation, and is missing all filter
     levels other than NEAREST. It is here for clarity of presentation
     and to establish the interface. */
  int x, y;
  double inv[6];
  art_u8 *dst_p, *dst_linestart;
  const art_u8 *src_p;
  ArtPoint pt, src_pt;
  int src_x, src_y;
  int run_x0, run_x1;

  dst_linestart = dst;
  art_affine_invert (inv, affine);
  for (y = y0; y < y1; y++)
      pt.y = y + 0.5;
      run_x0 = x0;
      run_x1 = x1;
      art_rgb_affine_run (&run_x0, &run_x1, y, src_width, src_height,
      dst_p = dst_linestart + (run_x0 - x0) * 4;
      for (x = run_x0; x < run_x1; x++)
         pt.x = x + 0.5;
         art_affine_point (&src_pt, &pt, inv);
         src_x = floor (src_pt.x);
         src_y = floor (src_pt.y);
         src_p = src + (src_y * src_rowstride) + src_x * 4;
         dst_p[0] = src_p[0];
         dst_p[1] = src_p[1];
         dst_p[2] = src_p[2];
         dst_p[3] = src_p[3];
         dst_p += 4;
      dst_linestart += dst_rowstride;

Here is the call graph for this function: