copyimage.inc (1271B)
1 // 2 // Copyright 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.inc: Defines image copying functions 8 9 namespace angle 10 { 11 template <typename sourceType, typename colorDataType> 12 void ReadColor(const uint8_t *source, uint8_t *dest) 13 { 14 sourceType::readColor(reinterpret_cast<Color<colorDataType>*>(dest), 15 reinterpret_cast<const sourceType*>(source)); 16 } 17 18 template <typename destType, typename colorDataType> 19 void WriteColor(const uint8_t *source, uint8_t *dest) 20 { 21 destType::writeColor(reinterpret_cast<destType*>(dest), 22 reinterpret_cast<const Color<colorDataType>*>(source)); 23 } 24 25 template <typename SourceType> 26 void ReadDepthStencil(const uint8_t *source, uint8_t *dest) 27 { 28 SourceType::ReadDepthStencil(reinterpret_cast<DepthStencil *>(dest), 29 reinterpret_cast<const SourceType *>(source)); 30 } 31 32 template <typename DestType> 33 void WriteDepthStencil(const uint8_t *source, uint8_t *dest) 34 { 35 DestType::WriteDepthStencil(reinterpret_cast<DestType *>(dest), 36 reinterpret_cast<const DepthStencil *>(source)); 37 } 38 } // namespace angle