#include "components/viz/common/resources/shared_image_format.h"
#include <compare>
#include <optional>
#include <type_traits>
#include "base/check_op.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "base/strings/stringprintf.h"
namespace viz {
namespace {
static size_t ConvertBitsToBytes(size_t bits) { … }
const char* SinglePlaneFormatToString(SharedImageFormat format) { … }
int BitsPerPixelForTrueSinglePlaneFormat(SharedImageFormat format) { … }
uint64_t StorageBytesPerElement(SharedImageFormat::ChannelFormat channel) { … }
const char* PlaneConfigToString(SharedImageFormat::PlaneConfig plane) { … }
const char* SubsamplingToString(SharedImageFormat::Subsampling subsampling) { … }
const char* ChannelFormatToString(SharedImageFormat::ChannelFormat channel) { … }
const char* PrefersExternalSamplerToString(SharedImageFormat format) { … }
SharedImageFormat GetEquivalentMultiplanarFormat(SharedImageFormat format) { … }
}
static_assert …;
static_assert …;
static_assert …;
bool SharedImageFormat::IsBitmapFormatSupported() const { … }
int SharedImageFormat::NumberOfPlanes() const { … }
bool SharedImageFormat::IsValidPlaneIndex(int plane_index) const { … }
std::optional<size_t> SharedImageFormat::MaybeEstimatedPlaneSizeInBytes(
int plane_index,
const gfx::Size& size) const { … }
std::optional<size_t> SharedImageFormat::MaybeEstimatedSizeInBytes(
const gfx::Size& size) const { … }
size_t SharedImageFormat::EstimatedSizeInBytes(const gfx::Size& size) const { … }
bool SharedImageFormat::VerifySizeInBytes(const gfx::Size& size) const { … }
gfx::Size SharedImageFormat::GetPlaneSize(int plane_index,
const gfx::Size& size) const { … }
int SharedImageFormat::NumChannelsInPlane(int plane_index) const { … }
int SharedImageFormat::MultiplanarBitDepth() const { … }
std::string SharedImageFormat::ToString() const { … }
std::string SharedImageFormat::ToTestParamString() const { … }
bool SharedImageFormat::HasAlpha() const { … }
bool SharedImageFormat::IsCompressed() const { … }
bool SharedImageFormat::IsLegacyMultiplanar() const { … }
int SharedImageFormat::BitsPerPixel() const { … }
bool SharedImageFormat::operator==(const SharedImageFormat& o) const { … }
std::weak_ordering SharedImageFormat::operator<=>(
const SharedImageFormat& o) const { … }
bool SharedImageFormat::SharedImageFormatUnion::MultiplanarFormat::operator==(
const MultiplanarFormat& o) const { … }
std::weak_ordering
SharedImageFormat::SharedImageFormatUnion::MultiplanarFormat::operator<=>(
const MultiplanarFormat& o) const { … }
}