~ubuntu-branches/debian/sid/libopenraw/sid

« back to all changes in this revision

Viewing changes to lib/orffile.cpp

  • Committer: Bazaar Package Importer
  • Author(s): David Paleino
  • Date: 2010-08-18 11:36:32 UTC
  • Revision ID: james.westby@ubuntu.com-20100818113632-l0xc1bc2ydcuds0i
Tags: 0.0.8-2
* debian/control:
  - updated my email address
  - DMUA removed
  - Sarah J. Fortune added as co-maintainer (Closes: #530244)
  - Build-Depends change: libjpeg62-dev → libjpeg-dev
  - Standards-Version bumped to 3.9.1
    + debian/libopenraw-dev.install, debian/libopenrawgnome-dev.install:
      don't install *.la files anymore (§10.2)
  - remove Build-Depends on quilt
  - Build-Depend on debhelper >= 7.0.50~
* debian/copyright: updated copyright years for debian/*
* debian/patches/02-fix_support_for_ORF_and_PEF.patch added,
  cherry-picked from upstream's git (see comment) (Closes: #569788)
* debian/source/format: using 3.0 (quilt)
* debian/rules:
  - removed quilt machinery
  - use full dh7 power :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * libopenraw - orffile.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
77
77
 
78
78
                IFDDir::Ref  ORFFile::_locateCfaIfd()
79
79
                {
80
 
                        // in PEF the CFA IFD is the main IFD
 
80
                        // in ORF the CFA IFD is the main IFD
81
81
                        if(!m_mainIfd) {
82
82
                                m_mainIfd = _locateMainIfd();
83
83
                        }
92
92
 
93
93
 
94
94
                
95
 
                ::or_error ORFFile::_getRawData(RawData & data, uint32_t /*options*/)
 
95
                ::or_error ORFFile::_getRawData(RawData & data, uint32_t options)
96
96
                {
 
97
                        ::or_error err;
97
98
                        if(!m_cfaIfd) {
98
99
                                m_cfaIfd = _locateCfaIfd();
99
100
                        }
100
 
                        return _getRawDataFromDir(data, m_cfaIfd);
 
101
                        err = _getRawDataFromDir(data, m_cfaIfd);
 
102
                        if(err == OR_ERROR_NONE) {
 
103
                                // ORF files seems to be marked as uncompressed even if they are.
 
104
                                uint32_t x = data.x();
 
105
                                uint32_t y = data.y();
 
106
                                uint16_t compression = 0;
 
107
                                if(data.size() < x * y * 2) {
 
108
                    compression = 65535;
 
109
                    data.setCompression(65535);
 
110
                                        data.setDataType(OR_DATA_TYPE_COMPRESSED_CFA);
 
111
                                }
 
112
                else {
 
113
                    compression = data.compression();
 
114
                }
 
115
                switch(compression) {
 
116
                case 65535:
 
117
                    if((options & OR_OPTIONS_DONT_DECOMPRESS) == 0) {
 
118
                        // TODO decompress
 
119
                    }
 
120
                                        break;
 
121
                                default:
 
122
                                        break;
 
123
                                }
 
124
                        }
 
125
                        return err;
101
126
                }
102
127
 
103
128
        }