/* 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 */ #ifndef DK4GRCO_H_INCLUDED /** Avoid multiple inclusions. */ #define DK4GRCO_H_INCLUDED 1 #line 10 "dk4grco.ctr" /** @file dk4grco.h Graphics configuration. */ #ifndef DK4CONF_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4conf.h" #else #include #endif #endif #ifndef DK4PAPER_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4paper.h" #else #include #endif #endif #ifndef DK4CS_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4cs.h" #else #include #endif #endif #ifndef DK4GRA_H_INCLUDED #if DK4_BUILDING_DKTOOLS4 #include "dk4gra.h" #else #include #endif #endif /** Scopes for configuration entries */ enum { /** Base setup like choosing a driver, PS language level. */ DK4_GRA_CONF_SCOPE_SETUP = 0x0001 , /** Setup tasks related to bitmap images. */ DK4_GRA_CONF_SCOPE_IMAGE = 0x0002 , /** Setup tasks related to drawing operations. */ DK4_GRA_CONF_SCOPE_DRAW = 0x0004 , /** Setup tasks related to text typesetting. */ DK4_GRA_CONF_SCOPE_TEXT = 0x0008 , /* ----- Combinations for some programs ----- */ /** The bmpp program only uses base setup and bitmap image setup. */ DK4_GRA_CONF_SCOPE_BMPP = ( DK4_GRA_CONF_SCOPE_SETUP | DK4_GRA_CONF_SCOPE_IMAGE ) , /** The fig2lat program uses all setup features. */ DK4_GRA_CONF_SCOPE_FIG2LAT = ( DK4_GRA_CONF_SCOPE_BMPP | DK4_GRA_CONF_SCOPE_DRAW | DK4_GRA_CONF_SCOPE_TEXT ) }; /** Graphics configuration. */ typedef struct { dk4_paper_size_t media; /**< Paper size to use. */ dk4_cs_conv_ctx_t ctx; /**< Color space conversion context. */ double xres; /**< X resolution. */ double yres; /**< Y resolution. */ double xslp; /**< X-spline length precision. */ double xspp; /**< X-spline parameter precision. */ size_t psi; /**< Paper size index in collection. */ unsigned xsss; /**< X-spline sub segments. */ int driver; /**< Graphics output driver. */ int purpose; /**< Intended output purpose. */ int color; /**< Flag: Colored output. */ int ps_level; /**< PS level, 2 or 3. */ int ps_lzw; /**< Flag: Allow LZW. */ int ps_dsc; /**< Flag: Write DSC comments. */ int img_bg_r; /**< Image background red. */ int img_bg_g; /**< Image background green. */ int img_bg_b; /**< Image background blue. */ int img_bg_f; /**< Flag: Force specified bg. */ int img_dct; /**< Flag: Directly use DCT data. */ int img_int; /**< Flag: Use image interpolation. */ int img_dct_int; /**< Flag: Interpolation for DCT. */ int img_an_bpc; /**< Flag: Analyse bits per sample. */ int img_an_color; /**< Flag: Analyse color usage. */ int img_an_alpha; /**< Flag: Analyse alpha channel use. */ int img_rot; /**< Flag: Allow rotation. */ int img_ign_res; /**< Flag: Ignore resolution chunk. */ int img_ign_asp; /**< Flag: Ignore aspect ratio. */ int use_media; /**< Flag: Fit to paper size. */ int doc_duplex; /**< Flag: Use duplex printing. */ int doc_tumble; /**< Flag: Use duplex and tumble. */ int have_psi; /**< Flag: Have psi number. */ } dk4_gra_conf_t; #ifdef __cplusplus extern "C" { #endif /** Initialize configuration structure. @param conf Configuration structure to initialize. */ void dk4gra_conf_init( dk4_gra_conf_t *conf ); /** Retrieve flags for applying an image from the configuration. @param conf Configuration structure to obtain values from. @return Or-combined set of flags. */ int dk4gra_conf_flags_image( dk4_gra_conf_t const *conf ); /** Retrieve document flags for opening a graphics output structure from the configuration. @param conf Configuration structure to obtain values from. @return Or-combined set of flags. */ int dk4gra_conf_flags_document( dk4_gra_conf_t const *conf ); #ifdef __cplusplus } #endif /* vim: set ai sw=4 ts=4 : */ #endif