KDcraw

dcrawinfocontainer.cpp
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 
15 {
16  sensitivity = -1.0;
17  exposureTime = -1.0;
18  aperture = -1.0;
19  focalLength = -1.0;
20  pixelAspectRatio = 1.0; // Default value. This can be unavailable (depending of camera model).
21  rawColors = -1;
22  rawImages = -1;
23  hasIccProfile = false;
24  isDecodable = false;
25  daylightMult[0] = 0.0;
26  daylightMult[1] = 0.0;
27  daylightMult[2] = 0.0;
28  cameraMult[0] = 0.0;
29  cameraMult[1] = 0.0;
30  cameraMult[2] = 0.0;
31  cameraMult[3] = 0.0;
32  blackPoint = 0;
33 
34  for (int ch=0; ch<4; ch++)
35  {
36  blackPointCh[ch] = 0;
37  }
38 
39  whitePoint = 0;
40  topMargin = 0;
41  leftMargin = 0;
42  orientation = ORIENTATION_NONE;
43 
44  for (int x=0 ; x<3 ; x++)
45  {
46  for (int y=0 ; y<4 ; y++)
47  {
48  cameraColorMatrix1[x][y] = 0.0;
49  cameraColorMatrix2[x][y] = 0.0;
50  cameraXYZMatrix[y][x] = 0.0; // NOTE: see B.K.O # 253911 : [y][x] not [x][y]
51  }
52  }
53 }
54 
56 {
57 }
58 
60 {
61  if (make.isEmpty() &&
62  model.isEmpty() &&
64  colorKeys.isEmpty() &&
65  DNGVersion.isEmpty() &&
66  exposureTime == -1.0 &&
67  aperture == -1.0 &&
68  focalLength == -1.0 &&
69  pixelAspectRatio == 1.0 &&
70  sensitivity == -1.0 &&
71  rawColors == -1 &&
72  rawImages == -1 &&
73  blackPoint == 0 &&
74  blackPointCh[0] == 0 &&
75  blackPointCh[1] == 0 &&
76  blackPointCh[2] == 0 &&
77  blackPointCh[3] == 0 &&
78  whitePoint == 0 &&
79  topMargin == 0 &&
80  leftMargin == 0 &&
81  !dateTime.isValid() &&
82  !imageSize.isValid() &&
83  !fullSize.isValid() &&
84  !outputSize.isValid() &&
85  !thumbSize.isValid() &&
86  cameraColorMatrix1[0][0] == 0.0 &&
87  cameraColorMatrix1[0][1] == 0.0 &&
88  cameraColorMatrix1[0][2] == 0.0 &&
89  cameraColorMatrix1[0][3] == 0.0 &&
90  cameraColorMatrix1[1][0] == 0.0 &&
91  cameraColorMatrix1[1][1] == 0.0 &&
92  cameraColorMatrix1[1][2] == 0.0 &&
93  cameraColorMatrix1[1][3] == 0.0 &&
94  cameraColorMatrix1[2][0] == 0.0 &&
95  cameraColorMatrix1[2][1] == 0.0 &&
96  cameraColorMatrix1[2][2] == 0.0 &&
97  cameraColorMatrix1[2][3] == 0.0 &&
98  cameraColorMatrix2[0][0] == 0.0 &&
99  cameraColorMatrix2[0][1] == 0.0 &&
100  cameraColorMatrix2[0][2] == 0.0 &&
101  cameraColorMatrix2[0][3] == 0.0 &&
102  cameraColorMatrix2[1][0] == 0.0 &&
103  cameraColorMatrix2[1][1] == 0.0 &&
104  cameraColorMatrix2[1][2] == 0.0 &&
105  cameraColorMatrix2[1][3] == 0.0 &&
106  cameraColorMatrix2[2][0] == 0.0 &&
107  cameraColorMatrix2[2][1] == 0.0 &&
108  cameraColorMatrix2[2][2] == 0.0 &&
109  cameraColorMatrix2[2][3] == 0.0 &&
110  cameraXYZMatrix[0][0] == 0.0 &&
111  cameraXYZMatrix[0][1] == 0.0 &&
112  cameraXYZMatrix[0][2] == 0.0 &&
113  cameraXYZMatrix[1][0] == 0.0 &&
114  cameraXYZMatrix[1][1] == 0.0 &&
115  cameraXYZMatrix[1][2] == 0.0 &&
116  cameraXYZMatrix[2][0] == 0.0 &&
117  cameraXYZMatrix[2][1] == 0.0 &&
118  cameraXYZMatrix[2][2] == 0.0 &&
119  cameraXYZMatrix[3][0] == 0.0 &&
120  cameraXYZMatrix[3][1] == 0.0 &&
121  cameraXYZMatrix[3][2] == 0.0 &&
122  orientation == ORIENTATION_NONE
123  )
124  {
125  return true;
126  }
127  else
128  {
129  return false;
130  }
131 }
132 
134 {
135  dbg.nospace() << "DcrawInfoContainer::sensitivity: " << c.sensitivity << ", ";
136  dbg.nospace() << "DcrawInfoContainer::exposureTime: " << c.exposureTime << ", ";
137  dbg.nospace() << "DcrawInfoContainer::aperture: " << c.aperture << ", ";
138  dbg.nospace() << "DcrawInfoContainer::focalLength: " << c.focalLength << ", ";
139  dbg.nospace() << "DcrawInfoContainer::pixelAspectRatio: " << c.pixelAspectRatio << ", ";
140  dbg.nospace() << "DcrawInfoContainer::rawColors: " << c.rawColors << ", ";
141  dbg.nospace() << "DcrawInfoContainer::rawImages: " << c.rawImages << ", ";
142  dbg.nospace() << "DcrawInfoContainer::hasIccProfile: " << c.hasIccProfile << ", ";
143  dbg.nospace() << "DcrawInfoContainer::isDecodable: " << c.isDecodable << ", ";
144  dbg.nospace() << "DcrawInfoContainer::daylightMult: " << c.daylightMult << ", ";
145  dbg.nospace() << "DcrawInfoContainer::cameraMult: " << c.cameraMult << ", ";
146  dbg.nospace() << "DcrawInfoContainer::blackPoint: " << c.blackPoint << ", ";
147  dbg.nospace() << "DcrawInfoContainer::whitePoint: " << c.whitePoint << ", ";
148  dbg.nospace() << "DcrawInfoContainer::topMargin: " << c.topMargin << ", ";
149  dbg.nospace() << "DcrawInfoContainer::leftMargin: " << c.leftMargin << ", ";
150  dbg.nospace() << "DcrawInfoContainer::orientation: " << c.orientation;
151  return dbg.space();
152 }
153 
154 } // namespace KDcrawIface
float exposureTime
==> 1/exposureTime = exposure time in seconds.
ImageOrientation orientation
The raw image orientation.
double cameraMult[4]
Camera multipliers used for White Balance adjustments.
QDateTime dateTime
Date & time when the picture has been taken.
bool isValid() const const
bool isDecodable
True is RAW file is decodable by dcraw.
QSize thumbSize
The thumb dimensions in pixels.
QDebug & nospace()
QDebug & space()
QString make
The camera maker.
unsigned int leftMargin
Left margin of raw image.
QSize fullSize
The full RAW image dimensions in pixels.
unsigned int topMargin
Top margin of raw image.
A container for RAW image information.
DcrawInfoContainer()
Standard constructor.
QSize outputSize
The output dimensions in pixels.
float sensitivity
The sensitivity in ISO used by camera to take the picture.
QDebug operator<<(QDebug dbg, const DcrawInfoContainer &c)
qDebug() stream operator. Writes container c to the debug output in a nicely formatted way.
bool isEmpty() const const
QString model
The camera model.
float pixelAspectRatio
The pixel Aspect Ratio if != 1.0.
int rawColors
The number of RAW colors.
unsigned int blackPointCh[4]
Channel black levels from Raw histogram.
double daylightMult[3]
White color balance settings.
bool isEmpty()
Return 'true' if container is empty, else 'false'.
float cameraColorMatrix1[3][4]
Camera Color Matrix.
Main namespace of libKDcraw.
float aperture
==> Aperture value in APEX.
QString filterPattern
The demosaising filter pattern.
bool isValid() const const
int rawImages
The number of RAW images.
QString DNGVersion
The DNG version.
float focalLength
==> Focal Length value in mm.
unsigned int blackPoint
Black level from Raw histogram.
QString colorKeys
The used Color Keys.
QSize imageSize
The image dimensions in pixels.
bool hasIccProfile
True if RAW file include an ICC color profile.
unsigned int whitePoint
White level from Raw histogram.
virtual ~DcrawInfoContainer()
Standard destructor.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Aug 11 2022 03:53:16 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.