Files
OpenVulkano/openVulkanoCpp/Image/ExifBuilder.hpp
Vladyslav Baranovskyi ed87e1dfdb Summary:
- Using std::array instead of c arrays
- Methods and functions are now in PascalCase
- Using std::reverse in EndianSwap
- Using little_endian bool variable
- TRUE_ is now TRUE_NORTH
- Added constructors to GPSCoords class
- GetCurrentTimestamp() method
- Added setter for altitude variable
- Minor renamings
2024-09-23 22:09:36 +03:00

75 lines
1.6 KiB
C++

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#pragma once
#include <vector>
#include <string>
#include <stdint.h>
namespace OpenVulkano::Image
{
struct RationalValue
{
uint32_t nominator;
uint32_t denominator;
};
enum class LatitudeRef
{
NORTH,
SOUTH,
};
enum class LongitudeRef
{
EAST,
WEST,
};
enum class GPSTrackRef
{
TRUE_NORTH,
MAGNETIC
};
struct GPSCoords
{
int32_t degrees, minutes, seconds;
GPSCoords(int32_t valueForAll = 0);
GPSCoords(int32_t degrees, int32_t minutes, int32_t seconds);
};
class ExifBuilder
{
public:
int orientation = 0;
std::string make;
std::string model;
RationalValue xResolution = { 0, 0 };
RationalValue yResolution = { 0, 0 };
int resolutionUnit = 0;
RationalValue exposureTime = { 0, 0 };
std::string dateTaken; // format: yyyy:mm:dd hh:mm:ss
std::string softwareUsed = "OpenVulkano";
LatitudeRef latitudeRef = LatitudeRef::NORTH;
GPSCoords latitude = { 0, 0, 0 };
LongitudeRef longitudeRef = LongitudeRef::EAST;
GPSCoords longitude = { 0, 0, 0 };
bool altitudeIsAboveSeaLevel = true;
uint32_t altitude = 0;
GPSTrackRef trackRef = GPSTrackRef::TRUE_NORTH;
float track = 0; // range is [0.0; 360.0)
void SetAltitude(float level);
// Typical usage is -> jpeg_write_marker(cinfo, JPEG_APP0 + 1, exif_data.data(), exif_data.size());
std::vector<uint8_t> Build();
static std::string GetCurrentTimestamp();
};
}