init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
72
Telegram/SourceFiles/calls/calls_emoji_fingerprint.h
Normal file
72
Telegram/SourceFiles/calls/calls_emoji_fingerprint.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "base/unique_qptr.h"
|
||||
|
||||
namespace Ui {
|
||||
class RpWidget;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Calls {
|
||||
|
||||
class Call;
|
||||
|
||||
[[nodiscard]] std::vector<EmojiPtr> ComputeEmojiFingerprint(
|
||||
not_null<Call*> call);
|
||||
[[nodiscard]] std::vector<EmojiPtr> ComputeEmojiFingerprint(
|
||||
bytes::const_span fingerprint);
|
||||
|
||||
[[nodiscard]] base::unique_qptr<Ui::RpWidget> CreateFingerprintAndSignalBars(
|
||||
not_null<QWidget*> parent,
|
||||
not_null<Call*> call);
|
||||
|
||||
struct FingerprintBadgeState {
|
||||
struct Entry {
|
||||
EmojiPtr emoji = nullptr;
|
||||
std::vector<EmojiPtr> sliding;
|
||||
std::vector<EmojiPtr> carousel;
|
||||
crl::time time = 0;
|
||||
float64 speed = 0.;
|
||||
float64 position = 0.;
|
||||
int added = 0;
|
||||
};
|
||||
std::vector<Entry> entries;
|
||||
float64 speed = 1.;
|
||||
};
|
||||
struct FingerprintBadge {
|
||||
not_null<const FingerprintBadgeState*> state;
|
||||
rpl::producer<> repaints;
|
||||
};
|
||||
FingerprintBadge SetupFingerprintBadge(
|
||||
rpl::lifetime &on,
|
||||
rpl::producer<QByteArray> fingerprint);
|
||||
|
||||
void SetupFingerprintBadgeWidget(
|
||||
not_null<Ui::RpWidget*> widget,
|
||||
not_null<const FingerprintBadgeState*> state,
|
||||
rpl::producer<> repaints);
|
||||
|
||||
struct FingerprintBadgeCache {
|
||||
struct Emoji {
|
||||
EmojiPtr ptr = nullptr;
|
||||
QImage image;
|
||||
};
|
||||
struct Entry {
|
||||
std::vector<Emoji> emoji;
|
||||
};
|
||||
std::vector<Entry> entries;
|
||||
QImage shadow;
|
||||
};
|
||||
void PaintFingerprintEntry(
|
||||
QPainter &p,
|
||||
const FingerprintBadgeState::Entry &entry,
|
||||
FingerprintBadgeCache::Entry &cache,
|
||||
int esize);
|
||||
|
||||
} // namespace Calls
|
||||
Reference in New Issue
Block a user