genesys: Remove remaining uses of SensorProfile

merge-requests/213/head
Povilas Kanapickas 2019-12-08 11:42:32 +02:00
rodzic 7971ee5693
commit 4ef2e39872
5 zmienionych plików z 617 dodań i 888 usunięć

Wyświetl plik

@ -116,7 +116,6 @@ class ResolutionFilter;
struct GenesysFrontendLayout;
struct Genesys_Frontend;
struct SensorExposure;
struct SensorProfile;
struct Genesys_Sensor;
// settings.h

Wyświetl plik

@ -4715,7 +4715,7 @@ static void probe_genesys_devices()
of Genesys_Calibration_Cache as is.
*/
static const char* CALIBRATION_IDENT = "sane_genesys";
static const int CALIBRATION_VERSION = 19;
static const int CALIBRATION_VERSION = 20;
bool read_calibration(std::istream& str, Genesys_Device::Calibration& calibration,
const std::string& path)

Wyświetl plik

@ -113,20 +113,6 @@ std::ostream& operator<<(std::ostream& out, const ResolutionFilter& resolutions)
return out;
}
std::ostream& operator<<(std::ostream& out, const SensorProfile& profile)
{
out << "SensorProfile{\n"
<< " resolutions: " << format_indent_braced_list(4, profile.resolutions) << '\n'
<< " exposure_lperiod: " << profile.exposure_lperiod << '\n'
<< " exposure: " << format_indent_braced_list(4, profile.exposure) << '\n'
<< " segment_size: " << profile.segment_size << '\n'
<< " segment_order: "
<< format_indent_braced_list(4, format_vector_unsigned(4, profile.segment_order)) << '\n'
<< " custom_regs: " << format_indent_braced_list(4, profile.custom_regs) << '\n'
<< '}';
return out;
}
std::ostream& operator<<(std::ostream& out, const Genesys_Sensor& sensor)
{
out << "Genesys_Sensor{\n"

Wyświetl plik

@ -245,52 +245,6 @@ void serialize(Stream& str, ResolutionFilter& x)
}
struct SensorProfile
{
// the resolution list that the profile is usable at.
ResolutionFilter resolutions = ResolutionFilter::ANY;
unsigned exposure_lperiod = 0;
SensorExposure exposure;
unsigned segment_size = 0; // only on GL846, GL847
// the order of the segments, if any, for the profile. If the sensor is not segmented or uses
// only single segment, this array can be empty
std::vector<unsigned> segment_order;
GenesysRegisterSettingSet custom_regs;
unsigned get_segment_count() const
{
if (segment_order.size() < 2)
return 1;
return segment_order.size();
}
bool operator==(const SensorProfile& other) const
{
return resolutions == other.resolutions &&
exposure_lperiod == other.exposure_lperiod &&
exposure == other.exposure &&
segment_order == other.segment_order &&
custom_regs == other.custom_regs;
}
};
std::ostream& operator<<(std::ostream& out, const SensorProfile& profile);
template<class Stream>
void serialize(Stream& str, SensorProfile& x)
{
serialize(str, x.resolutions);
serialize(str, x.exposure_lperiod);
serialize(str, x.exposure.red);
serialize(str, x.exposure.green);
serialize(str, x.exposure.blue);
serialize(str, x.segment_order);
serialize(str, x.custom_regs);
}
struct Genesys_Sensor {
Genesys_Sensor() = default;