Implement a unified export system for extracting data from parsed files: ExportManager (singleton): - Centralized export handling for all content types - Content type detection (image, audio, video, text, binary) - Batch export support with progress tracking Format-specific export dialogs: - ImageExportDialog: PNG, JPEG, BMP, TGA with quality options - AudioExportDialog: WAV, MP3, OGG with FFmpeg integration - BinaryExportDialog: Raw data export with optional decompression - BatchExportDialog: Recursive export with filtering options - Base ExportDialog class for common functionality Settings additions: - FFmpeg path configuration with auto-detection - Search common install locations and PATH Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
69 lines
1.6 KiB
C++
69 lines
1.6 KiB
C++
#ifndef IMAGEEXPORTDIALOG_H
|
|
#define IMAGEEXPORTDIALOG_H
|
|
|
|
#include "exportdialog.h"
|
|
#include <QImage>
|
|
|
|
class QSlider;
|
|
class QSpinBox;
|
|
class QStackedWidget;
|
|
|
|
/**
|
|
* @brief Export dialog for images with preview and format-specific options.
|
|
*
|
|
* Shows a thumbnail preview of the image and provides quality/compression
|
|
* settings for different output formats (PNG, JPEG, TGA, BMP, TIFF).
|
|
*/
|
|
class ImageExportDialog : public ExportDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ImageExportDialog(QWidget *parent = nullptr);
|
|
|
|
// Set image directly (already decoded)
|
|
void setImage(const QImage& image, const QString& suggestedName);
|
|
|
|
// Get configured image for export
|
|
QImage exportImage() const { return mImage; }
|
|
|
|
// Format-specific options
|
|
int jpegQuality() const;
|
|
int pngCompression() const;
|
|
|
|
protected:
|
|
void setupPreview() override;
|
|
void updatePreview() override;
|
|
QStringList supportedFormats() const override;
|
|
void onFormatChanged(const QString& format) override;
|
|
|
|
private slots:
|
|
void onJpegQualityChanged(int value);
|
|
void onPngCompressionChanged(int value);
|
|
|
|
private:
|
|
void updateFileSizeEstimate();
|
|
void showOptionsForFormat(const QString& format);
|
|
|
|
QImage mImage;
|
|
QLabel* mPreviewLabel;
|
|
|
|
// Format-specific option widgets
|
|
QStackedWidget* mOptionsStack;
|
|
|
|
// JPEG options
|
|
QWidget* mJpegOptionsWidget;
|
|
QSlider* mJpegQualitySlider;
|
|
QSpinBox* mJpegQualitySpinBox;
|
|
|
|
// PNG options
|
|
QWidget* mPngOptionsWidget;
|
|
QSlider* mPngCompressionSlider;
|
|
QSpinBox* mPngCompressionSpinBox;
|
|
|
|
// No options widget (for TGA, BMP, TIFF)
|
|
QWidget* mNoOptionsWidget;
|
|
};
|
|
|
|
#endif // IMAGEEXPORTDIALOG_H
|