#!/bin/bash
# Showcase A: Glitch Corruption Pack
# 10 prompts - extreme glitch aesthetics

set -e

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
OUTPUT_DIR="$SCRIPT_DIR/../renders/showcase-glitch-$(date +%Y%m%d)"

mkdir -p "$OUTPUT_DIR"

echo "Showcase A: Glitch Corruption Pack..."
echo "Output: $OUTPUT_DIR"

generate() {
    local prompt="$1"
    local prefix="$2"
    bash "$SCRIPT_DIR/../../shared/scripts/cf-generate-wp.sh" "$prompt" "$OUTPUT_DIR" "$prefix" 8
}

# A1: Vertical Pixel Sort
generate "Cyberpunk alley with vertical pixel sorting, neon signs streak down in magenta cyan columns. Minimal anime style. Reality sorted by brightness creating abstract patterns. Buildings dissolve into vertical data streams. Wet pavement reflects pixel sorted columns. 1920x1080 widescreen." "showcase_A_pixelsort"

# A2: RGB Chromatic Aberration
generate "Street with horizontal RGB chromatic aberration, reality splits into red green blue offset. Glitch aesthetic. Every neon sign triples into color displacement. Wet surfaces mirror the split. Empty glitch atmosphere. 1920x1080 widescreen." "showcase_A_rgb"

# A3: JPEG Databending
generate "Convenience store with JPEG databending artifacts, block compression errors. Magenta cyan corruption. Reality compressed into lossy artifacts. Vending machines render as scan line corruption. Wet floor reflects glitch patterns. 1920x1080 widescreen." "showcase_A_jpeg"

# A4: Scan Line Cascade
generate "Alley with scan line cascade glitch, upper stable lower dissolving into color bars. Anime style. CRT failure meets digital decay. Neon signs fragment into stacked stripes of magenta cyan purple. Empty scene falling apart. 1920x1080 widescreen." "showcase_A_scanline"

# A5: Displacement Map
generate "Street with displacement map warp, neon bends like fabric under stress. Cyberpunk glitch. Reality distorts through invisible wave patterns. Stair geometry creates impossible perspectives. Magenta and cyan neon warps. Wet surfaces mirror displacement. 1920x1080 widescreen." "showcase_A_displacement"

# A6: Interlacing
generate "Platform with interlacing artifacts, odd even lines offset creating comb effect. Minimal style. Video corruption aesthetic. CRT simulation gone wrong. Warning lights stutter and duplicate. Empty platform with digital artifacts. 1920x1080 widescreen." "showcase_A_interlace"

# A7: Posterization
generate "Corridor with posterization glitch, colors reduced to 4-bit CGA palette bands. Retro aesthetic. Harsh color banding creates blocky gradients. Purple and cyan rendered in stark steps. Digital color depth reduction. Empty corridor with CGA bands. 1920x1080 widescreen." "showcase_A_posterize"

# A8: Mirror Glitch
generate "Alley with mirror glitch, reality duplicates and reflects incorrectly. Digital corruption. Objects multiply in wrong locations. Neon signs reflect where they shouldn't. Wet pavement shows impossible reflections. Empty surreal glitch space. 1920x1080 widescreen." "showcase_A_mirror"

# A9: Bloom Overflow
generate "Store with bloom overflow, neon bleeds excessively creating abstract halos. Cyberpunk style. Light overexposes into pure white color bleeding. Magenta and cyan neon lose definition. Brightest areas flare uncontrollably. Digital exposure corruption. 1920x1080 widescreen." "showcase_A_bloom"

# A10: Bitcrush
generate "Store with bitcrush reduction, image reduced to low bit depth creating banding. Glitch aesthetic. Color depth minimized creating visible steps. Neon gradients become blocky. Digital bit rate corruption. CGA banding emerges. 1920x1080 widescreen." "showcase_A_bitcrush"

echo "Showcase A complete: 10 glitch corruption wallpapers"