~ubuntu-branches/ubuntu/utopic/libopenraw/utopic

« back to all changes in this revision

Viewing changes to lib/peffile.cpp

  • Committer: Package Import Robot
  • Author(s): David Paleino
  • Date: 2012-03-10 08:57:09 UTC
  • mto: (7.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: package-import@ubuntu.com-20120310085709-zuimi0xsth01nfkc
Tags: upstream-0.0.9
ImportĀ upstreamĀ versionĀ 0.0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * libopenraw - peffile.cpp
3
3
 *
4
 
 * Copyright (C) 2006-2008 Hubert Figuiere
 
4
 * Copyright (C) 2006-2008, 2010 Hubert Figuiere
5
5
 *
6
6
 * This library is free software: you can redistribute it and/or
7
7
 * modify it under the terms of the GNU Lesser General Public License
23
23
#include <libopenraw++/thumbnail.h>
24
24
#include <libopenraw++/rawdata.h>
25
25
 
26
 
#include "debug.h"
 
26
#include "trace.h"
27
27
#include "ifd.h"
28
28
#include "ifdfilecontainer.h"
29
29
#include "ifddir.h"
48
48
                                                                                                                 OR_TYPEID_PENTAX_K100D_PEF) },
49
49
                        { "PENTAX K100D Super ", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_PENTAX, 
50
50
                                                                                                                 OR_TYPEID_PENTAX_K100D_PEF) },
 
51
                        { "PENTAX K20D        ", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_PENTAX, 
 
52
                                                                                                                 OR_TYPEID_PENTAX_K20D_PEF) },
51
53
                        { 0, 0 }
52
54
                };
53
55
 
83
85
                        return m_container->setDirectory(0);
84
86
                }
85
87
 
86
 
                ::or_error PEFFile::_getRawData(RawData & data, uint32_t /*options*/)
 
88
                ::or_error PEFFile::_getRawData(RawData & data, uint32_t options)
87
89
                {
88
90
                        ::or_error err;
89
91
                        if(!m_cfaIfd) {
91
93
                        }
92
94
                        err = _getRawDataFromDir(data, m_cfaIfd);
93
95
                        if(err == OR_ERROR_NONE) {
94
 
                                uint16_t compression = 0;
95
 
                                m_cfaIfd->getValue(IFD::EXIF_TAG_COMPRESSION, compression);
96
 
                                switch(compression) {
97
 
                                case 1:
98
 
                                        data.setDataType(OR_DATA_TYPE_CFA);
99
 
                                        break;
100
 
                                case 65535:
101
 
                                        // TODO decompress
 
96
                uint16_t compression = data.compression();
 
97
                switch(compression) {
 
98
                case 65535:
 
99
                    if((options & OR_OPTIONS_DONT_DECOMPRESS) == 0) {
 
100
                        // TODO decompress
 
101
                    }
102
102
                                        break;
103
103
                                default:
104
104
                                        break;