File indexing completed on 2024-04-14 04:46:31
0001 /* 0002 SPDX-FileCopyrightText: 2016 Jean-Baptiste Mardelle <jb@kdenlive.org> 0003 This file is part of Kdenlive. See www.kdenlive.org. 0004 0005 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0006 */ 0007 0008 #pragma once 0009 0010 #include <QImage> 0011 #include <QUrl> 0012 0013 namespace Mlt { 0014 class Producer; 0015 class Frame; 0016 } // namespace Mlt 0017 0018 namespace KThumb { 0019 QPixmap getImage(const QUrl &url, int width, int height = -1); 0020 QPixmap getImage(const QUrl &url, int frame, int width, int height = -1); 0021 QImage getFrame(Mlt::Producer *producer, int framepos, int width, int height, int displayWidth = 0); 0022 QImage getFrame(Mlt::Producer &producer, int framepos, int width, int height, int displayWidth = 0); 0023 QImage getFrame(Mlt::Frame *frame, int width = 0, int height = 0, int scaledWidth = 0); 0024 /** @brief Calculates image variance, useful to know if a thumbnail is interesting. 0025 * @return an integer between 0 and 100. 0 means no variance, eg. black image while bigger values mean contrasted image 0026 * */ 0027 int imageVariance(const QImage &image); 0028 } // namespace KThumb