DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
src/output/output_tools_xbrz.h
00001 #include "dosbox.h"
00002 
00003 #ifndef DOSBOX_OUTPUT_TOOLS_XBRZ_H
00004 #define DOSBOX_OUTPUT_TOOLS_XBRZ_H
00005 
00006 #if C_XBRZ || C_SURFACE_POSTRENDER_ASPECT
00007 #include <xBRZ/xbrz_tools.h>
00008 #include <cmath>
00009 
00010 #if defined(WIN32) && !defined(__MINGW32__) && !defined(HX_DOS)
00011 #define XBRZ_PPL 1
00012 #include <ppl.h>
00013 #endif
00014 
00015 #endif /*C_XBRZ || C_SURFACE_POSTRENDER_ASPECT*/
00016 
00017 #if C_XBRZ
00018 #include <xBRZ/xbrz.h>
00019 
00020 struct SDL_xBRZ {
00021     // configuration
00022     bool enable = false;
00023     bool postscale_bilinear = false;
00024     int task_granularity = 0;
00025     int fixed_scale_factor = 0;
00026     int max_scale_factor = 0;
00027 
00028     // runtime
00029     bool scale_on = false;
00030     int scale_factor = 0;
00031     std::vector<uint32_t> renderbuf = {};
00032     std::vector<uint32_t> pixbuf = {};
00033 };
00034 
00035 extern SDL_xBRZ sdl_xbrz;
00036 
00037 void xBRZ_Initialize();
00038 void xBRZ_Change_Options(Section_prop* section);
00039 bool xBRZ_SetScaleParameters(int srcWidth, int srcHeight, int dstWidth, int dstHeight);
00040 void xBRZ_Render(const uint32_t* renderBuf, uint32_t* xbrzBuf, const Bit16u *changedLines, const int srcWidth, const int srcHeight, int scalingFactor);
00041 void xBRZ_PostScale(const uint32_t* src, const int srcWidth, const int srcHeight, const int srcPitch,
00042     uint32_t* tgt, const int tgtWidth, const int tgtHeight, const int tgtPitch,
00043     const bool bilinear, const int task_granularity);
00044 
00045 #endif
00046 
00047 #endif /*DOSBOX_OUTPUT_TOOLS_XBRZ_H*/