<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="jit.lumakey" module="jit" category="Jitter Compositing">
	<digest>
		Key based on distance from a luminance value
	</digest>
	<description>
		The <o>jit.lumakey</o> object measures the chromatic distance of each of the left input's cells (pixels) with a reference luminance calulated by the formula lum = (ascale * alpha_value) + (rscale * r_value) + (gscale * g_value) + (bscale * b_value).
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Jitter
		</metadata>
		<metadata name="tag">
			Jitter Compositing
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="matrix">
			<digest>
				in
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="matrix">
			<digest>
				in2
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="matrix">
			<digest>
				out
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="matrix">
			<digest>
				dumpout
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--MOP-->
	<mop matrixinputcount="2" matrixoutputcount="1">
		<matrixinput name="in2" planelink="1" typelink="1" dimlink="1" minplanecount="4" maxplanecount="4" mindimcount="1" maxdimcount="32" ioproc="resamp">
			<types>
				char long float32 float64
			</types>
		</matrixinput>
		<matrixoutput name="out" planelink="1" typelink="1" dimlink="1" minplanecount="4" maxplanecount="4" mindimcount="1" maxdimcount="32">
			<types>
				char long float32 float64
			</types>
		</matrixoutput>
	</mop>
	<!--MESSAGES-->
	<jittermethodlist>
		<jittermethod name="bang" />
		<jittermethod name="clear" />
		<jittermethod name="exportattrs" />
		<jittermethod name="exportsummary" />
		<jittermethod name="getattributes" />
		<jittermethod name="getstate" />
		<jittermethod name="jit_matrix" />
		<jittermethod name="importattrs" />
		<jittermethod name="outputmatrix" />
		<jittermethod name="summary" />
	</jittermethodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="ascale" get="1" set="1" type="float" size="1">
			<digest>
				Alpha scaling factor
			</digest>
			<description>
				The alpha scaling factor (default = 0.)
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Alpha Scale" />
			</attributelist>
		</attribute>
		<attribute name="bscale" get="1" set="1" type="float" size="1">
			<digest>
				Blue scaling factor
			</digest>
			<description>
				The blue scaling factor (default = 0.114)
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Blue Scale" />
			</attributelist>
		</attribute>
		<attribute name="fade" get="1" set="1" type="float" size="1">
			<digest>
				Amount of fade
			</digest>
			<description>
				Amount of fade (default = 0.)
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="atom" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Fade" />
			</attributelist>
		</attribute>
		<attribute name="gscale" get="1" set="1" type="float" size="1">
			<digest>
				Green scaling factor (default = 0.587)
			</digest>
			<description>
				The green scaling factor (default = 0.587)
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Green Scale" />
			</attributelist>
		</attribute>
		<attribute name="lum" get="1" set="1" type="float" size="1">
			<digest>
				Reference luminance (default = all 0.)
			</digest>
			<description>
				The reference luminance (default = all 0.)
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="atom" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
			</attributelist>
		</attribute>
		<attribute name="maxkey" get="1" set="1" type="float" size="1">
			<digest>
				Maximum keying value
			</digest>
			<description>
				The maximum keying (<m>maxkey</m>) value (default = 1.)
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Maximum Key Value" />
			</attributelist>
		</attribute>
		<attribute name="minkey" get="1" set="1" type="float" size="1">
			<digest>
				Minimum keying value
			</digest>
			<description>
				The minimum keying (<m>minkey</m>) value (default = 0.)
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Minimum Key Value" />
			</attributelist>
		</attribute>
		<attribute name="mode" get="1" set="1" type="int" size="1">
			<digest>
				Output mode
			</digest>
			<description>
				Output mode (default = 0 (output keyed matrix))
				<br />
				0 = perform keying and output matrix
				<br />
				1 = output the key map for use elsewhere
				<br />
				2 = alpha contains key map, other planes are from left input
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="atom" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="enumvals" get="1" set="1" type="atom" size="3">
					<enumlist>
						<enum name="Composite">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Key Map in All Channels">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
						<enum name="Key Map in Alpha">
							<digest>
								TEXT_HERE
							</digest>
							<description>
								TEXT_HERE
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Keying Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
		<attribute name="rscale" get="1" set="1" type="float" size="1">
			<digest>
				Red scaling factor
			</digest>
			<description>
				The red scaling factor (default = 0.299)
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Red Scale" />
			</attributelist>
		</attribute>
		<attribute name="tol" get="1" set="1" type="float" size="1">
			<digest>
				Tolerated distance
			</digest>
			<description>
				The tolerated distance (<m>tol</m>) -- the range of variance from which an input cell's absolute value can diverge when calculating keying (default = 0.)
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="atom" size="1" value="1" />
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Tolerance" />
			</attributelist>
		</attribute>
	</attributelist>
	<jitterattributelist>
		<jitterattribute name="outputmode" />
		<jitterattribute name="adapt" />
		<jitterattribute name="in2_name" />
		<jitterattribute name="in2_type" />
		<jitterattribute name="in2_dim" />
		<jitterattribute name="in2_planecount" />
		<jitterattribute name="out_name" />
		<jitterattribute name="type" />
		<jitterattribute name="dim" />
		<jitterattribute name="planecount" />
	</jitterattributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="jit.lumakey.png" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="jit.alphablend" />
		<seealso name="jit.chromakey" />
		<seealso name="jit.keyscreen" />
		<seealso name="jit.rgb2luma" />
	</seealsolist>
	<discussion>
		<p>
			If the distance is less than or equal to a tolerated distance (<m>tol</m>) value, the right input cell is multiplied by a maximum keying (<m>maxkey</m>) value.
		</p>
		<p>
			If the distance is greater than the tolerated distance but less than the sum of the tolerated value and a set fade value (<m>fade</m>) an interpolated value between the some value between <m>minkey</m> and <m>maxkey</m> values is applied.
		</p>
		<p>
			For values whose distance is greater than the sum of the tolerated and fade values, the right input cell is multiplied by the <m>minkey</m> value.
		</p>
		<p>
			The left input is always multiplied by the additive inverse of the left input's multiplicand.
		</p>
		<p>
			The <o>jit.lumakey</o> object has two modes of output; the first keys between the two input sources, and the second mode will output the keying values (i.e., the left input multiplicands) rather than applying the keying -- the left input is ignored. This is useful for outputting keying information for use with other Jitter objects. Keying can be inverted by swapping the <m>minkey</m> and <m>maxkey</m> values.
		</p>
	</discussion>
</c74object>
