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
|
/* Copyright (C) 1997, 1998, 1999 Aladdin Enterprises. 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.
For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
*/
/* $Id$ */
/* DevicePixel color space support */
#include "ghost.h"
#include "oper.h"
#include "igstate.h"
#include "gscspace.h"
#include "gsmatrix.h" /* for gscolor2.h */
#include "gscolor2.h"
#include "gscpixel.h"
/* <array> .setdevicepixelspace - */
private int
zsetdevicepixelspace(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
ref depth;
gs_color_space cs;
int code;
check_read_type(*op, t_array);
if (r_size(op) != 2)
return_error(e_rangecheck);
array_get(op, 1L, &depth);
check_type_only(depth, t_integer);
code = gs_cspace_init_DevicePixel(&cs, (int)depth.value.intval);
if (code < 0)
return code;
code = gs_setcolorspace(igs, &cs);
if (code >= 0)
pop(1);
return code;
}
/* ------ Initialization procedure ------ */
const op_def zcspixel_op_defs[] =
{
{"1.setdevicepixelspace", zsetdevicepixelspace},
op_def_end(0)
};
|