2021-06-12 18:05:28 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
//
|
|
|
|
// EmulationStation Desktop Edition
|
|
|
|
// CImgUtil.h
|
|
|
|
//
|
|
|
|
// Utility functions using the CImg image processing library.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ES_CORE_UTILS_CIMG_UTIL_H
|
|
|
|
#define ES_CORE_UTILS_CIMG_UTIL_H
|
|
|
|
|
|
|
|
// Disable the CImg display capabilities.
|
|
|
|
#define cimg_display 0
|
|
|
|
|
2021-10-06 16:41:21 +00:00
|
|
|
#include "CImg.h"
|
|
|
|
|
2021-06-12 18:05:28 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace Utils
|
|
|
|
{
|
|
|
|
namespace CImg
|
|
|
|
{
|
|
|
|
void convertRGBAToCImg(std::vector<unsigned char> imageRGBA,
|
2021-07-07 18:31:46 +00:00
|
|
|
cimg_library::CImg<unsigned char>& image);
|
2021-06-12 18:05:28 +00:00
|
|
|
void convertCImgToRGBA(cimg_library::CImg<unsigned char> image,
|
2021-07-07 18:31:46 +00:00
|
|
|
std::vector<unsigned char>& imageRGBA);
|
2021-06-12 18:05:28 +00:00
|
|
|
void getTransparentPaddingCoords(cimg_library::CImg<unsigned char>& image,
|
2021-07-07 18:31:46 +00:00
|
|
|
int (&imageCoords)[4]);
|
2021-06-12 18:05:28 +00:00
|
|
|
void removeTransparentPadding(cimg_library::CImg<unsigned char>& image);
|
|
|
|
void cropLetterboxes(cimg_library::CImg<unsigned char>& image);
|
|
|
|
void cropPillarboxes(cimg_library::CImg<unsigned char>& image);
|
2021-07-07 18:31:46 +00:00
|
|
|
void addDropShadow(cimg_library::CImg<unsigned char>& image,
|
|
|
|
unsigned int shadowDistance,
|
|
|
|
float transparency,
|
|
|
|
unsigned int iterations);
|
|
|
|
} // namespace CImg
|
|
|
|
|
|
|
|
} // namespace Utils
|
2021-06-12 18:05:28 +00:00
|
|
|
|
|
|
|
#endif // ES_CORE_UTILS_CIMG_UTIL_H
|