]> git.sesse.net Git - nageru-docs/commitdiff
Document the new white balance system in 1.9.2.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 12 Apr 2020 12:51:29 +0000 (14:51 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 12 Apr 2020 12:51:29 +0000 (14:51 +0200)
theme.rst

index dbfdebe8e684ba302f8fe74498b212bf7775ece1..8b3fce337263c70f1d83c1505a8015b2fa00ac5a 100644 (file)
--- a/theme.rst
+++ b/theme.rst
@@ -303,14 +303,36 @@ The theme should return a CSS color (e.g. “#ff0000”, or “cyan”) for each
 channel when asked; it can vary from frame to frame. A typical use is to mark
 the currently playing input as red, or the preview as green.
 
 channel when asked; it can vary from frame to frame. A typical use is to mark
 the currently playing input as red, or the preview as green.
 
-And finally, there are two entry points related to white balance::
+
+.. _white-balance:
+
+White balance
+.............
+
+Finally, there are two entry points related to white balance. The first one
+is::
 
   Nageru.set_supports_wb(2, true)
 
   Nageru.set_supports_wb(2, true)
-  function set_wb(channel, red, green, blue)
 
 If the first function is called with a true value (at the start of the theme),
 the channel will get a “Set WB” button next to it, which will activate a color
 
 If the first function is called with a true value (at the start of the theme),
 the channel will get a “Set WB” button next to it, which will activate a color
-picker. When the user picks a color (ostensibly with a gray point), the second
+picker, to select the gray point. To actually *apply* this white balance change,
+you have two options. If you're using Nageru 1.9.2 or newer, it's as simple
+as adding one element to the scene::
+
+  scene:add_white_balance()
+
+The white balance effect will automatically figure out which input it is
+connected to, and fetch its gray point if needed. (If it is connected to
+e.g. a mix of several inputs, such as a camera and an overlay, you will need to
+give the input to fetch white balance from as as a parameter.)
+
+If, on the other hand, you are using Nageru 1.9.1 or older (or just wish
+for more manual control), there's an entry point you will need to implement::
+
+  function set_wb(channel, red, green, blue)
+
+When the user picks a gray point, this function
 function will be called (with the RGB values in linear light—not sRGB!),
 and the theme can then use it to adjust the white balance for that channel.
 The typical way to to this is to have a *WhiteBalanceEffect* on each input
 function will be called (with the RGB values in linear light—not sRGB!),
 and the theme can then use it to adjust the white balance for that channel.
 The typical way to to this is to have a *WhiteBalanceEffect* on each input