{"version":3,"file":"render-options.mjs","names":[],"sources":["../../src/commands/render-options.ts"],"sourcesContent":["import { Option } from 'commander';\n\nimport { cmdDimensionsParser } from './cmd-dimensions-parser.js';\nimport { cmdFloatParser } from './cmd-float-parser.js';\nimport { cmdIntParser } from './cmd-int-parser.js';\n\nexport const ditherOption = () =>\n  new Option('-d, --dither <dither>', 'dither sizing.')\n    .argParser(cmdDimensionsParser)\n    .default([1, 1], '\"1x1\"');\n\nexport const scalerOption = (type?: 'pre' | 'post'): Option =>\n  new Option(\n    type\n      ? `-${type === 'post' ? 's' : 'S'}, --${type}-scaler <scaler>`\n      : '-s --scaler <scaler>',\n    type ? `${type}-dither pixel scaler` : 'pixel scaler',\n  )\n    .choices([\n      'none',\n      '2x2',\n      '3x3',\n      '4x4',\n      '5x5',\n      '5x6',\n      'scale2x',\n      'scale3x',\n      'scale5x6',\n    ])\n    .default(type === 'pre' ? 'none' : 'none');\n\nexport const paletteOption = (extraChoices: 'depth'[] = []): Option =>\n  new Option(`-p, --palette <pal>`, 'the base palette')\n    .choices(['cga', 'true-cga', 'dga', ...extraChoices])\n    .default('cga');\n\nexport const paletteMixerOption = (): Option =>\n  new Option(`-m, --palette-mixer <pal>`, 'palette mixing function')\n    .choices(['none', '10%', '15%', '25%', '50%', 'soft'])\n    .default('none');\n\nexport const contrastOption = (): Option =>\n  new Option(\n    `-c, --contrast <value>`,\n    'IBM 5153-style contrast knob. <value> should be between 0.0 and 1.0, or false',\n  )\n    .argParser(cmdFloatParser([0.0, 1.0]))\n    .default(false);\n\nexport const blurOption = (): Option =>\n  new Option(`-b, --blur <method>`, 'apply blur')\n    .choices(['none', 'box', 'hbox', 'hblur', 'gauss'])\n    .default('none');\n\nexport const blurAmountOption = (): Option =>\n  new Option(`-a, --blur-amount <amount>`, 'amount of pixels to blur')\n    .argParser(cmdFloatParser([0.0, 100.0]))\n    .default(1.0);\n\nexport const forcePalOption = () =>\n  new Option(`-F, --force-pal <value>`, 'Force ')\n    .choices(['0', '1', '2', '3'])\n    .argParser(cmdIntParser);\n\nexport const formatOption = (): Option =>\n  new Option(\n    '-f, --format <format>',\n    'image format. used when writing to STDOUT',\n  )\n    .choices(['png', 'jpg', 'webp', 'raw'])\n    .default('png');\n\nexport const grayscaleOption = (): Option =>\n  new Option(\n    '--grayscale',\n    'convert the output palette into grayscale',\n  ).default(false);\n\nexport const crtOption = (): Option =>\n  new Option('--crt', 'use CRT-Lite filter').default(false);\n"],"mappings":";;;;;AAMA,MAAa,qBACX,IAAI,OAAO,yBAAyB,gBAAgB,CAAC,CAClD,UAAU,mBAAmB,CAAC,CAC9B,QAAQ,CAAC,GAAG,CAAC,GAAG,SAAO;AAE5B,MAAa,gBAAgB,SAC3B,IAAI,OACF,OACI,IAAI,SAAS,SAAS,MAAM,IAAI,MAAM,KAAK,oBAC3C,wBACJ,OAAO,GAAG,KAAK,wBAAwB,cACzC,CAAC,CACE,QAAQ;CACP;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,CACD,QAAQ,SAAS,QAAQ,SAAS,MAAM;AAE7C,MAAa,iBAAiB,eAA0B,CAAC,MACvD,IAAI,OAAO,uBAAuB,kBAAkB,CAAC,CAClD,QAAQ;CAAC;CAAO;CAAY;CAAO,GAAG;AAAY,CAAC,CAAC,CACpD,QAAQ,KAAK;AAElB,MAAa,2BACX,IAAI,OAAO,6BAA6B,yBAAyB,CAAC,CAC/D,QAAQ;CAAC;CAAQ;CAAO;CAAO;CAAO;CAAO;AAAM,CAAC,CAAC,CACrD,QAAQ,MAAM;AAEnB,MAAa,uBACX,IAAI,OACF,0BACA,+EACF,CAAC,CACE,UAAU,eAAe,CAAC,GAAK,CAAG,CAAC,CAAC,CAAC,CACrC,QAAQ,KAAK;AAElB,MAAa,mBACX,IAAI,OAAO,uBAAuB,YAAY,CAAC,CAC5C,QAAQ;CAAC;CAAQ;CAAO;CAAQ;CAAS;AAAO,CAAC,CAAC,CAClD,QAAQ,MAAM;AAEnB,MAAa,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