libopenraw
Main Page
Related Pages
Namespaces
Classes
Files
File List
lib
thumbnail.cpp
1
/*
2
* libopenraw - thumbnail.cpp
3
*
4
* Copyright (C) 2005-2007 Hubert Figuiere
5
*
6
* This library is free software: you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public License
8
* as published by the Free Software Foundation, either version 3 of
9
* the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library. If not, see
18
* <http://www.gnu.org/licenses/>.
19
*/
20
21
#include <cstdlib>
22
#include <cstring>
23
#include <iostream>
24
25
#include "trace.h"
26
27
#include <libopenraw/libopenraw.h>
28
#include <libopenraw++/rawfile.h>
29
#include <libopenraw++/thumbnail.h>
30
31
using namespace
Debug;
32
33
namespace
OpenRaw {
34
36
class
Thumbnail::Private
{
37
public
:
38
Private
()
39
{
40
}
41
42
~
Private
()
43
{
44
}
45
private
:
46
Private
(
const
Private
&);
47
Private
& operator=(
const
Private
&);
48
};
49
50
Thumbnail::Thumbnail()
51
:
BitmapData
(),
52
d(new
Thumbnail
::
Private
())
53
{
54
}
55
56
Thumbnail::~Thumbnail()
57
{
58
delete
d;
59
}
60
61
Thumbnail *
62
Thumbnail::getAndExtractThumbnail
(
const
char
* _filename,
63
uint32_t preferred_size,
64
or_error & err)
65
{
66
err = OR_ERROR_NONE;
67
Thumbnail
*thumb = NULL;
68
69
RawFile
*file =
RawFile::newRawFile
(_filename);
70
if
(file) {
71
thumb =
new
Thumbnail
();
72
err = file->
getThumbnail
(preferred_size, *thumb);
73
delete
file;
74
}
75
else
{
76
err = OR_ERROR_CANT_OPEN;
// file error
77
}
78
return
thumb;
79
}
80
81
82
}
Generated on Sat Jan 12 2013 13:31:44 for libopenraw by
1.8.3