1#ifndef CH_SEQUENCE_GENERATOR_H
2#define CH_SEQUENCE_GENERATOR_H
8#include <QRandomGenerator>
9#include <QVarLengthArray>
12#include "codec/encdec.h"
14namespace PxCryptPrivate
17class ChSequenceGenerator
21 using ChannelTracker = QVarLengthArray<Channel, 3>;
29 static constexpr std::array<Channel, 3> ALL_CHANNELS{Channel::Red, Channel::Green, Channel::Blue};
33 QRandomGenerator mGenerator;
34 ChannelTracker mUnusedChannels;
38 ChSequenceGenerator(QByteArrayView seed);
39 ChSequenceGenerator(
const State& state);
46 bool pixelExhausted()
const;
53 bool operator==(
const State& state)
const;
56class ChSequenceGenerator::State
60 QRandomGenerator mRng;
61 ChannelTracker mChannels;
65 State(
const QRandomGenerator& rng,
const ChannelTracker& channels);
69 QRandomGenerator rng()
const;
70 ChannelTracker channels()
const;