Back to index

texmacs  1.0.7.15
Defines | Typedefs | Functions
pdfdraw.h File Reference
#include "pdfcolor.h"
#include "pdfdev.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define PDF_DASH_SIZE_MAX   16
#define PDF_GSAVE_MAX   256
#define pdf_copymatrix(m, n)
#define pdf_setmatrix(m, p, q, r, s, t, u)
#define pdf_concatmatrix(m, n)
#define PDF_FILL_RULE_NONZERO   0
#define PDF_FILL_RULE_EVENODD   1
#define pdf_dev_fill()   pdf_dev_flushpath('f', PDF_FILL_RULE_NONZERO)
#define pdf_dev_eofill()   pdf_dev_flushpath('f', PDF_FILL_RULE_EVENODD)
#define pdf_dev_stroke()   pdf_dev_flushpath('S', PDF_FILL_RULE_NONZERO)
#define pdf_dev_fillstroke()   pdf_dev_flushpath('B', PDF_FILL_RULE_NONZERO)
#define pdf_dev_grestoreall()   pdf_dev_grestore_to(0);
#define pdf_dev_set_strokingcolor(c)   pdf_dev_set_color(c, 0, 0);
#define pdf_dev_set_nonstrokingcolor(c)   pdf_dev_set_color(c, 0x20, 0);

Typedefs

typedef struct pdf_path_

Functions

void pdf_dev_init_gstates (void)
void pdf_dev_clear_gstates (void)
int pdf_dev_currentmatrix (pdf_tmatrix *M)
int pdf_dev_currentpoint (pdf_coord *cp)
int pdf_dev_setlinewidth (double width)
int pdf_dev_setmiterlimit (double mlimit)
int pdf_dev_setlinecap (int style)
int pdf_dev_setlinejoin (int style)
int pdf_dev_setdash (int count, double *pattern, double offset)
int pdf_dev_moveto (double x, double y)
int pdf_dev_rmoveto (double x, double y)
int pdf_dev_closepath (void)
int pdf_dev_lineto (double x0, double y0)
int pdf_dev_rlineto (double x0, double y0)
int pdf_dev_curveto (double x0, double y0, double x1, double y1, double x2, double y2)
int pdf_dev_rcurveto (double x0, double y0, double x1, double y1, double x2, double y2)
int pdf_dev_arc (double c_x, double c_y, double r, double a_0, double a_1)
int pdf_dev_arcn (double c_x, double c_y, double r, double a_0, double a_1)
int pdf_dev_newpath (void)
int pdf_dev_clip (void)
int pdf_dev_eoclip (void)
int pdf_dev_rectfill (double x, double y, double w, double h)
int pdf_dev_rectclip (double x, double y, double w, double h)
int pdf_dev_flushpath (char p_op, int fill_rule)
int pdf_dev_concat (const pdf_tmatrix *M)
void pdf_dev_dtransform (pdf_coord *p, const pdf_tmatrix *M)
void pdf_dev_idtransform (pdf_coord *p, const pdf_tmatrix *M)
void pdf_dev_transform (pdf_coord *p, const pdf_tmatrix *M)
int pdf_dev_gsave (void)
int pdf_dev_grestore (void)
int pdf_dev_push_gstate (void)
int pdf_dev_pop_gstate (void)
int pdf_dev_arcx (double c_x, double c_y, double r_x, double r_y, double a_0, double a_1, int a_d, double xar)
int pdf_dev_bspline (double x0, double y0, double x1, double y1, double x2, double y2)
void pdf_invertmatrix (pdf_tmatrix *M)
int pdf_dev_current_depth (void)
void pdf_dev_grestore_to (int depth)
void pdf_dev_set_color (const pdf_color *color, char mask, int force)
void pdf_dev_reset_color (int force)

Define Documentation

#define pdf_concatmatrix (   m,
  n 
)
Value:
do {\
  double _tmp_a, _tmp_b, _tmp_c, _tmp_d; \
  _tmp_a = (m)->a; _tmp_b = (m)->b; \
  _tmp_c = (m)->c; _tmp_d = (m)->d; \
  (m)->a  = ((n)->a) * _tmp_a + ((n)->b) * _tmp_c; \
  (m)->b  = ((n)->a) * _tmp_b + ((n)->b) * _tmp_d; \
  (m)->c  = ((n)->c) * _tmp_a + ((n)->d) * _tmp_c; \
  (m)->d  = ((n)->c) * _tmp_b + ((n)->d) * _tmp_d; \
  (m)->e += ((n)->e) * _tmp_a + ((n)->f) * _tmp_c; \
  (m)->f += ((n)->e) * _tmp_b + ((n)->f) * _tmp_d; \
} while (0)

Definition at line 50 of file pdfdraw.h.

#define pdf_copymatrix (   m,
  n 
)
Value:
do {\
  (m)->a = (n)->a; (m)->b = (n)->b;\
  (m)->c = (n)->c; (m)->d = (n)->d;\
  (m)->e = (n)->e; (m)->f = (n)->f;\
} while (0)

Definition at line 37 of file pdfdraw.h.

#define PDF_DASH_SIZE_MAX   16

Definition at line 31 of file pdfdraw.h.

Definition at line 118 of file pdfdraw.h.

Definition at line 117 of file pdfdraw.h.

Definition at line 120 of file pdfdraw.h.

Definition at line 160 of file pdfdraw.h.

#define pdf_dev_set_nonstrokingcolor (   c)    pdf_dev_set_color(c, 0x20, 0);

Definition at line 164 of file pdfdraw.h.

#define pdf_dev_set_strokingcolor (   c)    pdf_dev_set_color(c, 0, 0);

Definition at line 163 of file pdfdraw.h.

Definition at line 119 of file pdfdraw.h.

#define PDF_FILL_RULE_EVENODD   1

Definition at line 97 of file pdfdraw.h.

#define PDF_FILL_RULE_NONZERO   0

Definition at line 96 of file pdfdraw.h.

#define PDF_GSAVE_MAX   256

Definition at line 32 of file pdfdraw.h.

#define pdf_setmatrix (   m,
  p,
  q,
  r,
  s,
  t,
 
)
Value:
do {\
  (m)->a = (p); (m)->b = (q);\
  (m)->c = (r); (m)->d = (s);\
  (m)->e = (t); (m)->f = (u);\
} while (0)

Definition at line 43 of file pdfdraw.h.


Typedef Documentation

typedef struct pdf_path_

Definition at line 62 of file pdfdraw.h.


Function Documentation

int pdf_dev_arc ( double  c_x,
double  c_y,
double  r,
double  a_0,
double  a_1 
)

Definition at line 1697 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;
  pdf_coord  *cpt = &gs->cp;
  pdf_coord   c;

  c.x = c_x; c.y = c_y;

  return  pdf_path__elliptarc(cpa, cpt, &c, r, r, 0.0, a_0, a_1, +1);
}

Here is the call graph for this function:

int pdf_dev_arcn ( double  c_x,
double  c_y,
double  r,
double  a_0,
double  a_1 
)

Definition at line 1713 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;
  pdf_coord  *cpt = &gs->cp;
  pdf_coord   c;

  c.x = c_x; c.y = c_y;

  return  pdf_path__elliptarc(cpa, cpt, &c, r, r, 0.0, a_0, a_1, -1);
}

Here is the call graph for this function:

int pdf_dev_arcx ( double  c_x,
double  c_y,
double  r_x,
double  r_y,
double  a_0,
double  a_1,
int  a_d,
double  xar 
)

Definition at line 1728 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;
  pdf_coord  *cpt = &gs->cp;
  pdf_coord   c;

  c.x = c_x; c.y = c_y;

  return  pdf_path__elliptarc(cpa, cpt, &c, r_x, r_y, xar, a_0, a_1, a_d);
}

Here is the call graph for this function:

int pdf_dev_bspline ( double  x0,
double  y0,
double  x1,
double  y1,
double  x2,
double  y2 
)

Definition at line 1747 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;
  pdf_coord  *cpt = &gs->cp;  
  pdf_coord   p1, p2, p3;

  p1.x = x0 + 2.0 * (x1 - x0) / 3.0;
  p1.y = y0 + 2.0 * (y1 - y0) / 3.0;
  p2.x = x1 + (x2 - x1) / 3.0;
  p2.y = y1 + (y2 - y1) / 3.0;
  p3.x = x2;
  p3.y = y2;

  return  pdf_path__curveto(cpa, cpt, &p1, &p2, &p3);
}

Here is the call graph for this function:

void pdf_dev_clear_gstates ( void  )

Definition at line 1088 of file pdfdraw.c.

{
  pdf_gstate *gs;

  if (m_stack_depth(&gs_stack) > 1) /* at least 1 elem. */
    WARN("GS stack depth is not zero at the end of the document.");

  while ((gs = m_stack_pop(&gs_stack)) != NULL) {
    clear_a_gstate(gs);
    RELEASE(gs);
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_clip ( void  )

Definition at line 1479 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;

  return pdf_dev__flushpath(NULL, cpa, 'W', PDF_FILL_RULE_NONZERO, 0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_closepath ( void  )

Definition at line 1627 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_coord  *cpt = &gs->cp;
  pdf_path   *cpa = &gs->path;

  return pdf_path__closepath(cpa, cpt);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_concat ( const pdf_tmatrix M)

Definition at line 1305 of file pdfdraw.c.

{
  m_stack     *gss = &gs_stack;
  pdf_gstate  *gs  = m_stack_top(gss);
  pdf_path    *cpa = &gs->path;
  pdf_coord   *cpt = &gs->cp;
  pdf_tmatrix *CTM = &gs->matrix;
  pdf_tmatrix  W   = {0, 0, 0, 0, 0, 0};  /* Init to avoid compiler warning */
  char        *buf = FORMAT_BUFF_PTR(NULL);
  int          len = 0;

  ASSERT(M);

  /* Adobe Reader erases page content if there are
   * non invertible transformation.
   */
  if (fabs(detP(M)) < 1.0e-8) {
    WARN("Transformation matrix not invertible.");
    WARN("--- M = [%g %g %g %g %g %g]",
         M->a, M->b, M->c, M->d, M->e, M->f);
    return -1;
  }

  buf[len++] = ' ';
  len += pdf_sprint_matrix(buf + len, M);
  buf[len++] = ' ';
  buf[len++] = 'c';
  buf[len++] = 'm';
  pdf_doc_add_page_content(buf, len);  /* op: cm */

  pdf_concatmatrix(CTM, M);

  inversematrix(&W, M);

  pdf_path__transform (cpa, &W);
  pdf_coord__transform(cpt, &W);

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_current_depth ( void  )

Definition at line 1176 of file pdfdraw.c.

{
  return (m_stack_depth(&gs_stack) - 1); /* 0 means initial state */
}

Here is the caller graph for this function:

Definition at line 1219 of file pdfdraw.c.

{
  m_stack     *gss = &gs_stack;
  pdf_gstate  *gs  = m_stack_top(gss);
  pdf_tmatrix *CTM = &gs->matrix;

  ASSERT(M);

  pdf_copymatrix(M, CTM);

  return 0;
}

Here is the call graph for this function:

Definition at line 1205 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_coord  *cpt = &gs->cp;

  ASSERT(p);

  p->x = cpt->x; p->y = cpt->y;

  return 0;
}

Here is the call graph for this function:

int pdf_dev_curveto ( double  x0,
double  y0,
double  x1,
double  y1,
double  x2,
double  y2 
)

Definition at line 1590 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;
  pdf_coord  *cpt = &gs->cp;
  pdf_coord   p0, p1, p2;

  p0.x = x0; p0.y = y0;
  p1.x = x1; p1.y = y1;
  p2.x = x2; p2.y = y2;

  return pdf_path__curveto(cpa, cpt, &p0, &p1, &p2);
}

Here is the call graph for this function:

void pdf_dev_dtransform ( pdf_coord p,
const pdf_tmatrix M 
)

Definition at line 1639 of file pdfdraw.c.

{
  m_stack     *gss = &gs_stack;
  pdf_gstate  *gs  = m_stack_top(gss);
  pdf_tmatrix *CTM = &gs->matrix;

  ASSERT(p);

  pdf_coord__dtransform(p, (M ? M : CTM));

  return;
}

Here is the call graph for this function:

int pdf_dev_eoclip ( void  )

Definition at line 1489 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;

  return pdf_dev__flushpath(NULL, cpa, 'W', PDF_FILL_RULE_EVENODD, 0);
}

Here is the call graph for this function:

int pdf_dev_flushpath ( char  p_op,
int  fill_rule 
)

Definition at line 1499 of file pdfdraw.c.

{
  m_stack    *gss   = &gs_stack;
  pdf_gstate *gs    = m_stack_top(gss);
  pdf_path   *cpa   = &gs->path;
  int         error = 0;

  /* last arg 'ignore_rule' is only for single object
   * that can be converted to a rect where fill rule
   * is inessential.
   */
  error = pdf_dev__flushpath(NULL, cpa, p_op, fill_rule, 1);
  pdf_path__clearpath(cpa);

  gs->flags &= ~GS_FLAG_CURRENTPOINT_SET;

  return error;
}

Here is the call graph for this function:

int pdf_dev_grestore ( void  )

Definition at line 1119 of file pdfdraw.c.

{
  pdf_gstate *gs;

  if (m_stack_depth(&gs_stack) <= 1) { /* Initial state at bottom */
    WARN("Too many grestores.");
    return  -1;
  }

  gs = m_stack_pop(&gs_stack);
  clear_a_gstate(gs);
  RELEASE(gs);

  pdf_doc_add_page_content(" Q", 2);  /* op: Q */

  pdf_dev_reset_fonts();

  return  0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pdf_dev_grestore_to ( int  depth)

Definition at line 1182 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs;

  ASSERT(depth >= 0);

  if (m_stack_depth(gss) > depth + 1) {
    WARN("Closing pending transformations at end of page/XObject.");
  }

  while (m_stack_depth(gss) > depth + 1) {
    pdf_doc_add_page_content(" Q", 2);  /* op: Q */
    gs = m_stack_pop(gss);
    clear_a_gstate(gs);
    RELEASE(gs);
  }
  pdf_dev_reset_fonts();

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_gsave ( void  )

Definition at line 1103 of file pdfdraw.c.

{
  pdf_gstate *gs0, *gs1;

  gs0 = m_stack_top(&gs_stack);
  gs1 = NEW(1, pdf_gstate);
  init_a_gstate(gs1);
  copy_a_gstate(gs1, gs0);
  m_stack_push(&gs_stack, gs1);

  pdf_doc_add_page_content(" q", 2);  /* op: q */

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pdf_dev_idtransform ( pdf_coord p,
const pdf_tmatrix M 
)

Definition at line 1653 of file pdfdraw.c.

{
  m_stack     *gss = &gs_stack;
  pdf_gstate  *gs  = m_stack_top(gss);
  pdf_tmatrix *CTM = &gs->matrix;

  ASSERT(p);

  pdf_coord__idtransform(p, (M ? M : CTM));

  return;
}

Here is the call graph for this function:

void pdf_dev_init_gstates ( void  )

Definition at line 1073 of file pdfdraw.c.

{
  pdf_gstate *gs;

  m_stack_init(&gs_stack);

  gs = NEW(1, pdf_gstate);
  init_a_gstate(gs);

  m_stack_push(&gs_stack, gs); /* Initial state */

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_lineto ( double  x0,
double  y0 
)

Definition at line 1562 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;
  pdf_coord  *cpt = &gs->cp;
  pdf_coord   p0;

  p0.x = x; p0.y = y;

  return pdf_path__lineto(cpa, cpt, &p0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_moveto ( double  x,
double  y 
)

Definition at line 1535 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;
  pdf_coord  *cpt = &gs->cp;
  pdf_coord   p;

  p.x = x; p.y = y;
  return pdf_path__moveto(cpa, cpt, &p); /* cpt updated */
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_newpath ( void  )

Definition at line 1519 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *p   = &gs->path;

  if (PA_LENGTH(p) > 0) {
    pdf_path__clearpath (p);
  }
  /* The following is required for "newpath" operator in mpost.c. */
  pdf_doc_add_page_content(" n", 2);  /* op: n */

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_pop_gstate ( void  )

Definition at line 1157 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs;

  if (m_stack_depth(gss) <= 1) { /* Initial state at bottom */
    WARN("Too many grestores.");
    return  -1;
  }

  gs = m_stack_pop(gss);
  clear_a_gstate(gs);
  RELEASE(gs);

  return  0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_push_gstate ( void  )

Definition at line 1141 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs0;

  gs0 = NEW(1, pdf_gstate);

  init_a_gstate(gs0);

  m_stack_push(gss, gs0);

  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_rcurveto ( double  x0,
double  y0,
double  x1,
double  y1,
double  x2,
double  y2 
)

Definition at line 1608 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;
  pdf_coord  *cpt = &gs->cp;
  pdf_coord   p0, p1, p2;

  p0.x = x0 + cpt->x; p0.y = y0 + cpt->y;
  p1.x = x1 + cpt->x; p1.y = y1 + cpt->y;
  p2.x = x2 + cpt->x; p2.y = y2 + cpt->y;

  return pdf_path__curveto(cpa, cpt, &p0, &p1, &p2);
}

Here is the call graph for this function:

int pdf_dev_rectclip ( double  x,
double  y,
double  w,
double  h 
)

Definition at line 1800 of file pdfdraw.c.

{
  pdf_rect r;

  r.llx = x;
  r.lly = y;
  r.urx = x + w;
  r.ury = y + h;
  
  return  pdf_dev__rectshape(NULL, &r, NULL, 'W');
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_rectfill ( double  x,
double  y,
double  w,
double  h 
)

Definition at line 1786 of file pdfdraw.c.

{
  pdf_rect r;

  r.llx = x;
  r.lly = y;
  r.urx = x + w;
  r.ury = y + h;

  return  pdf_dev__rectshape(NULL, &r, NULL, 'f');
}

Here is the call graph for this function:

Here is the caller graph for this function:

void pdf_dev_reset_color ( int  force)

Definition at line 1295 of file pdfdraw.c.

{
  pdf_color *sc, *fc;

  pdf_color_get_current(&sc, &fc);
  pdf_dev_set_color(sc,    0, force);
  pdf_dev_set_color(fc, 0x20, force);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_rlineto ( double  x0,
double  y0 
)

Definition at line 1576 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;
  pdf_coord  *cpt = &gs->cp;
  pdf_coord   p0;

  p0.x = x + cpt->x; p0.y = y + cpt->y;

  return pdf_path__lineto(cpa, cpt, &p0);
}

Here is the call graph for this function:

int pdf_dev_rmoveto ( double  x,
double  y 
)

Definition at line 1548 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  pdf_path   *cpa = &gs->path;
  pdf_coord  *cpt = &gs->cp;
  pdf_coord   p;

  p.x = cpt->x + x;
  p.y = cpt->y + y;
  return pdf_path__moveto(cpa, cpt, &p); /* cpt updated */
}

Here is the call graph for this function:

void pdf_dev_set_color ( const pdf_color color,
char  mask,
int  force 
)

Definition at line 1256 of file pdfdraw.c.

{
  int len;

  pdf_gstate *gs  = m_stack_top(&gs_stack);
  pdf_color *current = mask ? &gs->fillcolor : &gs->strokecolor;

  ASSERT(pdf_color_is_valid(color));

  if (!(pdf_dev_get_param(PDF_DEV_PARAM_COLORMODE) &&
       (force || pdf_color_compare(color, current))))
    /* If "color" is already the current color, then do nothing
     * unless a color operator is forced
     */
    return;

  graphics_mode();
  len = pdf_color_to_string(color, fmt_buf);
  fmt_buf[len++] = ' ';
  switch (pdf_color_type(color)) {
  case  PDF_COLORSPACE_TYPE_RGB:
    fmt_buf[len++] = 'R' | mask;
    fmt_buf[len++] = 'G' | mask;
    break;
  case  PDF_COLORSPACE_TYPE_CMYK:
    fmt_buf[len++] = 'K' | mask;
    break;
  case  PDF_COLORSPACE_TYPE_GRAY:
    fmt_buf[len++] = 'G' | mask;
    break;
  default: /* already verified the given color */
    break;
  }
  pdf_doc_add_page_content(fmt_buf, len);  /* op: RG K G rg k g */

  pdf_color_copycolor(current, color);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int pdf_dev_setdash ( int  count,
double *  pattern,
double  offset 
)

Definition at line 1430 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  int         len = 0;
  char       *buf = FORMAT_BUFF_PTR(NULL);
  int         i;

  gs->linedash.num_dash = count;
  gs->linedash.offset   = offset;
  pdf_doc_add_page_content(" [", 2);  /* op: */
  for (i = 0; i < count; i++) {
    buf[0] = ' ';
    len = pdf_sprint_length (buf + 1, pattern[i]);
    pdf_doc_add_page_content(buf, len + 1);  /* op: */
    gs->linedash.pattern[i] = pattern[i];
  }
  pdf_doc_add_page_content("] ", 2);  /* op: */
  len = pdf_sprint_length (buf, offset);
  pdf_doc_add_page_content(buf, len);  /* op: */
  pdf_doc_add_page_content(" d", 2);  /* op: d */

  return 0;
}

Here is the call graph for this function:

int pdf_dev_setlinecap ( int  style)

Definition at line 1376 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  int         len = 0;
  char       *buf = FORMAT_BUFF_PTR(NULL);

  if (gs->linecap != capstyle) {
    len = sprintf(buf, " %d J", capstyle);
    pdf_doc_add_page_content(buf, len);  /* op: J */
    gs->linecap = capstyle;
  }

  return 0;
}

Here is the call graph for this function:

int pdf_dev_setlinejoin ( int  style)

Definition at line 1393 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  int         len = 0;
  char       *buf = FORMAT_BUFF_PTR(NULL);

  if (gs->linejoin != joinstyle) {
    len = sprintf(buf, " %d j", joinstyle);
    pdf_doc_add_page_content(buf, len);  /* op: j */
    gs->linejoin = joinstyle;
  }

  return 0;
}

Here is the call graph for this function:

int pdf_dev_setlinewidth ( double  width)

Definition at line 1410 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);  
  int         len = 0;
  char       *buf = FORMAT_BUFF_PTR(NULL);

  if (gs->linewidth != width) {
    buf[len++] = ' ';
    len += pdf_sprint_length(buf + len, width);
    buf[len++] = ' ';
    buf[len++] = 'w';
    pdf_doc_add_page_content(buf, len);  /* op: w */
    gs->linewidth = width;
  }

  return 0;
}

Here is the call graph for this function:

int pdf_dev_setmiterlimit ( double  mlimit)

Definition at line 1356 of file pdfdraw.c.

{
  m_stack    *gss = &gs_stack;
  pdf_gstate *gs  = m_stack_top(gss);
  int         len = 0;
  char       *buf = FORMAT_BUFF_PTR(NULL);

  if (gs->miterlimit != mlimit) {
    buf[len++] = ' ';
    len += pdf_sprint_length(buf + len, mlimit);
    buf[len++] = ' ';
    buf[len++] = 'M';
    pdf_doc_add_page_content(buf, len);  /* op: M */
    gs->miterlimit = mlimit;
  }

  return 0;
}

Here is the call graph for this function:

void pdf_dev_transform ( pdf_coord p,
const pdf_tmatrix M 
)

Definition at line 1667 of file pdfdraw.c.

{
  m_stack     *gss = &gs_stack;
  pdf_gstate  *gs  = m_stack_top(gss);
  pdf_tmatrix *CTM = &gs->matrix;

  ASSERT(p);

  pdf_coord__transform(p, (M ? M : CTM));

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 194 of file pdfdraw.c.

{
  pdf_tmatrix W;  
  double      det;

  ASSERT(M);

  det = detP(M);
  if (fabs(det) < 1.e-8) {
    WARN("Inverting matrix with zero determinant...");
    W.a = 1.0; W.c = 0.0;
    W.b = 0.0; W.d = 1.0;
    W.e = 0.0; W.f = 0.0;
  } else {
    W.a =  (M->d) / det;  W.b = -(M->b) / det;
    W.c = -(M->c) / det;  W.d =  (M->a) / det;
    W.e =  (M->c) * (M->f) - (M->d) * (M->e);
    W.f =  (M->b) * (M->e) - (M->a) * (M->f);
  }

  pdf_copymatrix(M, &W);

  return;
}

Here is the call graph for this function: