|
|
|
|
/*
|
|
|
|
|
This file is part of Magnum.
|
|
|
|
|
|
|
|
|
|
Copyright © 2010, 2011, 2012, 2013, 2014
|
|
|
|
|
Vladimír Vondruš <mosra@centrum.cz>
|
|
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
copy of this software and associated documentation files (the "Software"),
|
|
|
|
|
to deal in the Software without restriction, including without limitation
|
|
|
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
|
Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included
|
|
|
|
|
in all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
|
DEALINGS IN THE SOFTWARE.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ColorFormat.h"
|
|
|
|
|
|
|
|
|
|
#include <Corrade/Utility/Debug.h>
|
|
|
|
|
|
|
|
|
|
namespace Magnum {
|
|
|
|
|
|
|
|
|
|
#ifndef DOXYGEN_GENERATING_OUTPUT
|
|
|
|
|
Debug operator<<(Debug debug, const ColorFormat value) {
|
|
|
|
|
switch(value) {
|
|
|
|
|
#define _c(value) case ColorFormat::value: return debug << "ColorFormat::" #value;
|
|
|
|
|
_c(Red)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES
|
|
|
|
|
_c(Green)
|
|
|
|
|
_c(Blue)
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef MAGNUM_TARGET_GLES2
|
|
|
|
|
_c(Luminance)
|
|
|
|
|
#endif
|
|
|
|
|
_c(RG)
|
|
|
|
|
#ifdef MAGNUM_TARGET_GLES2
|
|
|
|
|
_c(LuminanceAlpha)
|
|
|
|
|
#endif
|
|
|
|
|
_c(RGB)
|
|
|
|
|
_c(RGBA)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES
|
|
|
|
|
_c(BGR)
|
|
|
|
|
#endif
|
|
|
|
|
_c(BGRA)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES2
|
|
|
|
|
_c(RedInteger)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES
|
|
|
|
|
_c(GreenInteger)
|
|
|
|
|
_c(BlueInteger)
|
|
|
|
|
#endif
|
|
|
|
|
_c(RGInteger)
|
|
|
|
|
_c(RGBInteger)
|
|
|
|
|
_c(RGBAInteger)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES
|
|
|
|
|
_c(BGRInteger)
|
|
|
|
|
_c(BGRAInteger)
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
_c(DepthComponent)
|
|
|
|
|
_c(StencilIndex)
|
|
|
|
|
_c(DepthStencil)
|
|
|
|
|
#undef _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return debug << "ColorFormat::(invalid)";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Debug operator<<(Debug debug, const ColorType value) {
|
|
|
|
|
switch(value) {
|
|
|
|
|
#define _c(value) case ColorType::value: return debug << "ColorType::" #value;
|
|
|
|
|
_c(UnsignedByte)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES2
|
|
|
|
|
_c(Byte)
|
|
|
|
|
#endif
|
|
|
|
|
_c(UnsignedShort)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES2
|
|
|
|
|
_c(Short)
|
|
|
|
|
#endif
|
|
|
|
|
_c(UnsignedInt)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES2
|
|
|
|
|
_c(Int)
|
|
|
|
|
#endif
|
|
|
|
|
_c(HalfFloat)
|
|
|
|
|
_c(Float)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES
|
|
|
|
|
_c(UnsignedByte332)
|
|
|
|
|
_c(UnsignedByte233Rev)
|
|
|
|
|
#endif
|
|
|
|
|
_c(UnsignedShort565)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES
|
|
|
|
|
_c(UnsignedShort565Rev)
|
|
|
|
|
#endif
|
|
|
|
|
_c(UnsignedShort4444)
|
|
|
|
|
_c(UnsignedShort4444Rev)
|
|
|
|
|
_c(UnsignedShort5551)
|
|
|
|
|
_c(UnsignedShort1555Rev)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES
|
|
|
|
|
_c(UnsignedInt8888)
|
|
|
|
|
_c(UnsignedInt8888Rev)
|
|
|
|
|
_c(UnsignedInt1010102)
|
|
|
|
|
#endif
|
|
|
|
|
_c(UnsignedInt2101010Rev)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES2
|
|
|
|
|
_c(UnsignedInt10F11F11FRev)
|
|
|
|
|
_c(UnsignedInt5999Rev)
|
|
|
|
|
#endif
|
|
|
|
|
_c(UnsignedInt248)
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES2
|
|
|
|
|
_c(Float32UnsignedInt248Rev)
|
|
|
|
|
#endif
|
|
|
|
|
#undef _c
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return debug << "ColorType::(invalid)";
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
}
|