// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#ifndef RCPP_gdtools_RCPPEXPORTS_H_GEN_
#define RCPP_gdtools_RCPPEXPORTS_H_GEN_

#include "gdtools_types.h"
#include <Rcpp.h>

namespace gdtools {

    using namespace Rcpp;

    namespace {
        void validateSignature(const char* sig) {
            Rcpp::Function require = Rcpp::Environment::base_env()["require"];
            require("gdtools", Rcpp::Named("quietly") = true);
            typedef int(*Ptr_validate)(const char*);
            static Ptr_validate p_validate = (Ptr_validate)
                R_GetCCallable("gdtools", "_gdtools_RcppExport_validate");
            if (!p_validate(sig)) {
                throw Rcpp::function_not_exported(
                    "C++ function with signature '" + std::string(sig) + "' not found in gdtools");
            }
        }
    }

    inline XPtrCairoContext context_create() {
        typedef SEXP(*Ptr_context_create)();
        static Ptr_context_create p_context_create = NULL;
        if (p_context_create == NULL) {
            validateSignature("XPtrCairoContext(*context_create)()");
            p_context_create = (Ptr_context_create)R_GetCCallable("gdtools", "_gdtools_context_create");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_context_create();
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<XPtrCairoContext >(rcpp_result_gen);
    }

    inline bool context_set_font(XPtrCairoContext cc, std::string fontname, double fontsize, bool bold, bool italic, std::string fontfile = "") {
        typedef SEXP(*Ptr_context_set_font)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_context_set_font p_context_set_font = NULL;
        if (p_context_set_font == NULL) {
            validateSignature("bool(*context_set_font)(XPtrCairoContext,std::string,double,bool,bool,std::string)");
            p_context_set_font = (Ptr_context_set_font)R_GetCCallable("gdtools", "_gdtools_context_set_font");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_context_set_font(Shield<SEXP>(Rcpp::wrap(cc)), Shield<SEXP>(Rcpp::wrap(fontname)), Shield<SEXP>(Rcpp::wrap(fontsize)), Shield<SEXP>(Rcpp::wrap(bold)), Shield<SEXP>(Rcpp::wrap(italic)), Shield<SEXP>(Rcpp::wrap(fontfile)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<bool >(rcpp_result_gen);
    }

    inline FontMetric context_extents(XPtrCairoContext cc, std::string x) {
        typedef SEXP(*Ptr_context_extents)(SEXP,SEXP);
        static Ptr_context_extents p_context_extents = NULL;
        if (p_context_extents == NULL) {
            validateSignature("FontMetric(*context_extents)(XPtrCairoContext,std::string)");
            p_context_extents = (Ptr_context_extents)R_GetCCallable("gdtools", "_gdtools_context_extents");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_context_extents(Shield<SEXP>(Rcpp::wrap(cc)), Shield<SEXP>(Rcpp::wrap(x)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<FontMetric >(rcpp_result_gen);
    }

    inline std::string raster_to_str(std::vector<unsigned int> raster, int w, int h, double width, double height, int interpolate) {
        typedef SEXP(*Ptr_raster_to_str)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_raster_to_str p_raster_to_str = NULL;
        if (p_raster_to_str == NULL) {
            validateSignature("std::string(*raster_to_str)(std::vector<unsigned int>,int,int,double,double,int)");
            p_raster_to_str = (Ptr_raster_to_str)R_GetCCallable("gdtools", "_gdtools_raster_to_str");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_raster_to_str(Shield<SEXP>(Rcpp::wrap(raster)), Shield<SEXP>(Rcpp::wrap(w)), Shield<SEXP>(Rcpp::wrap(h)), Shield<SEXP>(Rcpp::wrap(width)), Shield<SEXP>(Rcpp::wrap(height)), Shield<SEXP>(Rcpp::wrap(interpolate)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<std::string >(rcpp_result_gen);
    }

    inline int raster_to_file(std::vector<unsigned int> raster, int w, int h, double width, double height, int interpolate, std::string filename) {
        typedef SEXP(*Ptr_raster_to_file)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_raster_to_file p_raster_to_file = NULL;
        if (p_raster_to_file == NULL) {
            validateSignature("int(*raster_to_file)(std::vector<unsigned int>,int,int,double,double,int,std::string)");
            p_raster_to_file = (Ptr_raster_to_file)R_GetCCallable("gdtools", "_gdtools_raster_to_file");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_raster_to_file(Shield<SEXP>(Rcpp::wrap(raster)), Shield<SEXP>(Rcpp::wrap(w)), Shield<SEXP>(Rcpp::wrap(h)), Shield<SEXP>(Rcpp::wrap(width)), Shield<SEXP>(Rcpp::wrap(height)), Shield<SEXP>(Rcpp::wrap(interpolate)), Shield<SEXP>(Rcpp::wrap(filename)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<int >(rcpp_result_gen);
    }

    inline bool raster_png_(CharacterVector raster_, int w, int h, double width, double height, int interpolate, std::string filename) {
        typedef SEXP(*Ptr_raster_png_)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_raster_png_ p_raster_png_ = NULL;
        if (p_raster_png_ == NULL) {
            validateSignature("bool(*raster_png_)(CharacterVector,int,int,double,double,int,std::string)");
            p_raster_png_ = (Ptr_raster_png_)R_GetCCallable("gdtools", "_gdtools_raster_png_");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_raster_png_(Shield<SEXP>(Rcpp::wrap(raster_)), Shield<SEXP>(Rcpp::wrap(w)), Shield<SEXP>(Rcpp::wrap(h)), Shield<SEXP>(Rcpp::wrap(width)), Shield<SEXP>(Rcpp::wrap(height)), Shield<SEXP>(Rcpp::wrap(interpolate)), Shield<SEXP>(Rcpp::wrap(filename)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<bool >(rcpp_result_gen);
    }

    inline std::string base64_raster_encode(CharacterVector raster_, int w, int h, double width, double height, int interpolate) {
        typedef SEXP(*Ptr_base64_raster_encode)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_base64_raster_encode p_base64_raster_encode = NULL;
        if (p_base64_raster_encode == NULL) {
            validateSignature("std::string(*base64_raster_encode)(CharacterVector,int,int,double,double,int)");
            p_base64_raster_encode = (Ptr_base64_raster_encode)R_GetCCallable("gdtools", "_gdtools_base64_raster_encode");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_base64_raster_encode(Shield<SEXP>(Rcpp::wrap(raster_)), Shield<SEXP>(Rcpp::wrap(w)), Shield<SEXP>(Rcpp::wrap(h)), Shield<SEXP>(Rcpp::wrap(width)), Shield<SEXP>(Rcpp::wrap(height)), Shield<SEXP>(Rcpp::wrap(interpolate)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<std::string >(rcpp_result_gen);
    }

    inline std::string base64_file_encode(std::string filename) {
        typedef SEXP(*Ptr_base64_file_encode)(SEXP);
        static Ptr_base64_file_encode p_base64_file_encode = NULL;
        if (p_base64_file_encode == NULL) {
            validateSignature("std::string(*base64_file_encode)(std::string)");
            p_base64_file_encode = (Ptr_base64_file_encode)R_GetCCallable("gdtools", "_gdtools_base64_file_encode");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_base64_file_encode(Shield<SEXP>(Rcpp::wrap(filename)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<std::string >(rcpp_result_gen);
    }

    inline std::string base64_string_encode(std::string string) {
        typedef SEXP(*Ptr_base64_string_encode)(SEXP);
        static Ptr_base64_string_encode p_base64_string_encode = NULL;
        if (p_base64_string_encode == NULL) {
            validateSignature("std::string(*base64_string_encode)(std::string)");
            p_base64_string_encode = (Ptr_base64_string_encode)R_GetCCallable("gdtools", "_gdtools_base64_string_encode");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_base64_string_encode(Shield<SEXP>(Rcpp::wrap(string)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<std::string >(rcpp_result_gen);
    }

}

#endif // RCPP_gdtools_RCPPEXPORTS_H_GEN_
