HDR: Update gamma comments to linear.

Comment-only change.

PiperOrigin-RevId: 476873286
This commit is contained in:
huangdarwin 2022-09-26 13:00:17 +00:00 committed by Marc Baechinger
parent 74124f48ea
commit 16dca1828c
10 changed files with 15 additions and 16 deletions

View File

@ -67,7 +67,7 @@ import java.util.Locale;
* *
* @param context The {@link Context}. * @param context The {@link Context}.
* @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be * @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be
* in linear RGB BT.2020. If {@code false}, colors will be in gamma RGB BT.709. * in linear RGB BT.2020. If {@code false}, colors will be in linear RGB BT.709.
* @throws FrameProcessingException If a problem occurs while reading shader files. * @throws FrameProcessingException If a problem occurs while reading shader files.
*/ */
public BitmapOverlayProcessor(Context context, boolean useHdr) throws FrameProcessingException { public BitmapOverlayProcessor(Context context, boolean useHdr) throws FrameProcessingException {

View File

@ -53,7 +53,7 @@ import java.io.IOException;
* *
* @param context The {@link Context}. * @param context The {@link Context}.
* @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be * @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be
* in linear RGB BT.2020. If {@code false}, colors will be in gamma RGB BT.709. * in linear RGB BT.2020. If {@code false}, colors will be in linear RGB BT.709.
* @param centerX The x-coordinate of the center of the effect. * @param centerX The x-coordinate of the center of the effect.
* @param centerY The y-coordinate of the center of the effect. * @param centerY The y-coordinate of the center of the effect.
* @param minInnerRadius The lower bound of the radius that is unaffected by the effect. * @param minInnerRadius The lower bound of the radius that is unaffected by the effect.

View File

@ -85,7 +85,7 @@ import java.util.concurrent.Future;
* *
* @param context The {@link Context}. * @param context The {@link Context}.
* @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be * @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be
* in linear RGB BT.2020. If {@code false}, colors will be in gamma RGB BT.709. * in linear RGB BT.2020. If {@code false}, colors will be in linear RGB BT.709.
* @param graphName Name of a MediaPipe graph asset to load. * @param graphName Name of a MediaPipe graph asset to load.
* @param isSingleFrameGraph Whether the MediaPipe graph will eventually produce one output frame * @param isSingleFrameGraph Whether the MediaPipe graph will eventually produce one output frame
* each time an input frame (and no other input) has been queued. * each time an input frame (and no other input) has been queued.

View File

@ -41,7 +41,7 @@ import java.io.IOException;
* @param context The {@link Context}. * @param context The {@link Context}.
* @param colorLut The {@link ColorLut} to apply to each frame in order. * @param colorLut The {@link ColorLut} to apply to each frame in order.
* @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be * @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be
* in linear RGB BT.2020. If {@code false}, colors will be in gamma RGB BT.709. * in linear RGB BT.2020. If {@code false}, colors will be in linear RGB BT.709.
* @throws FrameProcessingException If a problem occurs while reading shader files. * @throws FrameProcessingException If a problem occurs while reading shader files.
*/ */
public ColorLutProcessor(Context context, ColorLut colorLut, boolean useHdr) public ColorLutProcessor(Context context, ColorLut colorLut, boolean useHdr)

View File

@ -38,7 +38,7 @@ import java.io.IOException;
* @param context The {@link Context}. * @param context The {@link Context}.
* @param contrastEffect The {@link Contrast} to apply to each frame in order. * @param contrastEffect The {@link Contrast} to apply to each frame in order.
* @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be * @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be
* in linear RGB BT.2020. If {@code false}, colors will be in gamma RGB BT.709. * in linear RGB BT.2020. If {@code false}, colors will be in linear RGB BT.709.
* @throws FrameProcessingException If a problem occurs while reading shader files. * @throws FrameProcessingException If a problem occurs while reading shader files.
*/ */
public ContrastProcessor(Context context, Contrast contrastEffect, boolean useHdr) public ContrastProcessor(Context context, Contrast contrastEffect, boolean useHdr)

View File

@ -35,7 +35,7 @@ public interface GlEffect extends Effect {
* *
* @param context A {@link Context}. * @param context A {@link Context}.
* @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be * @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be
* in linear RGB BT.2020. If {@code false}, colors will be in gamma RGB BT.709. * in linear RGB BT.2020. If {@code false}, colors will be in linear RGB BT.709.
*/ */
GlTextureProcessor toGlTextureProcessor(Context context, boolean useHdr) GlTextureProcessor toGlTextureProcessor(Context context, boolean useHdr)
throws FrameProcessingException; throws FrameProcessingException;

View File

@ -40,7 +40,7 @@ import java.io.IOException;
* @param context The {@link Context}. * @param context The {@link Context}.
* @param hslAdjustment The {@link HslAdjustment} to apply to each frame in order. * @param hslAdjustment The {@link HslAdjustment} to apply to each frame in order.
* @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be * @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be
* in linear RGB BT.2020. If {@code false}, colors will be in gamma RGB BT.709. * in linear RGB BT.2020. If {@code false}, colors will be in linear RGB BT.709.
* @throws FrameProcessingException If a problem occurs while reading shader files. * @throws FrameProcessingException If a problem occurs while reading shader files.
*/ */
public HslProcessor(Context context, HslAdjustment hslAdjustment, boolean useHdr) public HslProcessor(Context context, HslAdjustment hslAdjustment, boolean useHdr)

View File

@ -50,7 +50,6 @@ import java.util.List;
* *
* <p>Can copy frames from an external texture and apply color transformations for HDR if needed. * <p>Can copy frames from an external texture and apply color transformations for HDR if needed.
*/ */
// TODO(b/241902517): Fix Gamma references since intermediate color space is now linear.
@UnstableApi @UnstableApi
@SuppressWarnings("FunctionalInterfaceClash") // b/228192298 @SuppressWarnings("FunctionalInterfaceClash") // b/228192298
/* package */ final class MatrixTextureProcessor extends SingleFrameGlTextureProcessor /* package */ final class MatrixTextureProcessor extends SingleFrameGlTextureProcessor
@ -132,8 +131,8 @@ import java.util.List;
/** /**
* Creates a new instance. * Creates a new instance.
* *
* <p>Input and output are both intermediate optical colors, which are linear RGB BT.2020 if * <p>Input and output are both intermediate optical/linear colors, and RGB BT.2020 if {@code
* {@code useHdr} is {@code true} and gamma RGB BT.709 if not. * useHdr} is {@code true} and RGB BT.709 if not.
* *
* @param context The {@link Context}. * @param context The {@link Context}.
* @param matrixTransformations The {@link GlMatrixTransformation GlMatrixTransformations} to * @param matrixTransformations The {@link GlMatrixTransformation GlMatrixTransformations} to
@ -174,8 +173,8 @@ import java.util.List;
* intermediate optical {@link GlTextureProcessor} color output, before {@code * intermediate optical {@link GlTextureProcessor} color output, before {@code
* matrixTransformations} and {@code rgbMatrices} are applied. * matrixTransformations} and {@code rgbMatrices} are applied.
* *
* <p>Intermediate optical colors are linear RGB BT.2020 if {@code electricalColorInfo} is * <p>Intermediate optical/linear colors are RGB BT.2020 if {@code electricalColorInfo} is
* {@linkplain ColorInfo#isTransferHdr(ColorInfo) HDR}, and gamma RGB BT.709 if not. * {@linkplain ColorInfo#isTransferHdr(ColorInfo) HDR}, and RGB BT.709 if not.
* *
* @param context The {@link Context}. * @param context The {@link Context}.
* @param matrixTransformations The {@link GlMatrixTransformation GlMatrixTransformations} to * @param matrixTransformations The {@link GlMatrixTransformation GlMatrixTransformations} to
@ -235,8 +234,8 @@ import java.util.List;
* GlTextureProcessor} color input, to electrical color output, after {@code * GlTextureProcessor} color input, to electrical color output, after {@code
* matrixTransformations} and {@code rgbMatrices} are applied. * matrixTransformations} and {@code rgbMatrices} are applied.
* *
* <p>Intermediate optical colors are linear RGB BT.2020 if {@code electricalColorInfo} is * <p>Intermediate optical/linear colors are RGB BT.2020 if {@code electricalColorInfo} is
* {@linkplain ColorInfo#isTransferHdr(ColorInfo) HDR}, and gamma RGB BT.709 if not. * {@linkplain ColorInfo#isTransferHdr(ColorInfo) HDR}, and RGB BT.709 if not.
* *
* @param context The {@link Context}. * @param context The {@link Context}.
* @param matrixTransformations The {@link GlMatrixTransformation GlMatrixTransformations} to * @param matrixTransformations The {@link GlMatrixTransformation GlMatrixTransformations} to

View File

@ -33,7 +33,7 @@ public interface RgbMatrix extends GlEffect {
* *
* @param presentationTimeUs The timestamp of the frame to apply the matrix on. * @param presentationTimeUs The timestamp of the frame to apply the matrix on.
* @param useHdr If {@code true}, colors will be in linear RGB BT.2020. If {@code false}, colors * @param useHdr If {@code true}, colors will be in linear RGB BT.2020. If {@code false}, colors
* will be in gamma RGB BT.709. Must be consistent with {@code useHdr} in {@link * will be in linear RGB BT.709. Must be consistent with {@code useHdr} in {@link
* #toGlTextureProcessor(Context, boolean)}. * #toGlTextureProcessor(Context, boolean)}.
* @return The {@code RgbMatrix} to apply to the frame. * @return The {@code RgbMatrix} to apply to the frame.
*/ */

View File

@ -52,7 +52,7 @@ public abstract class SingleFrameGlTextureProcessor implements GlTextureProcesso
* Creates a {@code SingleFrameGlTextureProcessor} instance. * Creates a {@code SingleFrameGlTextureProcessor} instance.
* *
* @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be * @param useHdr Whether input textures come from an HDR source. If {@code true}, colors will be
* in linear RGB BT.2020. If {@code false}, colors will be in gamma RGB BT.709. * in linear RGB BT.2020. If {@code false}, colors will be in linear RGB BT.709.
*/ */
public SingleFrameGlTextureProcessor(boolean useHdr) { public SingleFrameGlTextureProcessor(boolean useHdr) {
this.useHdr = useHdr; this.useHdr = useHdr;