OSDN Git Service

[Refactor] #40413 Moved notes for gamma from util.c to x11-gamma-builder.c
authorHourier <hourier@users.sourceforge.jp>
Sun, 14 Jun 2020 02:17:06 +0000 (11:17 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 14 Jun 2020 02:17:06 +0000 (11:17 +0900)
src/main/x11-gamma-builder.c
src/util/util.c

index 005efe9..df3e878 100644 (file)
@@ -2,6 +2,49 @@
  * @brief X11環境 (の中でもmaid-x11を必要とする特殊な環境)でガンマ値を調整する
  * @date 2020/05/16
  * @author Hourier
+ * @details
+ * Important note about "colors"
+ *
+ * The "TERM_*" color definitions list the "composition" of each
+ * "Angband color" in terms of "quarters" of each of the three color
+ * components (Red, Green, Blue), for example, TERM_UMBER is defined
+ * as 2/4 Red, 1/4 Green, 0/4 Blue.
+ *
+ * The following info is from "Torbjorn Lindgren" (see "main-xaw.c").
+ *
+ * These values are NOT gamma-corrected.  On most machines (with the
+ * Macintosh being an important exception), you must "gamma-correct"
+ * the given values, that is, "correct for the intrinsic non-linearity
+ * of the phosphor", by converting the given intensity levels based
+ * on the "gamma" of the target screen, which is usually 1.7 (or 1.5).
+ *
+ * The actual formula for conversion is unknown to me at this time,
+ * but you can use the table below for the most common gamma values.
+ *
+ * So, on most machines, simply convert the values based on the "gamma"
+ * of the target screen, which is usually in the range 1.5 to 1.7, and
+ * usually is closest to 1.7.  The converted value for each of the five
+ * different "quarter" values is given below:
+ *
+ *  Given     Gamma 1.0       Gamma 1.5       Gamma 1.7     Hex 1.7
+ *  -----       ----            ----            ----          ---
+ *   0/4        0.00            0.00            0.00          #00
+ *   1/4        0.25            0.27            0.28          #47
+ *   2/4        0.50            0.55            0.56          #8f
+ *   3/4        0.75            0.82            0.84          #d7
+ *   4/4        1.00            1.00            1.00          #ff
+ *
+ * Note that some machines (i.e. most IBM machines) are limited to a
+ * hard-coded set of colors, and so the information above is useless.
+ *
+ * Also, some machines are limited to a pre-determined set of colors,
+ * for example, the IBM can only display 16 colors, and only 14 of
+ * those colors resemble colors used by Angband, and then only when
+ * you ignore the fact that "Slate" and "cyan" are not really matches,
+ * so on the IBM, we use "orange" for both "Umber", and "Light Umber"
+ * in addition to the obvious "Orange", since by combining all of the
+ * "indeterminate" colors into a single color, the rest of the colors
+ * are left with "meaningful" values.
  */
 
 #include "system/angband.h"
index 7584a80..2740528 100644 (file)
@@ -153,52 +153,6 @@ s16b command_wrk;          /* アイテムの使用許可状況 (ex. 装備品のみ、
 TERM_LEN command_gap = 999;         /* アイテムの表示に使う (詳細未調査) */
 s16b command_new;              /* Command chaining from inven/equip view */
 
-/*
- * Important note about "colors"
- *
- * The "TERM_*" color definitions list the "composition" of each
- * "Angband color" in terms of "quarters" of each of the three color
- * components (Red, Green, Blue), for example, TERM_UMBER is defined
- * as 2/4 Red, 1/4 Green, 0/4 Blue.
- *
- * The following info is from "Torbjorn Lindgren" (see "main-xaw.c").
- *
- * These values are NOT gamma-corrected.  On most machines (with the
- * Macintosh being an important exception), you must "gamma-correct"
- * the given values, that is, "correct for the intrinsic non-linearity
- * of the phosphor", by converting the given intensity levels based
- * on the "gamma" of the target screen, which is usually 1.7 (or 1.5).
- *
- * The actual formula for conversion is unknown to me at this time,
- * but you can use the table below for the most common gamma values.
- *
- * So, on most machines, simply convert the values based on the "gamma"
- * of the target screen, which is usually in the range 1.5 to 1.7, and
- * usually is closest to 1.7.  The converted value for each of the five
- * different "quarter" values is given below:
- *
- *  Given     Gamma 1.0       Gamma 1.5       Gamma 1.7     Hex 1.7
- *  -----       ----            ----            ----          ---
- *   0/4        0.00            0.00            0.00          #00
- *   1/4        0.25            0.27            0.28          #47
- *   2/4        0.50            0.55            0.56          #8f
- *   3/4        0.75            0.82            0.84          #d7
- *   4/4        1.00            1.00            1.00          #ff
- *
- * Note that some machines (i.e. most IBM machines) are limited to a
- * hard-coded set of colors, and so the information above is useless.
- *
- * Also, some machines are limited to a pre-determined set of colors,
- * for example, the IBM can only display 16 colors, and only 14 of
- * those colors resemble colors used by Angband, and then only when
- * you ignore the fact that "Slate" and "cyan" are not really matches,
- * so on the IBM, we use "orange" for both "Umber", and "Light Umber"
- * in addition to the obvious "Orange", since by combining all of the
- * "indeterminate" colors into a single color, the rest of the colors
- * are left with "meaningful" values.
- */
-
-
  /*
   * Move the cursor
   */