aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libred.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/libred.h b/src/libred.h
index 81066a3..3cc2c86 100644
--- a/src/libred.h
+++ b/src/libred.h
@@ -50,6 +50,26 @@
*/
#define LIBRED_SOLAR_ELEVATION_AMATEUR_ASTRONOMICAL_DUSK_DAWN (-15.0)
+/**
+ * The Sun's lowest elevation during the golden hour, measured in degrees.
+ */
+#define LIBRED_SOLAR_ELEVATION_GOLDEN_HOUR_LOW (-4.0)
+
+/**
+ * The Sun's highest elevation during the golden hour, measured in degrees.
+ */
+#define LIBRED_SOLAR_ELEVATION_GOLDEN_HOUR_HIGH (6.0)
+
+/**
+ * The Sun's lowest elevation during the blue hour, measured in degrees.
+ */
+#define LIBRED_SOLAR_ELEVATION_BLUE_HOUR_LOW (-6.0)
+
+/**
+ * The Sun's highest elevation during the blue hour, measured in degrees.
+ */
+#define LIBRED_SOLAR_ELEVATION_BLUE_HOUR_HIGH (-4.0)
+
/**
* Test whether it is twilight.
@@ -107,6 +127,22 @@
*/
#define LIBRED_IS_DAYTIME(ELEV) ((ELEV) > -32.0 / 60.0)
+/**
+ * Test whether it is the golden hour.
+ *
+ * @param ELEV:double The current elevation.
+ * @return 1 if is golden hour, 0 otherwise.
+ */
+#define LIBRED_IS_GOLDEN_HOUR(ELEV) ((-4.0 <= (ELEV)) && ((ELEV) <= 6.0))
+
+/**
+ * Test whether it is the blue hour.
+ *
+ * @param ELEV:double The current elevation.
+ * @return 1 if is blue hour, 0 otherwise.
+ */
+#define LIBRED_IS_BLUE_HOUR(ELEV) ((-6.0 <= (ELEV)) && ((ELEV) <= -4.0))
+
/**
* Calculates the Sun's elevation as apparent