mirror of https://github.com/mosra/magnum.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
129 lines
3.6 KiB
129 lines
3.6 KiB
|
13 years ago
|
/*
|
||
|
|
This file is part of Magnum.
|
||
|
|
|
||
|
|
Copyright © 2010, 2011, 2012, 2013 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 "ImageFormat.h"
|
||
|
|
|
||
|
|
#include <Utility/Debug.h>
|
||
|
|
|
||
|
|
namespace Magnum {
|
||
|
|
|
||
|
|
#ifndef DOXYGEN_GENERATING_OUTPUT
|
||
|
|
Debug operator<<(Debug debug, ImageFormat value) {
|
||
|
|
switch(value) {
|
||
|
|
#define _c(value) case ImageFormat::value: return debug << "ImageFormat::" #value;
|
||
|
|
_c(Red)
|
||
|
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
|
_c(Green)
|
||
|
|
_c(Blue)
|
||
|
|
#endif
|
||
|
|
_c(RG)
|
||
|
|
_c(RGB)
|
||
|
|
_c(RGBA)
|
||
|
|
#ifndef MAGNUM_TARGET_GLES
|
||
|
|
_c(BGR)
|
||
|
|
#endif
|
||
|
|
#ifndef MAGNUM_TARGET_GLES3
|
||
|
|
_c(BGRA)
|
||
|
|
#endif
|
||
|
|
#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)
|
||
|
|
#ifndef MAGNUM_TARGET_GLES3
|
||
|
|
_c(StencilIndex)
|
||
|
|
#endif
|
||
|
|
_c(DepthStencil)
|
||
|
|
#undef _c
|
||
|
|
}
|
||
|
|
|
||
|
|
return debug << "ImageFormat::(invalid)";
|
||
|
|
}
|
||
|
|
|
||
|
|
Debug operator<<(Debug debug, ImageType value) {
|
||
|
|
switch(value) {
|
||
|
|
#define _c(value) case ImageType::value: return debug << "ImageType::" #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)
|
||
|
|
#ifndef MAGNUM_TARGET_GLES3
|
||
|
|
_c(UnsignedShort4444Rev)
|
||
|
|
#endif
|
||
|
|
_c(UnsignedShort5551)
|
||
|
|
#ifndef MAGNUM_TARGET_GLES3
|
||
|
|
_c(UnsignedShort1555Rev)
|
||
|
|
#endif
|
||
|
|
#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 << "ImageType::(invalid)";
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
|
||
|
|
}
|