1
// Copyright (C) 2010 Dirk Vanden Boer <dirk.vdb@gmail.com>
3
// This program is free software; you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation; either version 2 of the License, or
6
// (at your option) any later version.
8
// This program is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
// GNU General Public License for more details.
13
// You should have received a copy of the GNU General Public License
14
// along with this program; if not, write to the Free Software
15
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
#ifndef VIDEO_THUMBNAILER_H
18
#define VIDEO_THUMBNAILER_H
26
#include "histogram.h"
31
namespace ffmpegthumbnailer
38
class VideoThumbnailer
42
VideoThumbnailer(int thumbnailSize, bool workaroundIssues, bool maintainAspectRatio, bool smartFrameSelection);
45
void generateThumbnail(const QString& videoFile, QImage &image);
47
void setThumbnailSize(int size);
48
void setSeekPercentage(int percentage);
49
void setSeekTime(const QString& seekTime);
50
void setWorkAroundIssues(bool workAround);
51
void setMaintainAspectRatio(bool enabled);
52
void setSmartFrameSelection(bool enabled);
53
void addFilter(IFilter* filter);
54
void removeFilter(IFilter* filter);
58
void generateThumbnail(const QString& videoFile, ImageWriter& imageWriter, QImage& image);
59
void generateSmartThumbnail(MovieDecoder& movieDecoder, VideoFrame& videoFrame);
61
QString getMimeType(const QString& videoFile);
62
QString getExtension(const QString& videoFilename);
64
void generateHistogram(const VideoFrame& videoFrame, Histogram<int>& histogram);
65
int getBestThumbnailIndex(std::vector<VideoFrame>& videoFrames, const std::vector<Histogram<int> >& histograms);
66
void applyFilters(VideoFrame& frameData);
70
uint16_t m_SeekPercentage;
71
bool m_OverlayFilmStrip;
72
bool m_WorkAroundIssues;
73
bool m_MaintainAspectRatio;
74
bool m_SmartFrameSelection;
76
std::vector<IFilter*> m_Filters;