Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
ImageTools.cpp File Reference
#include "Headers/ImageTools.h"
#include "Core/Headers/StringHelper.h"
#include "Utility/Headers/Localization.h"
#include "Platform/File/Headers/FileManagement.h"
#include "Platform/Video/Textures/Headers/Texture.h"
#include "Core/Headers/PlatformContext.h"
#include "stb_image.h"
#include "stb_image_resize.h"
#include "stb_image_write.h"
#include <IL/il.h>
#include <IL/ilu.h>
#include <nvtt/nvtt.h>
#include <glm/detail/type_half.hpp>

Go to the source code of this file.

Classes

struct  Divide::ImageTools::nvttHelpers::ErrorHandler
 
struct  Divide::ImageTools::nvttHelpers::OutputHandler
 
struct  Divide::ImageTools::nvttHelpers::OutputHandler::MipMapData
 

Namespaces

namespace  Divide
 Handle console commands that start with a forward slash.
 
namespace  Divide::ImageTools
 
namespace  Divide::ImageTools::nvttHelpers
 
namespace  Divide::ImageTools::anonymous_namespace{ImageTools.cpp}
 

Macros

#define STB_IMAGE_IMPLEMENTATION
 
#define STBI_FAILURE_USERMSG
 
#define STB_IMAGE_RESIZE_IMPLEMENTATION
 
#define STB_IMAGE_WRITE_IMPLEMENTATION
 
#define stbi__float2int(x)   ((int) (x))
 

Functions

static bool Divide::ImageTools::nvttHelpers::isBC1n (const nvtt::Format format, const bool isNormalMap) noexcept
 
static nvtt::Format Divide::ImageTools::nvttHelpers::getNVTTFormat (const ImageOutputFormat outputFormat, const bool isNormalMap, const bool hasAlpha, const bool isGreyscale) noexcept
 
static nvtt::MipmapFilter Divide::ImageTools::nvttHelpers::getNVTTMipFilter (const MipMapFilter filter) noexcept
 
FORCE_INLINE I32 Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::determineFace (const I32 i, const bool isDDS, const bool isCube) noexcept
 
bool Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::checkError (string &messageInOut) noexcept
 
void Divide::ImageTools::OnStartup (bool upperLeftOrigin)
 
void Divide::ImageTools::OnShutdown ()
 
bool Divide::ImageTools::UseUpperLeftOrigin () noexcept
 
static stbi__uint16 * Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::stbi__hdr_to_16 (float *data, int x, int y, int comp)
 
static glm::detail::hdata * Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::stbi__hdr_to_half (float *data, int x, int y, int comp)
 
static glm::detail::hdata * Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::stbi__ldr_to_half (stbi_uc *data, int x, int y, int comp)
 
static glm::detail::hdata * Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::stbi__16_to_half (stbi__uint16 *data, int x, int y, int comp)
 
static float * Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::stbi__16_to_hdr (stbi__uint16 *data, int x, int y, int comp)
 
template<typename To , typename From >
static To * Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::stbi_convert (From *data, int x, int y, int comp)
 
FORCE_INLINE U8 Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::F32ToU8Colour (const F32 val) noexcept
 
FORCE_INLINE U8 Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::U32ToU8Colour (const U32 val) noexcept
 
FORCE_INLINE U8 Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::U16ToU8Colour (const U16 val) noexcept
 
FORCE_INLINE U8 Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::HalfToU8Colour (const glm::detail::hdata val) noexcept
 
FORCE_INLINE U8 Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::U8ToU8Colour (const U8 val) noexcept
 
template<size_t src_comp_num, bool source_is_BGR>
void Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::flipAndConvertToRGB8 (const Byte *sourceBuffer, Byte *destBuffer, const U16 width, const U16 height, const U8 bytesPerPixel)
 
bool Divide::ImageTools::SaveImage (const ResourcePath &filename, U16 width, U16 height, U8 numberOfComponents, U8 bytesPerPixel, const bool sourceIsBGR, const Byte *imageData, SaveImageFormat format)
 Save an image to file of the desired format. Only R/RG/RGB/RGBA 8 bits per pixel data is supported as input data.
 
bool Divide::ImageTools::SaveImageHDR (const ResourcePath &filename, U16 width, U16 height, U8 numberOfComponents, U8 bytesPerPixel, const bool sourceIsBGR, const F32 *imageData)
 Save an HDR image to file of the desired format.
 

Variables

constexpr bool Divide::ImageTools::g_KeepDevILDDSCompatibility = true
 
Mutex Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::s_imageLoadingMutex
 
bool Divide::ImageTools::anonymous_namespace{ImageTools.cpp}::s_useUpperLeftOrigin = false
 

Macro Definition Documentation

◆ STB_IMAGE_IMPLEMENTATION

#define STB_IMAGE_IMPLEMENTATION

Definition at line 10 of file ImageTools.cpp.

◆ STB_IMAGE_RESIZE_IMPLEMENTATION

#define STB_IMAGE_RESIZE_IMPLEMENTATION

Definition at line 14 of file ImageTools.cpp.

◆ STB_IMAGE_WRITE_IMPLEMENTATION

#define STB_IMAGE_WRITE_IMPLEMENTATION

Definition at line 16 of file ImageTools.cpp.

◆ stbi__float2int

#define stbi__float2int (   x)    ((int) (x))

Definition at line 221 of file ImageTools.cpp.

◆ STBI_FAILURE_USERMSG

#define STBI_FAILURE_USERMSG

Definition at line 11 of file ImageTools.cpp.