File: rawdata.hpp

package info (click to toggle)
libopenraw 0.1.2-0.4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,484 kB
  • sloc: cpp: 13,907; sh: 4,090; ansic: 1,922; xml: 769; makefile: 676; perl: 42
file content (128 lines) | stat: -rw-r--r-- 3,586 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
 * libopenraw - rawdata.h
 *
 * Copyright (C) 2007-2008, 2012 Hubert Figuière
 * Copyright (C) 2008 Novell, Inc.
 *
 * This library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see
 * <http://www.gnu.org/licenses/>.
 */


#ifndef LIBOPENRAWPP_RAWDATA_H_
#define LIBOPENRAWPP_RAWDATA_H_

#include <memory>
#include <vector>

#include <libopenraw/metadata.h>
#include "bitmapdata.hpp"
#include "cfapattern.hpp"

namespace OpenRaw {

class RawData
    : public BitmapData
{
public:
    static RawData * getAndExtractRawData(const char* filename,
                                          uint32_t options,
                                          or_error & err);

    RawData();
    virtual ~RawData();

    RawData(const RawData& f) = delete;
    RawData & operator=(const RawData&) = delete;

    /** Get the rendered image
     * @param bitmapdata the BitmapData to put the image into
     * @param options the option bits. Pass 0 for now.
     * @return the error code
     */
    ::or_error getRenderedImage(BitmapData & bitmapdata, uint32_t options);

    // deprecate rename black level and white level resp.
    uint16_t blackLevel() const;
    uint16_t whiteLevel() const;
    void setBlackLevel(uint16_t _m);
    void setWhiteLevel(uint16_t _m);


    /**
     */
    void setPhotometricInterpretation(ExifPhotometricInterpretation pi);
    ExifPhotometricInterpretation getPhotometricInterpretation() const;

    /** Get colour matrix 1
     * @param index The matrix index.
     * @param size the size of the buffer.
     * @return an array of %size double.
     */
    const double* getColourMatrix1(uint32_t & size) const;
    void setColourMatrix1(const double* matrix, uint32_t size);

    /** Get colour matrix 2
     * @param index The matrix index.
     * @param size the size of the buffer.
     * @return an array of %size double.
     */
    const double* getColourMatrix2(uint32_t & size) const;
    void setColourMatrix2(const double* matrix, uint32_t size);

    /** swap the two objects data. */
    void swap(RawData & with);

    virtual void *allocData(const size_t s) override;
    virtual void setDimensions(uint32_t x, uint32_t y) override;

    void setCfaPatternType(::or_cfa_pattern t);
    /**
     * @return the const CfaPattern*.
     */
    const CfaPattern* cfaPattern() const;
    void setCfaPattern(const CfaPattern* pattern);

    uint32_t compression() const;
    void setCompression(uint32_t c);


    void setSlices(const std::vector<uint16_t> & slices);

    /** append a uint8_t at the current position */
//		BitmapData &append(uint8_t c);
    /** append a uint18_t at the current position */
    RawData &append(uint16_t c);
    /** Jump to next row. Take slicing into account. */
    void nextRow();
private:
    class Private;
    RawData::Private *d;
};


typedef std::unique_ptr<RawData> RawDataPtr;

}

/*
  Local Variables:
  mode:c++
  c-file-style:"stroustrup"
  c-file-offsets:((innamespace . 0))
  indent-tabs-mode:nil
  fill-column:80
  End:
*/
#endif