#include "image_util/loadimage.h"
#include <type_traits>
#include "common/mathutil.h"
#include "image_util/imageformats.h"
namespace angle
{
namespace
{
IntensityModifier;
static IntensityModifier intensityModifierDefault[] = …;
static IntensityModifier intensityModifierNonOpaque[] = …;
static const int kNumPixelsInBlock = …;
struct ETC2Block
{ … };
static const uint8_t DefaultETCAlphaValues[4][4] = …;
void LoadR11EACToR8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch,
bool isSigned)
{ … }
void LoadRG11EACToRG8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch,
bool isSigned)
{ … }
void LoadR11EACToR16(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch,
bool isSigned,
bool isFloat)
{ … }
void LoadRG11EACToRG16(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch,
bool isSigned,
bool isFloat)
{ … }
void LoadETC2RGB8ToRGBA8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch,
bool punchthroughAlpha)
{ … }
void LoadETC2RGB8ToBC1(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch,
bool punchthroughAlpha)
{ … }
void LoadETC2RGBA8ToBC3(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch,
bool punchthroughAlpha,
bool isSigned)
{ … }
void LoadETC2RGBA8ToRGBA8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch,
bool srgb)
{ … }
}
void LoadETC1RGB8ToRGBA8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC1RGB8ToBC1(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACR11ToR8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACR11SToR8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACRG11ToRG8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACRG11SToRG8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACR11ToR16(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACR11SToR16(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACRG11ToRG16(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACRG11SToRG16(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACR11ToR16F(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACR11SToR16F(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACRG11ToRG16F(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACRG11SToRG16F(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2RGB8ToRGBA8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2RGB8ToBC1(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2SRGB8ToRGBA8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2SRGB8ToBC1(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2RGB8A1ToRGBA8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2RGB8A1ToBC1(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2SRGB8A1ToRGBA8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2SRGB8A1ToBC1(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2RGBA8ToRGBA8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2SRGBA8ToSRGBA8(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2RGBA8ToBC3(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadETC2SRGBA8ToBC3(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACR11ToBC4(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch,
bool isSigned)
{ … }
void LoadEACRG11ToBC5(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch,
bool isSigned)
{ … }
void LoadEACR11ToBC4(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACR11SToBC4(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACRG11ToBC5(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
void LoadEACRG11SToBC5(const ImageLoadContext &context,
size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{ … }
}