/* Copyright (C) 2018-2020, Dirk Krause SPDX-License-Identifier: BSD-3-Clause */ /* WARNING: This file was generated by the dkct program (see http://dktools.sourceforge.net/ for details). Changes you make here will be lost if dkct is run again! You should modify the original source and run dkct on it. Original source: dk4grco.ctr */ /** @file dk4grco.c The dk4grco module. */ #line 164 "dk4grco.ctr" #include "dk4conf.h" #ifndef DK4GRCO_H_INCLUDED #include "dk4grco.h" #endif #ifndef DK4GRA_H_INCLUDED #include "dk4gra.h" #endif #if DK4_HAVE_ASSERT_H #ifndef ASSERT_H_INCLUDED #include #define ASSERT_H_INCLUDED 1 #endif #endif #line 185 "dk4grco.ctr" void dk4gra_conf_init( dk4_gra_conf_t *conf ) { #if DK4_USE_ASSERT assert(NULL != conf); #endif if (NULL != conf) { conf->media.name = NULL; conf->media.w = 595.0; conf->media.h = 842.0; conf->media.i = 56.0; conf->media.o = 28.0; conf->media.b = 14.0; conf->media.t = 14.0; dk4cs_context_init(&(conf->ctx), NULL); conf->xres = -1.0; /* Not specified */ conf->yres = -1.0; /* Not specified */ conf->xslp = 1.0e-3; conf->xspp = 4.0e-3; conf->psi = 0; conf->xsss = 8U; conf->driver = DK4_GRA_DRIVER_PDF; conf->purpose = DK4_GRA_PURPOSE_OBJECT; conf->color = 1; conf->ps_level = 3; conf->ps_lzw = 0; conf->ps_dsc = 0; conf->img_bg_r = 255; conf->img_bg_g = 255; conf->img_bg_b = 255; conf->img_bg_f = 0; conf->img_dct = 1; conf->img_int = 1; conf->img_dct_int = 0; conf->img_an_bpc = 1; conf->img_an_color = 1; conf->img_an_alpha = 1; conf->img_rot = 0; conf->img_ign_res = 0; conf->img_ign_asp = 0; conf->use_media = 0; conf->doc_duplex = 1; conf->doc_tumble = 0; conf->have_psi = 0; } } int dk4gra_conf_flags_document( dk4_gra_conf_t const *conf ) { int back = 0; #if DK4_USE_ASSERT assert(NULL != conf); #endif if (NULL != conf) { if (DK4_GRA_DRIVER_EPS == conf->driver) { back |= DK4_GRA_DOC_FLAG_EPS; } if (0 == conf->color) { back |= DK4_GRA_DOC_FLAG_FORCE_GRAY; } if (2 == conf->ps_level) { back |= DK4_GRA_DOC_FLAG_PS2; } if (0 != conf->ps_dsc) { back |= DK4_GRA_DOC_FLAG_PS_DSC; } if (0 != conf->doc_tumble) { back |= DK4_GRA_DOC_FLAG_TUMBLE; } else { if (0 != conf->doc_duplex) { back |= DK4_GRA_DOC_FLAG_DUPLEX; } } } return back; } int dk4gra_conf_flags_image( dk4_gra_conf_t const *conf ) { int back = 0; #if DK4_USE_ASSERT assert(NULL != conf); #endif if (NULL != conf) { if (0 != conf->color) { back |= DK4_GRA_IMG_FLAG_COLOR; } if (0 != conf->ps_lzw) { back |= DK4_GRA_IMG_FLAG_LZW; } if (0 != conf->img_dct) { back |= DK4_GRA_IMG_FLAG_DCT; } if (0 != conf->img_int) { back |= DK4_GRA_IMG_FLAG_INTERPOLATION; } if (0 != conf->img_dct_int) { back |= DK4_GRA_IMG_FLAG_DCT_INTERPOLATION; } if (0 != conf->img_an_bpc) { back |= DK4_GRA_IMG_FLAG_ANALYZE_BPC; } if (0 != conf->img_an_color) { back |= DK4_GRA_IMG_FLAG_ANALYZE_COLOR; } if (0 != conf->img_an_alpha) { back |= DK4_GRA_IMG_FLAG_ANALYZE_ALPHA; } if (0 != conf->img_rot) { back |= DK4_GRA_IMG_FLAG_ALLOW_ROTATION; } if (0 != conf->img_ign_res) { back |= DK4_GRA_IMG_FLAG_IGNORE_RESOLUTION; } if (0 != conf->img_ign_asp) { back |= DK4_GRA_IMG_FLAG_IGNORE_ASPECT_RATIO; } } return back; } /* vim: set ai sw=4 ts=4 : */