2026-04-28 15:47:57 -04:00
|
|
|
<script setup>
|
feat: full GUI, test API, auto-convert, aspect-ratio sliders
- Auto-convert on image load (0ms) and flag change (400ms debounce)
- SizeControl: linked width/height sliders with aspect-ratio lock and 0.5 font correction factor
- Full flag exposure for all 4 tools (chafa, jp2a, ascii-image-converter, img2txt)
- ChafaOptions: symbols/fill dropdowns, dither controls, work/threshold/font-ratio sliders, format select, toggles
- Jp2aOptions: color-depth, RGB weight sliders, edge controls, 8 toggles
- ImgTxtOptions: dither select with valid libcaca values, gamma slider
- OutputDisplay: ansi-to-html rendering for colored chafa output
- ShellBridge: abort-previous pattern, conversion-start/end lifecycle events
- Test API (ENABLE_TEST_API=true): /test/health, /test/convert, /test/flags/:tool, /test/imagemagick
- buildArgs: space-separated args (not = format); full schemas in SCHEMAS export
- runChafa: width/height destructured and combined into --size WxH
- Port changed to 3050; Vite on 0.0.0.0 with allowedHosts for production domain
- 98 unit tests passing across 12 test files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 06:29:45 -04:00
|
|
|
import SizeControl from '../SizeControl.vue'
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
flags: { type: Object, required: true },
|
|
|
|
|
imageDims: { type: Object, default: null },
|
|
|
|
|
})
|
2026-04-28 15:47:57 -04:00
|
|
|
const emit = defineEmits(['update:flags'])
|
|
|
|
|
|
|
|
|
|
const set = (key, val) => emit('update:flags', { ...props.flags, [key]: val })
|
feat: full GUI, test API, auto-convert, aspect-ratio sliders
- Auto-convert on image load (0ms) and flag change (400ms debounce)
- SizeControl: linked width/height sliders with aspect-ratio lock and 0.5 font correction factor
- Full flag exposure for all 4 tools (chafa, jp2a, ascii-image-converter, img2txt)
- ChafaOptions: symbols/fill dropdowns, dither controls, work/threshold/font-ratio sliders, format select, toggles
- Jp2aOptions: color-depth, RGB weight sliders, edge controls, 8 toggles
- ImgTxtOptions: dither select with valid libcaca values, gamma slider
- OutputDisplay: ansi-to-html rendering for colored chafa output
- ShellBridge: abort-previous pattern, conversion-start/end lifecycle events
- Test API (ENABLE_TEST_API=true): /test/health, /test/convert, /test/flags/:tool, /test/imagemagick
- buildArgs: space-separated args (not = format); full schemas in SCHEMAS export
- runChafa: width/height destructured and combined into --size WxH
- Port changed to 3050; Vite on 0.0.0.0 with allowedHosts for production domain
- 98 unit tests passing across 12 test files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 06:29:45 -04:00
|
|
|
const setNum = (key, val) => set(key, val === '' ? '' : Number(val))
|
2026-04-28 15:47:57 -04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
feat: full GUI, test API, auto-convert, aspect-ratio sliders
- Auto-convert on image load (0ms) and flag change (400ms debounce)
- SizeControl: linked width/height sliders with aspect-ratio lock and 0.5 font correction factor
- Full flag exposure for all 4 tools (chafa, jp2a, ascii-image-converter, img2txt)
- ChafaOptions: symbols/fill dropdowns, dither controls, work/threshold/font-ratio sliders, format select, toggles
- Jp2aOptions: color-depth, RGB weight sliders, edge controls, 8 toggles
- ImgTxtOptions: dither select with valid libcaca values, gamma slider
- OutputDisplay: ansi-to-html rendering for colored chafa output
- ShellBridge: abort-previous pattern, conversion-start/end lifecycle events
- Test API (ENABLE_TEST_API=true): /test/health, /test/convert, /test/flags/:tool, /test/imagemagick
- buildArgs: space-separated args (not = format); full schemas in SCHEMAS export
- runChafa: width/height destructured and combined into --size WxH
- Port changed to 3050; Vite on 0.0.0.0 with allowedHosts for production domain
- 98 unit tests passing across 12 test files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 06:29:45 -04:00
|
|
|
<div class="flex flex-col gap-5">
|
|
|
|
|
|
|
|
|
|
<!-- Size -->
|
|
|
|
|
<div>
|
|
|
|
|
<p class="text-xs uppercase tracking-wider mb-2" style="color: rgba(224,224,224,.35)">Size</p>
|
|
|
|
|
<SizeControl
|
|
|
|
|
:width="flags.width" :height="flags.height" :image-dims="imageDims"
|
|
|
|
|
@update:width="setNum('width', $event)"
|
|
|
|
|
@update:height="setNum('height', $event)"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Format & Dither -->
|
|
|
|
|
<div>
|
|
|
|
|
<p class="text-xs uppercase tracking-wider mb-2" style="color: rgba(224,224,224,.35)">Output</p>
|
|
|
|
|
<div class="grid grid-cols-2 gap-3">
|
|
|
|
|
<label class="ascii-label">
|
|
|
|
|
Format
|
|
|
|
|
<select class="ascii-input" :value="flags.format" @change="set('format', $event.target.value)">
|
|
|
|
|
<option value="">default</option>
|
|
|
|
|
<option>ansi</option><option>utf8</option><option>html</option>
|
|
|
|
|
</select>
|
|
|
|
|
</label>
|
|
|
|
|
<label class="ascii-label">
|
|
|
|
|
Dither
|
|
|
|
|
<select class="ascii-input" :value="flags.dither" @change="set('dither', $event.target.value)">
|
|
|
|
|
<option value="">default</option>
|
|
|
|
|
<option>none</option><option>ordered2</option><option>ordered4</option>
|
|
|
|
|
<option>ordered8</option><option>random</option><option>fstein</option>
|
|
|
|
|
</select>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Gamma -->
|
|
|
|
|
<div>
|
|
|
|
|
<p class="text-xs uppercase tracking-wider mb-2" style="color: rgba(224,224,224,.35)">Gamma</p>
|
|
|
|
|
<label class="ascii-label">
|
|
|
|
|
Gamma — {{ flags.gamma !== '' && flags.gamma !== undefined ? Number(flags.gamma).toFixed(1) : '1.0' }}
|
|
|
|
|
<input type="range" min="0.1" max="3.0" step="0.1"
|
|
|
|
|
:value="flags.gamma ?? 1.0"
|
|
|
|
|
@input="set('gamma', $event.target.value)"
|
|
|
|
|
class="w-full" style="accent-color: var(--ascii-green)" />
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-04-28 15:47:57 -04:00
|
|
|
</div>
|
|
|
|
|
</template>
|