File indexing completed on 2025-04-27 03:58:08

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2014-11-14
0007  * Description : Settings container for preview settings
0008  *
0009  * SPDX-FileCopyrightText: 2014 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #ifndef DIGIKAM_PREVIEW_SETTINGS_H
0016 #define DIGIKAM_PREVIEW_SETTINGS_H
0017 
0018 // Local includes
0019 
0020 #include "digikam_export.h"
0021 
0022 namespace Digikam
0023 {
0024 
0025 class DIGIKAM_EXPORT PreviewSettings
0026 {
0027 public:
0028 
0029     enum Quality
0030     {
0031         /** A preview were loading time is most important.
0032          *  Preview can be reduced in size.
0033          *  Additionally specifying the size of the preview area may be appropriate
0034          */
0035         FastPreview,
0036 
0037         /**
0038          * Load a preview that is as large as possible without sacrificing speed
0039          * for performance. Especially, raw previews are taken if larger than the given size.
0040          * Raw decoding and color management settings will be adjusted.
0041          */
0042         FastButLargePreview,
0043 
0044         /**
0045          * Load a high quality additional image. For normal images, loads the full data.
0046          * For RAW, the additional settings below are taken into account
0047          */
0048         HighQualityPreview
0049     };
0050 
0051     enum RawLoading
0052     {
0053         RawPreviewAutomatic,
0054         RawPreviewFromEmbeddedPreview,
0055         RawPreviewFromRawHalfSize,
0056         RawPreviewFromRawFullSize
0057     };
0058 
0059 public:
0060 
0061     explicit PreviewSettings(Quality quality = HighQualityPreview,
0062                              RawLoading rawLoading = RawPreviewAutomatic);
0063     ~PreviewSettings();
0064 
0065     bool operator==(const PreviewSettings& other) const;
0066 
0067 public:
0068 
0069     static PreviewSettings fastPreview();
0070     static PreviewSettings highQualityPreview();
0071 
0072 public:
0073 
0074     Quality    quality;
0075     RawLoading rawLoading;
0076     bool       convertToEightBit;
0077 };
0078 
0079 } // namespace Digikam
0080 
0081 #endif // DIGIKAM_PREVIEW_SETTINGS_H