<commit_before>/*##############################################################################
#    GIPPY: Geospatial Image Processing library for Python
#
#    Copyright (C) 2014 <NAME>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program. If not, see <http://www.gnu.org/licenses/>
##############################################################################*/

#ifndef GIP_GEOALGORITHMS_H
#define GIP_GEOALGORITHMS_H

#include <gip/GeoImage.h>
#include <gip/GeoRaster.h>
#include <initializer_list>

namespace gip {
    template<class T> CImg<T> _test(CImg<T> cimg) {
        //std::cout << "GIPPY CImg input/output test" << std::endl;
        //std::cout << "typeid = " << typeid(T) << std::endl;
        cimg_printinfo(cimg);
        cimg_printstats(cimg);
        cimg_print(cimg);
        return cimg;
    }
    template<class T> CImg<T> _testuc(CImg<unsigned char> cimg) {
        //std::cout << "GIPPY CImg input/output test" << std::endl;
        //std::cout << "typeid = " << typeid(T) << std::endl;
        cimg_printinfo(cimg);
        cimg_printstats(cimg);
        cimg_print(cimg);
        return cimg;
    }

    //! Create cloudmask using ACCA
    GeoImage ACCA(const GeoImage&, std::string, float, float, int = 5, int = 10, int = 4000, dictionary=dictionary());

    //! Stretch image into byte
    std::string BrowseImage(const GeoImage&, int quality=75);

    //! Create single image from multiple input images using vector file footprint
    GeoImage CookieCutter(std::vector<std::string>, std::string, std::string, 
        float=1.0, float=1.0, bool crop=false, dictionary=dictionary());

    //! Create new file with a Fmask cloud mask
    GeoImage Fmask(const GeoImage&, std::string, int=3, int=5, dictionary=dictionary());

    //! Kmeans
    //GeoImage kmeans(const GeoImage&, std::string, int classes=5, int iterations=5, float threshold=1.0);

    //! Create indices in one pass: NDVI, EVI, LSWI, NDSI, BI {product, filename}
    dictionary Indices(const GeoImage&, dictionary, dictionary=dictionary());

    //! Create output based on linear combinations of input
    GeoImage LinearTransform(const GeoImage&, std::string filename, CImg<float> coef);

    //! Calculate spectral statistics and output to new image<commit_msg>comment out test code<commit_after>/*##############################################################################
#    GIPPY: Geospatial Image Processing library for Python
#
#    Copyright (C) 2014 <NAME>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program. If not, see <http://www.gnu.org/licenses/>
##############################################################################*/

#ifndef GIP_GEOALGORITHMS_H
#define GIP_GEOALGORITHMS_H

#include <gip/GeoImage.h>
#include <gip/GeoRaster.h>
#include <initializer_list>

namespace gip {
    /*template<class T> CImg<T> _test(CImg<T> cimg) {
        //std::cout << "GIPPY CImg input/output test" << std::endl;
        //std::cout << "typeid = " << typeid(T) << std::endl;
        cimg_printinfo(cimg);
        cimg_printstats(cimg);
        cimg_print(cimg);
        return cimg;
    }
    template<class T> CImg<T> _testuc(CImg<unsigned char> cimg) {
        //std::cout << "GIPPY CImg input/output test" << std::endl;
        //std::cout << "typeid = " << typeid(T) << std::endl;
        cimg_printinfo(cimg);
        cimg_printstats(cimg);
        cimg_print(cimg);
        return cimg;
    }*/

    //! Create cloudmask using ACCA
    GeoImage ACCA(const GeoImage&, std::string, float, float, int = 5, int = 10, int = 4000, dictionary=dictionary());

    //! Stretch image into byte
    std::string BrowseImage(const GeoImage&, int quality=75);

    //! Create single image from multiple input images using vector file footprint
    GeoImage CookieCutter(std::vector<std::string>, std::string, std::string, 
        float=1.0, float=1.0, bool crop=false, dictionary=dictionary());

    //! Create new file with a Fmask cloud mask
    GeoImage Fmask(const GeoImage&, std::string, int=3, int=5, dictionary=dictionary());

    //! Kmeans
    //GeoImage kmeans(const GeoImage&, std::string, int classes=5, int iterations=5, float threshold=1.0);

    //! Create indices in one pass: NDVI, EVI, LSWI, NDSI, BI {product, filename}
    dictionary Indices(const GeoImage&, dictionary, dictionary=dictionary());

    //! Create output based on linear combinations of input
    GeoImage LinearTransform(const GeoImage&, std::string filename, CImg<float> coef);

    //! Calculate spectral statistics and output to new image
{'fraction_non_alphanumeric': 0.16395759717314487, 'fraction_numerical': 0.008480565371024734, 'mean_word_length': 3.7175, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6401489', 'n_tokens_mistral': 1740, 'n_tokens_neox': 1635, 'n_words': 554}