mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-15 16:35:06 +03:00
qcam: dng_writer: Record camera model
Record the model property of the camera if available. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <email@uajain.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
78fcf8e17c
commit
68c55b49c4
1 changed files with 10 additions and 3 deletions
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#include <libcamera/control_ids.h>
|
#include <libcamera/control_ids.h>
|
||||||
#include <libcamera/formats.h>
|
#include <libcamera/formats.h>
|
||||||
|
#include <libcamera/property_ids.h>
|
||||||
|
|
||||||
using namespace libcamera;
|
using namespace libcamera;
|
||||||
|
|
||||||
|
@ -353,6 +354,8 @@ int DNGWriter::write(const char *filename, const Camera *camera,
|
||||||
[[maybe_unused]] const FrameBuffer *buffer,
|
[[maybe_unused]] const FrameBuffer *buffer,
|
||||||
const void *data)
|
const void *data)
|
||||||
{
|
{
|
||||||
|
const ControlList &cameraProperties = camera->properties();
|
||||||
|
|
||||||
const auto it = formatInfo.find(config.pixelFormat);
|
const auto it = formatInfo.find(config.pixelFormat);
|
||||||
if (it == formatInfo.cend()) {
|
if (it == formatInfo.cend()) {
|
||||||
std::cerr << "Unsupported pixel format" << std::endl;
|
std::cerr << "Unsupported pixel format" << std::endl;
|
||||||
|
@ -387,9 +390,13 @@ int DNGWriter::write(const char *filename, const Camera *camera,
|
||||||
TIFFSetField(tif, TIFFTAG_DNGBACKWARDVERSION, version);
|
TIFFSetField(tif, TIFFTAG_DNGBACKWARDVERSION, version);
|
||||||
TIFFSetField(tif, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
|
TIFFSetField(tif, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
|
||||||
TIFFSetField(tif, TIFFTAG_MAKE, "libcamera");
|
TIFFSetField(tif, TIFFTAG_MAKE, "libcamera");
|
||||||
/* \todo Report a real model string instead of id. */
|
|
||||||
TIFFSetField(tif, TIFFTAG_MODEL, camera->id().c_str());
|
if (cameraProperties.contains(properties::Model)) {
|
||||||
TIFFSetField(tif, TIFFTAG_UNIQUECAMERAMODEL, camera->id().c_str());
|
std::string model = cameraProperties.get(properties::Model);
|
||||||
|
TIFFSetField(tif, TIFFTAG_MODEL, model.c_str());
|
||||||
|
/* \todo set TIFFTAG_UNIQUECAMERAMODEL. */
|
||||||
|
}
|
||||||
|
|
||||||
TIFFSetField(tif, TIFFTAG_SOFTWARE, "qcam");
|
TIFFSetField(tif, TIFFTAG_SOFTWARE, "qcam");
|
||||||
TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
|
TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue