| |
| /pliant/graphic/color/database.pli |
| |
| 1 |
submodule "/pliant/storage/database.pli" | |
| 2 |
module "spectrum.pli" | |
| 3 |
module "/pliant/language/unsafe.pli" | |
| 4 |
| |
| 5 |
public | |
| 6 |
| |
| 7 |
type ColorChannel | |
| 8 |
field Set:Str sample | |
| 9 |
field Str options | |
| 10 |
# supported options are: | |
| 11 |
# ink factor multiply ink thickness by factor (default value is 1) | |
| 12 |
# cyan density add some other inks, 0.05 meaning 5% of cyan (default value is 0, negative values are ok) | |
| 13 |
# magenta density | |
| 14 |
# yellow density | |
| 15 |
# black density | |
| 16 |
# dot growth 0.05 means 5% more at 50%, 0 and 100% beein untouched (default value is 0) | |
| 17 |
| |
| 18 |
type ColorPrinter | |
| 19 |
field Str driver | |
| 20 |
field Str model | |
| 21 |
field Str options | |
| 22 |
field Str paper | |
| 23 |
field Float size_x <- 210 | |
| 24 |
field Float size_y <- 297 | |
| 25 |
field Str mode <- "page" | |
| 26 |
field Float margin_left <- 10 | |
| 27 |
field Float margin_top <- 10 | |
| 28 |
field Float margin_right <- 10 | |
| 29 |
field Float margin_bottom <- 20 | |
| 30 |
field Float resolution_x resolution_y <- 300 | |
| 31 |
field Int antialiasing_x antialiasing_y <- 4 | |
| 32 |
field Float sharpening <- undefined | |
| 33 |
field Float limit <- undefined | |
| 34 |
field Float middle <- undefined | |
| 35 |
field Str gamut | |
| 36 |
field Int grid_steps <- 17 | |
| 37 |
| |
| 38 |
type ColorDevice | |
| 39 |
field Str label | |
| 40 |
field Str comment | |
| 41 |
field Set:ColorChannel channel | |
| 42 |
field Set:Str alias | |
| 43 |
field Set:Int grid | |
| 44 |
field Str options | |
| 45 |
field ColorPrinter printer | |
| 46 |
| |
| 47 |
type ColorDatabase | |
| 48 |
field Set:ColorDevice device | |
| 49 |
| |
| 50 |
(gvar Database:ColorDatabase color_database) load "security:/color.pdb" mount "/pliant/color" | |
| 51 |
| |
| 52 |
| |
| 53 |
method ch s0 -> s0 | |
| 54 |
arg Data:ColorChannel ch ; arg ColorSpectrum32 s0 | |
| 55 |
s0 := color_spectrum32 ch:sample:"0" | |
| 56 |
| |
| 57 |
method ch s50 -> s50 | |
| 58 |
arg Data:ColorChannel ch ; arg ColorSpectrum32 s50 | |
| 59 |
s50 := color_spectrum32 ch:sample:"50" | |
| 60 |
| |
| 61 |
method ch s100 -> s100 | |
| 62 |
arg Data:ColorChannel ch ; arg ColorSpectrum32 s100 | |
| 63 |
if (exists ch:sample:"255") | |
| 64 |
s100 := color_spectrum32 ch:sample:"255" | |
| 65 |
else | |
| 66 |
s100 := color_spectrum32 ch:sample:"100" | |
| |