Coverage Report

Created: 2026-01-25 07:18

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libkdcraw/src/dcrawinfocontainer.cpp
Line
Count
Source
1
/*
2
    SPDX-FileCopyrightText: 2007-2015 Gilles Caulier <caulier dot gilles at gmail dot com>
3
4
    SPDX-License-Identifier: GPL-2.0-or-later
5
*/
6
7
// Local includes
8
9
#include "dcrawinfocontainer.h"
10
11
namespace KDcrawIface
12
{
13
14
DcrawInfoContainer::DcrawInfoContainer()
15
0
{
16
0
    sensitivity       = -1.0;
17
0
    exposureTime      = -1.0;
18
0
    aperture          = -1.0;
19
0
    focalLength       = -1.0;
20
0
    pixelAspectRatio  = 1.0;    // Default value. This can be unavailable (depending of camera model).
21
0
    rawColors         = -1;
22
0
    rawImages         = -1;
23
0
    hasIccProfile     = false;
24
0
    isDecodable       = false;
25
0
    daylightMult[0]   = 0.0;
26
0
    daylightMult[1]   = 0.0;
27
0
    daylightMult[2]   = 0.0;
28
0
    cameraMult[0]     = 0.0;
29
0
    cameraMult[1]     = 0.0;
30
0
    cameraMult[2]     = 0.0;
31
0
    cameraMult[3]     = 0.0;
32
0
    blackPoint        = 0;
33
34
0
    for (int ch=0; ch<4; ch++)
35
0
    {
36
0
        blackPointCh[ch] = 0;
37
0
    }
38
39
0
    whitePoint        = 0;
40
0
    topMargin         = 0;
41
0
    leftMargin        = 0;
42
0
    orientation       = ORIENTATION_NONE;
43
44
0
    for (int x=0 ; x<3 ; x++)
45
0
    {
46
0
        for (int y=0 ; y<4 ; y++)
47
0
        {
48
0
            cameraColorMatrix1[x][y] = 0.0;
49
0
            cameraColorMatrix2[x][y] = 0.0;
50
0
            cameraXYZMatrix[y][x]    = 0.0;       // NOTE: see B.K.O # 253911 : [y][x] not [x][y]
51
0
        }
52
0
    }
53
0
}
54
55
DcrawInfoContainer::~DcrawInfoContainer()
56
0
{
57
0
}
58
59
bool DcrawInfoContainer::isEmpty()
60
0
{
61
0
    if (make.isEmpty()                  &&
62
0
        model.isEmpty()                 &&
63
0
        filterPattern.isEmpty()         &&
64
0
        colorKeys.isEmpty()             &&
65
0
        DNGVersion.isEmpty()            &&
66
0
        exposureTime     == -1.0        &&
67
0
        aperture         == -1.0        &&
68
0
        focalLength      == -1.0        &&
69
0
        pixelAspectRatio == 1.0         &&
70
0
        sensitivity      == -1.0        &&
71
0
        rawColors        == -1          &&
72
0
        rawImages        == -1          &&
73
0
        blackPoint       == 0           &&
74
0
        blackPointCh[0]  == 0           &&
75
0
        blackPointCh[1]  == 0           &&
76
0
        blackPointCh[2]  == 0           &&
77
0
        blackPointCh[3]  == 0           &&
78
0
        whitePoint       == 0           &&
79
0
        topMargin        == 0           &&
80
0
        leftMargin       == 0           &&
81
0
        !dateTime.isValid()             &&
82
0
        !imageSize.isValid()            &&
83
0
        !fullSize.isValid()             &&
84
0
        !outputSize.isValid()           &&
85
0
        !thumbSize.isValid()            &&
86
0
        cameraColorMatrix1[0][0] == 0.0 &&
87
0
        cameraColorMatrix1[0][1] == 0.0 &&
88
0
        cameraColorMatrix1[0][2] == 0.0 &&
89
0
        cameraColorMatrix1[0][3] == 0.0 &&
90
0
        cameraColorMatrix1[1][0] == 0.0 &&
91
0
        cameraColorMatrix1[1][1] == 0.0 &&
92
0
        cameraColorMatrix1[1][2] == 0.0 &&
93
0
        cameraColorMatrix1[1][3] == 0.0 &&
94
0
        cameraColorMatrix1[2][0] == 0.0 &&
95
0
        cameraColorMatrix1[2][1] == 0.0 &&
96
0
        cameraColorMatrix1[2][2] == 0.0 &&
97
0
        cameraColorMatrix1[2][3] == 0.0 &&
98
0
        cameraColorMatrix2[0][0] == 0.0 &&
99
0
        cameraColorMatrix2[0][1] == 0.0 &&
100
0
        cameraColorMatrix2[0][2] == 0.0 &&
101
0
        cameraColorMatrix2[0][3] == 0.0 &&
102
0
        cameraColorMatrix2[1][0] == 0.0 &&
103
0
        cameraColorMatrix2[1][1] == 0.0 &&
104
0
        cameraColorMatrix2[1][2] == 0.0 &&
105
0
        cameraColorMatrix2[1][3] == 0.0 &&
106
0
        cameraColorMatrix2[2][0] == 0.0 &&
107
0
        cameraColorMatrix2[2][1] == 0.0 &&
108
0
        cameraColorMatrix2[2][2] == 0.0 &&
109
0
        cameraColorMatrix2[2][3] == 0.0 &&
110
0
        cameraXYZMatrix[0][0]    == 0.0 &&
111
0
        cameraXYZMatrix[0][1]    == 0.0 &&
112
0
        cameraXYZMatrix[0][2]    == 0.0 &&
113
0
        cameraXYZMatrix[1][0]    == 0.0 &&
114
0
        cameraXYZMatrix[1][1]    == 0.0 &&
115
0
        cameraXYZMatrix[1][2]    == 0.0 &&
116
0
        cameraXYZMatrix[2][0]    == 0.0 &&
117
0
        cameraXYZMatrix[2][1]    == 0.0 &&
118
0
        cameraXYZMatrix[2][2]    == 0.0 &&
119
0
        cameraXYZMatrix[3][0]    == 0.0 &&
120
0
        cameraXYZMatrix[3][1]    == 0.0 &&
121
0
        cameraXYZMatrix[3][2]    == 0.0 &&
122
0
        orientation              == ORIENTATION_NONE
123
0
       )
124
0
    {
125
0
        return true;
126
0
    }
127
0
    else
128
0
    {
129
0
        return false;
130
0
    }
131
0
}
132
133
QDebug operator<<(QDebug dbg, const DcrawInfoContainer& c)
134
0
{
135
0
    dbg.nospace() << "DcrawInfoContainer::sensitivity: "      << c.sensitivity      << ", ";
136
0
    dbg.nospace() << "DcrawInfoContainer::exposureTime: "     << c.exposureTime     << ", ";
137
0
    dbg.nospace() << "DcrawInfoContainer::aperture: "         << c.aperture         << ", ";
138
0
    dbg.nospace() << "DcrawInfoContainer::focalLength: "      << c.focalLength      << ", ";
139
0
    dbg.nospace() << "DcrawInfoContainer::pixelAspectRatio: " << c.pixelAspectRatio << ", ";
140
0
    dbg.nospace() << "DcrawInfoContainer::rawColors: "        << c.rawColors        << ", ";
141
0
    dbg.nospace() << "DcrawInfoContainer::rawImages: "        << c.rawImages        << ", ";
142
0
    dbg.nospace() << "DcrawInfoContainer::hasIccProfile: "    << c.hasIccProfile    << ", ";
143
0
    dbg.nospace() << "DcrawInfoContainer::isDecodable: "      << c.isDecodable      << ", ";
144
0
    dbg.nospace() << "DcrawInfoContainer::daylightMult: "     << c.daylightMult     << ", ";
145
0
    dbg.nospace() << "DcrawInfoContainer::cameraMult: "       << c.cameraMult       << ", ";
146
0
    dbg.nospace() << "DcrawInfoContainer::blackPoint: "       << c.blackPoint       << ", ";
147
0
    dbg.nospace() << "DcrawInfoContainer::whitePoint: "       << c.whitePoint       << ", ";
148
0
    dbg.nospace() << "DcrawInfoContainer::topMargin: "        << c.topMargin        << ", ";
149
0
    dbg.nospace() << "DcrawInfoContainer::leftMargin: "       << c.leftMargin       << ", ";
150
0
    dbg.nospace() << "DcrawInfoContainer::orientation: "      << c.orientation;
151
0
    return dbg.space();
152
0
}
153
154
} // namespace KDcrawIface