1// 2// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved. 3// Use of this source code is governed by a BSD-style license that can be 4// found in the LICENSE file. 5// 6 7// copyimage.inl: Defines image copying functions 8 9namespace rx 10{ 11 12template <typename sourceType, typename colorDataType> 13inline void ReadColor(const uint8_t *source, uint8_t *dest) 14{ 15 sourceType::readColor(reinterpret_cast<gl::Color<colorDataType>*>(dest), reinterpret_cast<const sourceType*>(source)); 16} 17 18template <typename destType, typename colorDataType> 19inline void WriteColor(const uint8_t *source, uint8_t *dest) 20{ 21 destType::writeColor(reinterpret_cast<destType*>(dest), reinterpret_cast<const gl::Color<colorDataType>*>(source)); 22} 23 24template <typename sourceType, typename destType, typename colorDataType> 25inline void CopyPixel(const uint8_t *source, uint8_t *dest) 26{ 27 colorType temp; 28 ReadColor<sourceType, colorDataType>(source, &temp); 29 WriteColor<destType, colorDataType>(&temp, dest); 30} 31 32} 33