mirror of
https://github.com/hyprwm/hyprpaper.git
synced 2024-12-22 12:19:49 +01:00
parent
f8cab3c370
commit
ef0e051255
2 changed files with 10 additions and 10 deletions
|
@ -4,10 +4,6 @@
|
|||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
|
||||
#error "your system is not little endian, jpeg will not work, ping vaxry or something"
|
||||
#endif
|
||||
|
||||
cairo_surface_t* JPEG::createSurfaceFromJPEG(const std::string& path) {
|
||||
|
||||
if (!std::filesystem::exists(path)) {
|
||||
|
@ -44,7 +40,11 @@ cairo_surface_t* JPEG::createSurfaceFromJPEG(const std::string& path) {
|
|||
jpeg_mem_src(&decompressStruct, (const unsigned char*)imageRawData, fileInfo.st_size);
|
||||
jpeg_read_header(&decompressStruct, true);
|
||||
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
decompressStruct.out_color_space = JCS_EXT_BGRA;
|
||||
#else
|
||||
decompressStruct.out_color_space = JCS_EXT_ARGB;
|
||||
#endif
|
||||
|
||||
// decompress
|
||||
jpeg_start_decompress(&decompressStruct);
|
||||
|
|
|
@ -52,11 +52,11 @@ cairo_surface_t* WEBP::createSurfaceFromWEBP(const std::string& path) {
|
|||
}
|
||||
|
||||
|
||||
if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||||
config.output.colorspace = MODE_bgrA;
|
||||
else
|
||||
config.output.colorspace = MODE_Argb;
|
||||
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
config.output.colorspace = MODE_bgrA;
|
||||
#else
|
||||
config.output.colorspace = MODE_Argb;
|
||||
#endif
|
||||
|
||||
const auto CAIRODATA = cairo_image_surface_get_data(cairoSurface);
|
||||
const auto CAIROSTRIDE = cairo_image_surface_get_stride(cairoSurface);
|
||||
|
|
Loading…
Reference in a new issue