tdlight/td/telegram/StickerFormat.h

45 lines
1.5 KiB
C
Raw Normal View History

2022-01-18 17:20:43 +01:00
//
2024-01-01 01:07:21 +01:00
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
2022-01-18 17:20:43 +01:00
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
2022-04-26 15:01:29 +02:00
#include "td/telegram/PhotoFormat.h"
#include "td/telegram/StickerType.h"
2022-01-25 12:58:04 +01:00
#include "td/telegram/td_api.h"
2022-01-18 17:20:43 +01:00
#include "td/utils/common.h"
#include "td/utils/Slice.h"
#include "td/utils/StringBuilder.h"
namespace td {
// update store_sticker/store_sticker_set when this type changes
2022-01-25 12:58:04 +01:00
enum class StickerFormat : int32 { Unknown, Webp, Tgs, Webm };
2022-01-18 17:20:43 +01:00
StickerFormat get_sticker_format(const td_api::object_ptr<td_api::StickerFormat> &format);
2022-07-13 22:02:46 +02:00
StickerFormat get_sticker_format_by_mime_type(Slice mime_type);
StickerFormat get_sticker_format_by_extension(Slice extension);
2022-01-18 17:20:43 +01:00
td_api::object_ptr<td_api::StickerFormat> get_sticker_format_object(StickerFormat sticker_format);
2022-01-25 12:58:04 +01:00
2022-01-18 17:20:43 +01:00
string get_sticker_format_mime_type(StickerFormat sticker_format);
Slice get_sticker_format_extension(StickerFormat sticker_format);
2022-04-26 15:01:29 +02:00
PhotoFormat get_sticker_format_photo_format(StickerFormat sticker_format);
2022-01-18 17:20:43 +01:00
bool is_sticker_format_animated(StickerFormat sticker_format);
bool is_sticker_format_vector(StickerFormat sticker_format);
int64 get_max_sticker_file_size(StickerFormat sticker_format, StickerType sticker_type, bool for_thumbnail);
2022-01-18 17:20:43 +01:00
StringBuilder &operator<<(StringBuilder &string_builder, StickerFormat sticker_format);
} // namespace td