summaryrefslogtreecommitdiff
path: root/src/ipa/rpi/controller/ccm_algorithm.h
blob: 6678ba75bd2ab3b8870449015c5888a84c0818ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* SPDX-License-Identifier: BSD-2-Clause */
/*
 * Copyright (C) 2019, Raspberry Pi Ltd
 *
 * CCM (colour correction matrix) control algorithm interface
 */
#pragma once

#include "algorithm.h"

namespace RPiController {

class CcmAlgorithm : public Algorithm
{
public:
	CcmAlgorithm(Controller *controller) : Algorithm(controller) {}
	/* A CCM algorithm must provide the following: */
	virtual void setSaturation(double saturation) = 0;
};

} /* namespace RPiController */
="hl num">1 priv_key = argv[1] template = argv[2] output = argv[3] try: ret = subprocess.run(['openssl', 'rsa', '-pubout', '-in', priv_key, '-outform', 'DER'], stdout=subprocess.PIPE) except FileNotFoundError: print('Please install openssl to sign IPA modules') return 1 ipa_key = ['0x%02x' % c for c in ret.stdout] ipa_key = [', '.join(ipa_key[bound:bound + 8]) for bound in range(0, len(ipa_key), 8)] ipa_key = ',\n\t'.join(ipa_key) data = {'ipa_key': ipa_key} template = open(template, 'rb').read() template = template.decode('utf-8') template = string.Template(template) f = open(output, 'wb') f.write(template.substitute(data).encode('utf-8')) f.close() return 0 if __name__ == '__main__': sys.exit(main(sys.argv))