2016-08-17 23:49:13 +00:00
|
|
|
// Copyright 2016 The University of North Carolina at Chapel Hill
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
// Please send all BUG REPORTS to <pavel@cs.unc.edu>.
|
|
|
|
// <http://gamma.cs.unc.edu/FasTC/>
|
2013-08-29 22:31:42 +00:00
|
|
|
|
2013-10-04 22:35:18 +00:00
|
|
|
#ifndef PVRTCENCODER_TEST_TESTUTILS_H_
|
|
|
|
#define PVRTCENCODER_TEST_TESTUTILS_H_
|
2013-08-29 22:31:42 +00:00
|
|
|
|
2014-11-18 22:07:26 +00:00
|
|
|
#include "FasTC/TexCompTypes.h"
|
2013-09-06 05:57:06 +00:00
|
|
|
|
2013-10-04 22:35:18 +00:00
|
|
|
class PixelPrinter {
|
2013-08-29 22:31:42 +00:00
|
|
|
private:
|
2013-10-04 22:35:18 +00:00
|
|
|
uint32 m_PixelValue;
|
|
|
|
public:
|
|
|
|
explicit PixelPrinter(uint32 p) : m_PixelValue(p) { }
|
|
|
|
bool operator==(const PixelPrinter &other) const {
|
|
|
|
return other.m_PixelValue == this->m_PixelValue;
|
|
|
|
}
|
|
|
|
uint32 Value() const { return m_PixelValue; }
|
2013-08-29 22:31:42 +00:00
|
|
|
};
|
|
|
|
|
2013-10-04 22:35:18 +00:00
|
|
|
inline ::std::ostream& operator<<(::std::ostream& os, const PixelPrinter& pp) {
|
|
|
|
uint32 p = pp.Value();
|
|
|
|
uint32 r = p & 0xFF;
|
|
|
|
uint32 g = (p >> 8) & 0xFF;
|
|
|
|
uint32 b = (p >> 16) & 0xFF;
|
|
|
|
uint32 a = (p >> 24) & 0xFF;
|
|
|
|
return os <<
|
|
|
|
"R: 0x" << ::std::hex << r << " " <<
|
|
|
|
"G: 0x" << ::std::hex << g << " " <<
|
|
|
|
"B: 0x" << ::std::hex << b << " " <<
|
|
|
|
"A: 0x" << ::std::hex << a;
|
|
|
|
}
|
2013-08-29 22:31:42 +00:00
|
|
|
|
2013-10-04 22:35:18 +00:00
|
|
|
#endif // PVRTCENCODER_TEST_TESTUTILS_H_
|