~ubuntu-branches/ubuntu/hardy/ghostscript/hardy

« back to all changes in this revision

Viewing changes to src/zshade.c

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2007-11-22 12:17:43 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071122121743-cd70s3ypq0r243mp
Tags: 8.61.dfsg.1-0ubtuntu1
* New upstream release
  o Final 8.61 release
* debian/patches/09_ijs_krgb_support.dpatch: Adapted to upstream changes.
* debian/rules: Updated CUPS-related variables for "make install" calls.
* debian/rules: Remove /usr/include/ghostscript from the ghostscript
  package, they go into lings-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12
12
*/
13
13
 
14
 
/* $Id: zshade.c 8022 2007-06-05 22:23:38Z giles $ */
 
14
/* $Id: zshade.c 8250 2007-09-25 13:31:24Z giles $ */
15
15
/* PostScript language interface to shading */
16
16
#include "memory_.h"
17
17
#include "ghost.h"
36
36
#include "store.h"
37
37
 
38
38
/* Forward references */
39
 
private int shading_param(const_os_ptr op, const gs_shading_t ** ppsh);
 
39
static int shading_param(const_os_ptr op, const gs_shading_t ** ppsh);
40
40
 
41
41
/* ---------------- Standard operators ---------------- */
42
42
 
43
43
/* - currentsmoothness <smoothness> */
44
 
private int
 
44
static int
45
45
zcurrentsmoothness(i_ctx_t *i_ctx_p)
46
46
{
47
47
    os_ptr op = osp;
52
52
}
53
53
 
54
54
/* <smoothness> setsmoothness - */
55
 
private int
 
55
static int
56
56
zsetsmoothness(i_ctx_t *i_ctx_p)
57
57
{
58
58
    os_ptr op = osp;
68
68
}
69
69
 
70
70
/* <shading> .shfill - */
71
 
private int
 
71
static int
72
72
zshfill(i_ctx_t *i_ctx_p)
73
73
{
74
74
    os_ptr op = osp;
84
84
/* ------ Non-standard operators ------ */
85
85
 
86
86
/* <pattern> <matrix> <shading> .buildshadingpattern <pattern> <instance> */
87
 
private int
 
87
static int
88
88
zbuildshadingpattern(i_ctx_t *i_ctx_p)
89
89
{
90
90
    os_ptr op = osp;
120
120
/* ------ Internal procedures ------ */
121
121
 
122
122
/* Get a shading parameter. */
123
 
private int
 
123
static int
124
124
shading_param(const_os_ptr op, const gs_shading_t ** ppsh)
125
125
{       /*
126
126
         * Since shadings form a subclass hierarchy, we currently have
147
147
/* Operators */
148
148
 
149
149
/* Common framework for building shadings. */
150
 
private int
 
150
static int
151
151
build_shading(i_ctx_t *i_ctx_p, build_shading_proc_t proc)
152
152
{
153
153
    os_ptr op = osp;
241
241
}
242
242
 
243
243
/* Collect a Function value. */
244
 
private int
 
244
static int
245
245
build_shading_function(i_ctx_t *i_ctx_p, const ref * op, gs_function_t ** ppfn,
246
246
                 int num_inputs, gs_memory_t *mem, const float *shading_domain)
247
247
{
299
299
 * this applies to any shading dictionary that contains a Function entry."
300
300
 * Adobe interpreters follow PLRM in this respect and we follow them.
301
301
 */
302
 
private int
 
302
static int
303
303
check_indexed_vs_function(i_ctx_t *i_ctx_p, const ref *op,
304
304
                          const gs_color_space *pcs, const gs_function_t *funct)
305
305
{ if (funct && gs_color_space_get_index(pcs) == gs_color_space_index_Indexed) {
315
315
/* ------ Build shadings ------ */
316
316
 
317
317
/* Build a ShadingType 1 (Function-based) shading. */
318
 
private int
 
318
static int
319
319
build_shading_1(i_ctx_t *i_ctx_p, const ref * op, const gs_shading_params_t * pcommon,
320
320
                gs_shading_t ** ppsh, gs_memory_t *mem)
321
321
{
361
361
    return code;
362
362
}
363
363
/* <dict> .buildshading1 <shading_struct> */
364
 
private int
 
364
static int
365
365
zbuildshading1(i_ctx_t *i_ctx_p)
366
366
{
367
367
    return build_shading(i_ctx_p, build_shading_1);
368
368
}
369
369
 
370
370
/* Collect parameters for an Axial or Radial shading. */
371
 
private int
 
371
static int
372
372
build_directional_shading(i_ctx_t *i_ctx_p, const ref * op, float *Coords, int num_Coords,
373
373
                          float Domain[2], gs_function_t ** pFunction,
374
374
                          bool Extend[2], gs_memory_t *mem)
408
408
}
409
409
 
410
410
/* Build a ShadingType 2 (Axial) shading. */
411
 
private int
 
411
static int
412
412
build_shading_2(i_ctx_t *i_ctx_p, const ref * op, const gs_shading_params_t * pcommon,
413
413
                gs_shading_t ** ppsh, gs_memory_t *mem)
414
414
{
427
427
    return code;
428
428
}
429
429
/* <dict> .buildshading2 <shading_struct> */
430
 
private int
 
430
static int
431
431
zbuildshading2(i_ctx_t *i_ctx_p)
432
432
{
433
433
    return build_shading(i_ctx_p, build_shading_2);
434
434
}
435
435
 
436
436
/* Build a ShadingType 3 (Radial) shading. */
437
 
private int
 
437
static int
438
438
build_shading_3(i_ctx_t *i_ctx_p, const ref * op, const gs_shading_params_t * pcommon,
439
439
                gs_shading_t ** ppsh, gs_memory_t *mem)
440
440
{
455
455
    return code;
456
456
}
457
457
/* <dict> .buildshading3 <shading_struct> */
458
 
private int
 
458
static int
459
459
zbuildshading3(i_ctx_t *i_ctx_p)
460
460
{
461
461
    return build_shading(i_ctx_p, build_shading_3);
462
462
}
463
463
 
464
464
/* Collect parameters for a mesh shading. */
465
 
private int
 
465
static int
466
466
build_mesh_shading(i_ctx_t *i_ctx_p, const ref * op,
467
467
                   gs_shading_mesh_params_t * params,
468
468
                   float **pDecode, gs_function_t ** pFunction,
550
550
}
551
551
 
552
552
/* Collect the BitsPerFlag parameter, if relevant. */
553
 
private int
 
553
static int
554
554
flag_bits_param(const ref * op, const gs_shading_mesh_params_t * params,
555
555
                int *pBitsPerFlag)
556
556
{
563
563
}
564
564
 
565
565
/* Build a ShadingType 4 (Free-form Gouraud triangle mesh) shading. */
566
 
private int
 
566
static int
567
567
build_shading_4(i_ctx_t *i_ctx_p, const ref * op, const gs_shading_params_t * pcommon,
568
568
                gs_shading_t ** ppsh, gs_memory_t *mem)
569
569
{
585
585
    return code;
586
586
}
587
587
/* <dict> .buildshading4 <shading_struct> */
588
 
private int
 
588
static int
589
589
zbuildshading4(i_ctx_t *i_ctx_p)
590
590
{
591
591
    return build_shading(i_ctx_p, build_shading_4);
592
592
}
593
593
 
594
594
/* Build a ShadingType 5 (Lattice-form Gouraud triangle mesh) shading. */
595
 
private int
 
595
static int
596
596
build_shading_5(i_ctx_t *i_ctx_p, const ref * op, const gs_shading_params_t * pcommon,
597
597
                gs_shading_t ** ppsh, gs_memory_t *mem)
598
598
{
614
614
    return code;
615
615
}
616
616
/* <dict> .buildshading5 <shading_struct> */
617
 
private int
 
617
static int
618
618
zbuildshading5(i_ctx_t *i_ctx_p)
619
619
{
620
620
    return build_shading(i_ctx_p, build_shading_5);
621
621
}
622
622
 
623
623
/* Build a ShadingType 6 (Coons patch mesh) shading. */
624
 
private int
 
624
static int
625
625
build_shading_6(i_ctx_t *i_ctx_p, const ref * op, const gs_shading_params_t * pcommon,
626
626
                gs_shading_t ** ppsh, gs_memory_t *mem)
627
627
{
643
643
    return code;
644
644
}
645
645
/* <dict> .buildshading6 <shading_struct> */
646
 
private int
 
646
static int
647
647
zbuildshading6(i_ctx_t *i_ctx_p)
648
648
{
649
649
    return build_shading(i_ctx_p, build_shading_6);
650
650
}
651
651
 
652
652
/* Build a ShadingType 7 (Tensor product patch mesh) shading. */
653
 
private int
 
653
static int
654
654
build_shading_7(i_ctx_t *i_ctx_p, const ref * op, const gs_shading_params_t * pcommon,
655
655
                gs_shading_t ** ppsh, gs_memory_t *mem)
656
656
{
672
672
    return code;
673
673
}
674
674
/* <dict> .buildshading7 <shading_struct> */
675
 
private int
 
675
static int
676
676
zbuildshading7(i_ctx_t *i_ctx_p)
677
677
{
678
678
    return build_shading(i_ctx_p, build_shading_7);