summaryrefslogtreecommitdiff
path: root/pcl/pcpatxfm.h
blob: d36d7bcab30489d0bff6deac91de059dbd350386 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* Copyright (C) 2001-2012 Artifex Software, Inc.
   All Rights Reserved.

   This software is provided AS-IS with no warranty, either express or
   implied.

   This software is distributed under license and may not be copied,
   modified or distributed except as expressly authorized under the terms
   of the license contained in the file LICENSE in this distribution.

   Refer to licensing information at http://www.artifex.com or contact
   Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,
   CA  94903, U.S.A., +1(415)492-9861, for further information.
*/


/* pcpatxfm.h - interface for the pattern and general PCL transformation code */

#ifndef pcpatxfm_INCLUDED
#define pcpatxfm_INCLUDED

#include "gx.h"
#include "gsmatrix.h"
#include "gscoord.h"
#include "pcstate.h"
#include "pcommand.h"
#include "pcpatrn.h"

/* invert a diagonal matrix (assumed to be non-signular) */
void pcl_invert_mtx(const gs_matrix * pmtx1, gs_matrix * pmtx2);

/* transform a rectangel via a diagonal matrix */
void pcl_transform_rect(const gs_memory_t *mem,
                        const gs_rect *     prect1,
                        gs_rect *           prect2,
                        const gs_matrix *   pmtx
);

/*
 * create a 90 degree rotation matrix (counter clockwise rotation) that includes
 * the transformation required to keep the indicated rectangle in the positive
 * quadrant (with the origin at one corner of the rectangle).
 */
void pcl_make_rotation(
    int           rot,
    floatp        width,
    floatp        height,
    gs_matrix *   pmtx
);

/*
 * Form the transformation matrix required to render a pattern.
 *
 * Note that, though the rotation implicit in the print direction may apply
 * to a pattern transformation, the translation never does.
 */
void pcl_xfm_get_pat_xfm(
    const pcl_state_t * pcs,
    pcl_pattern_t *     pptrn,
    gs_matrix *         pmat
);

/*
 * Reset the PCL pattern reference point. This should be done each time the
 * logical page parameters change. (This would be better done via a reset, but
 * unfortunately there was no reset created for this category of event.)
 */
void pcl_xfm_reset_pcl_pat_ref_pt(pcl_state_t * pcs);

/*
 * Set up the pattern orientation and reference point for PCL. Note that PCL's
 * pattern reference point is kept in logical page space.
 */
void pcl_xfm_pcl_set_pat_ref_pt(pcl_state_t * pcs);

/*
 * Set up the pattern orientatin and reference point for GL. The anchor point
 * is taken as being in the current GL space, and the current transform is
 * assumed properly set. The orientation is that of the logical page.
 */
void pcl_xfm_gl_set_pat_ref_pt(pcl_state_t * pcs);

extern  const pcl_init_t    pcl_xfm_init;

#endif  	/* pcpatxfm_INCLUDED */