2022-04-11 16:19:02 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#ifndef FF_INCLUDED_LOGO_SIXEL_sixel
|
|
|
|
|
#define FF_INCLUDED_LOGO_SIXEL_sixel
|
|
|
|
|
|
2022-04-29 21:44:32 +02:00
|
|
|
#include "../logo.h"
|
2022-04-11 16:19:02 +02:00
|
|
|
|
|
|
|
|
#if defined(FF_HAVE_IMAGEMAGICK7) || defined(FF_HAVE_IMAGEMAGICK6)
|
|
|
|
|
|
2022-06-08 10:59:33 +02:00
|
|
|
typedef enum FFLogoImageResult
|
|
|
|
|
{
|
|
|
|
|
FF_LOGO_IMAGE_RESULT_SUCCESS, //Logo printed
|
|
|
|
|
FF_LOGO_IMAGE_RESULT_INIT_ERROR, //Failed to load library, try again with next IM version
|
2022-12-23 12:44:19 +08:00
|
|
|
FF_LOGO_IMAGE_RESULT_RUN_ERROR //Failed to load / convert image, cancel whole sixel code
|
2022-06-08 10:59:33 +02:00
|
|
|
} FFLogoImageResult;
|
|
|
|
|
|
2022-04-21 15:50:45 +02:00
|
|
|
typedef struct FFLogoRequestData
|
|
|
|
|
{
|
|
|
|
|
FFLogoType type;
|
|
|
|
|
FFstrbuf cacheDir;
|
|
|
|
|
|
|
|
|
|
double characterPixelWidth;
|
|
|
|
|
double characterPixelHeight;
|
2022-05-23 15:32:10 +02:00
|
|
|
|
|
|
|
|
uint32_t logoPixelWidth;
|
|
|
|
|
uint32_t logoPixelHeight;
|
|
|
|
|
|
|
|
|
|
uint32_t logoCharacterHeight;
|
|
|
|
|
uint32_t logoCharacterWidth;
|
2022-04-21 15:50:45 +02:00
|
|
|
} FFLogoRequestData;
|
|
|
|
|
|
|
|
|
|
typedef struct FFIMData
|
|
|
|
|
{
|
|
|
|
|
void* library;
|
|
|
|
|
void*(*resizeFunc)(const void* image, size_t width, size_t height, void* exceptionInfo);
|
|
|
|
|
} FFIMData;
|
2022-04-11 16:19:02 +02:00
|
|
|
|
2023-06-24 10:59:53 +08:00
|
|
|
FFLogoImageResult ffLogoPrintImageImpl(FFLogoRequestData* requestData, const FFIMData* imData);
|
2022-04-11 16:19:02 +02:00
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-04-11 22:51:51 +02:00
|
|
|
#ifdef FF_HAVE_IMAGEMAGICK7
|
2023-06-24 10:59:53 +08:00
|
|
|
FFLogoImageResult ffLogoPrintImageIM7(FFLogoRequestData* requestData);
|
2022-04-11 22:51:51 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef FF_HAVE_IMAGEMAGICK6
|
|
|
|
|
#include <math.h>
|
2023-06-24 10:59:53 +08:00
|
|
|
FFLogoImageResult ffLogoPrintImageIM6(FFLogoRequestData* requestData);
|
2022-04-11 22:51:51 +02:00
|
|
|
#endif
|
|
|
|
|
|
2022-04-11 16:19:02 +02:00
|
|
|
#endif
|