/*
 * Copyright (C) 2020-2021 Aloysius Indrayanto
 *
 * This file is part of the eCxx library, see LICENSE file for the license details.
 */


#ifndef ECXX_CTL_GFX_FIRE_2D_CONFIG_H
#define ECXX_CTL_GFX_FIRE_2D_CONFIG_H


namespace eCxx {


//
// A class to hold Animation2DProc_Fire<T> configuration specifiers
//
// NOTE : When using the built-in fire LUTs, color correction (via CIE-1931 lightness) will
//        need to be manually applied using the ColorFX2D<T> class' functionality to make the
//        result visually better.
//
class Fire2DConfig : public Uninstantiable {
    private:
        static const uint8_t PROGMEM     _redRGBFireLUT_16      [16 * 3];
        static const uint8_t PROGMEM_FAR _redRGBFireLUT_16_far  [16 * 3];
        static const uint8_t PROGMEM     _greenRGBFireLUT_16    [16 * 3];
        static const uint8_t PROGMEM_FAR _greenRGBFireLUT_16_far[16 * 3];
        static const uint8_t PROGMEM     _blueRGBFireLUT_16     [16 * 3];
        static const uint8_t PROGMEM_FAR _blueRGBFireLUT_16_far [16 * 3];

        static const uint8_t PROGMEM     _redRGBFireLUT_8       [ 8 * 3];
        static const uint8_t PROGMEM_FAR _redRGBFireLUT_8_far   [ 8 * 3];
        static const uint8_t PROGMEM     _greenRGBFireLUT_8     [ 8 * 3];
        static const uint8_t PROGMEM_FAR _greenRGBFireLUT_8_far [ 8 * 3];
        static const uint8_t PROGMEM     _blueRGBFireLUT_8      [ 8 * 3];
        static const uint8_t PROGMEM_FAR _blueRGBFireLUT_8_far  [ 8 * 3];

        static const uint8_t PROGMEM     _redRGBFireLUT_4       [ 4 * 3];
        static const uint8_t PROGMEM_FAR _redRGBFireLUT_4_far   [ 4 * 3];
        static const uint8_t PROGMEM     _greenRGBFireLUT_4     [ 4 * 3];
        static const uint8_t PROGMEM_FAR _greenRGBFireLUT_4_far [ 4 * 3];
        static const uint8_t PROGMEM     _blueRGBFireLUT_4      [ 4 * 3];
        static const uint8_t PROGMEM_FAR _blueRGBFireLUT_4_far  [ 4 * 3];

    public:
        //
        // Flow mode
        //
        enum class Flow : uint8_t {
            BottomToTop,
            TopToBottom,
            LeftToRight,
            RightToLeft
        };

        //
        // Distribution mode
        //
        enum class Dist : uint8_t {
            Uniform,
            TowardsMiddle,
            TowardsEdge,
            TowardsFront,
            TowardsBack
        };

        //
        // Built-in fire LUTs for 2D fire animation with maximum power of 16
        //
        static inline PGMCharPointer    redRGBFireLUT_16      () { return eCxx::PGM_PTR    (_redRGBFireLUT_16      ); }
        static inline PGMCharPointerFar redRGBFireLUT_16_far  () { return eCxx::PGM_PTR_FAR(_redRGBFireLUT_16_far  ); }

        static inline PGMCharPointer    greenRGBFireLUT_16    () { return eCxx::PGM_PTR    (_greenRGBFireLUT_16    ); }
        static inline PGMCharPointerFar greenRGBFireLUT_16_far() { return eCxx::PGM_PTR_FAR(_greenRGBFireLUT_16_far); }

        static inline PGMCharPointer    blueRGBFireLUT_16     () { return eCxx::PGM_PTR    (_blueRGBFireLUT_16     ); }
        static inline PGMCharPointerFar blueRGBFireLUT_16_far () { return eCxx::PGM_PTR_FAR(_blueRGBFireLUT_16_far ); }

        static inline PGMCharPointer    stdRGBFireLUT_16      () { return redRGBFireLUT_16    (); }
        static inline PGMCharPointerFar stdRGBFireLUT_16_far  () { return redRGBFireLUT_16_far(); }

        //
        // Built-in fire LUTs for 2D fire animation with maximum power of 8
        //
        static inline PGMCharPointer    redRGBFireLUT_8      () { return eCxx::PGM_PTR    (_redRGBFireLUT_8      ); }
        static inline PGMCharPointerFar redRGBFireLUT_8_far  () { return eCxx::PGM_PTR_FAR(_redRGBFireLUT_8_far  ); }

        static inline PGMCharPointer    greenRGBFireLUT_8    () { return eCxx::PGM_PTR    (_greenRGBFireLUT_8    ); }
        static inline PGMCharPointerFar greenRGBFireLUT_8_far() { return eCxx::PGM_PTR_FAR(_greenRGBFireLUT_8_far); }

        static inline PGMCharPointer    blueRGBFireLUT_8     () { return eCxx::PGM_PTR    (_blueRGBFireLUT_8     ); }
        static inline PGMCharPointerFar blueRGBFireLUT_8_far () { return eCxx::PGM_PTR_FAR(_blueRGBFireLUT_8_far ); }

        static inline PGMCharPointer    stdRGBFireLUT_8      () { return redRGBFireLUT_8    (); }
        static inline PGMCharPointerFar stdRGBFireLUT_8_far  () { return redRGBFireLUT_8_far(); }

        //
        // Built-in fire LUTs for 2D fire animation with maximum power of 4
        //
        static inline PGMCharPointer    redRGBFireLUT_4      () { return eCxx::PGM_PTR    (_redRGBFireLUT_4      ); }
        static inline PGMCharPointerFar redRGBFireLUT_4_far  () { return eCxx::PGM_PTR_FAR(_redRGBFireLUT_4_far  ); }

        static inline PGMCharPointer    greenRGBFireLUT_4    () { return eCxx::PGM_PTR    (_greenRGBFireLUT_4    ); }
        static inline PGMCharPointerFar greenRGBFireLUT_4_far() { return eCxx::PGM_PTR_FAR(_greenRGBFireLUT_4_far); }

        static inline PGMCharPointer    blueRGBFireLUT_4     () { return eCxx::PGM_PTR    (_blueRGBFireLUT_4     ); }
        static inline PGMCharPointerFar blueRGBFireLUT_4_far () { return eCxx::PGM_PTR_FAR(_blueRGBFireLUT_4_far ); }

        static inline PGMCharPointer    stdRGBFireLUT_4      () { return redRGBFireLUT_4    (); }
        static inline PGMCharPointerFar stdRGBFireLUT_4_far  () { return redRGBFireLUT_4_far(); }
};


} // namespace eCxx


#endif
