~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to core/libs/threadimageio/previewloadthread.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer, Rohan Garg, Philip Muškovac, Felix Geyer
  • Date: 2011-09-23 18:18:55 UTC
  • mfrom: (1.2.36 upstream)
  • Revision ID: package-import@ubuntu.com-20110923181855-ifs67wxkugshev9k
Tags: 2:2.1.1-0ubuntu1
[ Rohan Garg ]
* New upstream release (LP: #834190)
  - debian/control
    + Build with libqtwebkit-dev
 - debian/kipi-plugins-common
    + Install libkvkontakte required by kipi-plugins
 - debian/digikam
    + Install panoramagui

[ Philip Muškovac ]
* New upstream release
  - debian/control:
    + Add libcv-dev, libcvaux-dev, libhighgui-dev, libboost-graph1.46-dev,
      libksane-dev, libxml2-dev, libxslt-dev, libqt4-opengl-dev, libqjson-dev,
      libgpod-dev and libqca2-dev to build-deps
    + Add packages for kipi-plugins, libmediawiki, libkface, libkgeomap and
      libkvkontakte
  - debian/rules:
    + Don't build with gphoto2 since it doesn't build with it.
  - Add kubuntu_fix_test_linking.diff to fix linking of the dngconverter test
  - update install files
  - update kubuntu_01_mysqld_executable_name.diff for new cmake layout
    and rename to kubuntu_mysqld_executable_name.diff
* Fix typo in digikam-data description (LP: #804894)
* Fix Vcs links

[ Felix Geyer ]
* Move library data files to the new packages libkface-data, libkgeomap-data
  and libkvkontakte-data.
* Override version of the embedded library packages to 1.0~digikam<version>.
* Exclude the library packages from digikam-dbg to prevent file conflicts in
  the future.
* Call dh_install with --list-missing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2006-01-20
 
7
 * Description : image file IO threaded interface.
 
8
 *
 
9
 * Copyright (C) 2005-2011 by Marcel Wiesweg <marcel.wiesweg@gmx.de>
 
10
 * Copyright (C) 2005-2011 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
11
 *
 
12
 * This program is free software; you can redistribute it
 
13
 * and/or modify it under the terms of the GNU General
 
14
 * Public License as published by the Free Software Foundation;
 
15
 * either version 2, or (at your option)
 
16
 * any later version.
 
17
 *
 
18
 * This program is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * ============================================================ */
 
24
 
 
25
#include "previewloadthread.moc"
 
26
 
 
27
// Local includes
 
28
 
 
29
#include "iccmanager.h"
 
30
#include "previewtask.h"
 
31
 
 
32
namespace Digikam
 
33
{
 
34
 
 
35
PreviewLoadThread::PreviewLoadThread(QObject* parent)
 
36
    : ManagedLoadSaveThread(parent),
 
37
      m_displayingWidget(0)
 
38
{
 
39
    m_loadingPolicy = LoadingPolicyFirstRemovePrevious;
 
40
}
 
41
 
 
42
LoadingDescription PreviewLoadThread::createLoadingDescription(const QString& filePath, int size, bool exifRotate)
 
43
{
 
44
    LoadingDescription description(filePath, size, exifRotate);
 
45
 
 
46
    if (DImg::fileFormat(filePath) == DImg::RAW)
 
47
    {
 
48
        description.rawDecodingSettings.optimizeTimeLoading();
 
49
        description.rawDecodingSettings.rawPrm.sixteenBitsImage   = false;
 
50
        description.rawDecodingSettings.rawPrm.halfSizeColorImage = true;
 
51
        description.rawDecodingHint                               = LoadingDescription::RawDecodingTimeOptimized;
 
52
    }
 
53
 
 
54
    ICCSettingsContainer settings = IccSettings::instance()->settings();
 
55
 
 
56
    if (settings.enableCM && settings.useManagedPreviews)
 
57
    {
 
58
        description.postProcessingParameters.colorManagement = LoadingDescription::ConvertForDisplay;
 
59
        description.postProcessingParameters.setProfile(IccManager::displayProfile(m_displayingWidget));
 
60
    }
 
61
 
 
62
    return description;
 
63
}
 
64
 
 
65
void PreviewLoadThread::load(const QString& filePath, int size, bool exifRotate)
 
66
{
 
67
    load(createLoadingDescription(filePath, size, exifRotate));
 
68
}
 
69
 
 
70
void PreviewLoadThread::loadFastButLarge(const QString& filePath, int size, bool exifRotate)
 
71
{
 
72
    LoadingDescription description      = createLoadingDescription(filePath, size, exifRotate);
 
73
    description.previewParameters.flags |= LoadingDescription::PreviewParameters::FastButLarge;
 
74
    load(description);
 
75
}
 
76
 
 
77
void PreviewLoadThread::loadHighQuality(const QString& filePath, bool exifRotate)
 
78
{
 
79
    load(filePath, 0, exifRotate);
 
80
}
 
81
 
 
82
void PreviewLoadThread::load(LoadingDescription description)
 
83
{
 
84
    // creates a PreviewLoadingTask, which uses different mechanisms than a normal loading task
 
85
    ManagedLoadSaveThread::loadPreview(description, m_loadingPolicy);
 
86
}
 
87
 
 
88
void PreviewLoadThread::setDisplayingWidget(QWidget* widget)
 
89
{
 
90
    m_displayingWidget = widget;
 
91
}
 
92
 
 
93
}   // namespace Digikam