Hash :
fe28ca06
Author :
Date :
2013-06-04T10:10:48
Added table entries for reading colors from D3D and DXGI formats and writing colors to format/type combinations. TRAC #23256 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
//
// Copyright (c) 2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// copyimage.h: Defines image copying functions
#ifndef LIBGLESV2_RENDERER_COPYIMAGE_H_
#define LIBGLESV2_RENDERER_COPYIMAGE_H_
#include "common/mathutil.h"
#include "libGLESv2/angletypes.h"
namespace rx
{
template <typename sourceType, typename colorDataType>
void ReadColor(const void *source, void *dest)
{
sourceType::readColor(reinterpret_cast<gl::Color<colorDataType>*>(dest), reinterpret_cast<const sourceType*>(source));
}
template <typename destType, typename colorDataType>
void WriteColor(const void *source, void *dest)
{
destType::writeColor(reinterpret_cast<destType*>(dest), reinterpret_cast<const gl::Color<colorDataType>*>(source));
}
template <typename sourceType, typename destType, typename colorDataType>
void CopyPixel(const void *source, void *dest)
{
colorType temp;
ReadColor<sourceType, colorDataType>(source, &temp);
WriteColor<destType, colorDataType>(&temp, dest);
}
void CopyBGRAUByteToRGBAUByte(const void *source, void *dest);
}
#endif // LIBGLESV2_RENDERER_COPYIMAGE_H_