// Generated by alef. Do not edit by hand.
@file:Suppress(
    "ktlint:standard:trailing-comma-on-call-site",
    "ktlint:standard:trailing-comma-on-declaration-site",
    "ktlint:standard:spacing-between-declarations-with-comments",
    "ktlint:standard:spacing-between-declarations-with-annotations",
    "ktlint:standard:when-entry-bracing",
    "ktlint:standard:blank-line-between-when-conditions",
    "ktlint:standard:blank-line-before-declaration",
    "ktlint:standard:chain-method-continuation",
    "ktlint:standard:annotation",
    "ktlint:standard:max-line-length",
    "ktlint:standard:no-semi",
    "ktlint:standard:statement-wrapping",
    "MaxLineLength",
    "TooManyFunctions",
    "FunctionParameterNaming",
    "LongParameterList",
    "CyclomaticComplexMethod",
    "LongMethod",
)

package dev.kreuzberg

/** Image extraction configuration. */
data class ImageExtractionConfig(
    /** Extract images from documents */
    val extractImages: Boolean = true,
    /** Target DPI for image normalization */
    val targetDpi: Int = 300,
    /** Maximum dimension for images (width or height) */
    val maxImageDimension: Int = 4096,
    /**
     * Whether to inject image reference placeholders into markdown output.
     * When `true` (default), image references like `![Image 1](embedded:p1_i0)`
     * are appended to the markdown. Set to `false` to extract images as data
     * without polluting the markdown output.
     */
    val injectPlaceholders: Boolean = true,
    /** Automatically adjust DPI based on image content */
    val autoAdjustDpi: Boolean = true,
    /** Minimum DPI threshold */
    val minDpi: Int = 72,
    /** Maximum DPI threshold */
    val maxDpi: Int = 600,
    /**
     * Maximum number of image objects to extract per PDF page.
     *
     * Some PDFs (e.g. technical diagrams stored as thousands of raster fragments)
     * can trigger extremely long or indefinite extraction times when every image
     * object on a dense page is decoded individually via the PDF extractor. Setting this
     * limit causes kreuzberg to stop collecting individual images once the count
     * per page reaches the cap and emit a warning instead.
     *
     * `null` (default) means no limit — all images are extracted.
     */
    val maxImagesPerPage: Int? = null,
    /**
     * When `true` (default), extracted images are classified by kind and grouped
     * into clusters where they appear to belong to one figure.
     */
    val classify: Boolean = true,
    /**
     * When `true`, full-page renders produced during OCR preprocessing are captured
     * and returned as `ImageKind.PageRaster` entries in `ExtractionResult.images`.
     *
     * **PDF + OCR only.** No rasters are captured for non-PDF inputs or when the
     * document-level OCR bypass is active (whole-document backend). When OCR is
     * enabled and this flag is set but the active backend skips per-page rendering,
     * a `ProcessingWarning` is emitted in `ExtractionResult.processing_warnings`.
     *
     * Defaults to `false`. Enable when downstream consumers need page thumbnails
     * (e.g. citation previews, visual grounding).
     */
    val includePageRasters: Boolean = false,
    /**
     * Run OCR on extracted images and include the recognized text in the document content.
     *
     * When `true` (default) and `ExtractionConfig.ocr` is configured, extracted images
     * are processed with the configured OCR backend. Set to `false` to extract images
     * without OCR processing, even when OCR is enabled.
     */
    val runOcrOnImages: Boolean = true,
    /**
     * When `true`, image OCR results are rendered as plain text without the
     * `![...](...)` markdown placeholder. Only takes effect when `run_ocr_on_images`
     * is also `true`.
     */
    val ocrTextOnly: Boolean = false,
    /**
     * When `true` and `ocr_text_only` is `false`, append the OCR text after
     * the image placeholder in the rendered output.
     */
    val appendOcrText: Boolean = false,
)
