Skip to content

core.TypeAlias.GainMapMetadata

github-actions[bot] edited this page Apr 2, 2025 · 16 revisions

@monogrid/gainmap-js / core / GainMapMetadata

Type Alias: GainMapMetadata

GainMapMetadata = object

Defined in: src/core/types.ts:10

This is the Metadata stored in an encoded Gainmap which is used to decode it and return an HDR image

Properties

gainMapMax

gainMapMax: [number, number, number]

Defined in: src/core/types.ts:65

This is log2 of max content boost, which is the maximum allowed ratio of the linear luminance for the Target HDR rendition relative to (divided by) that of the SDR image, at a given pixel.


gainMapMin

gainMapMin: [number, number, number]

Defined in: src/core/types.ts:59

This is log2 of min content boost, which is the minimum allowed ratio of the linear luminance for the target HDR rendition relative to (divided by) that of the SDR image, at a given pixel.


gamma

gamma: [number, number, number]

Defined in: src/core/types.ts:22

This is the gamma to apply to the stored map values.

Default Value

[1, 1, 1]

Remarks

  • Typically you can use a gamma of 1.0.

  • You can use a different value if your gain map has a very uneven distribution of log_recovery(x, y) values.

    For example, this might apply if a gain map has a lot of detail just above SDR range (represented as small log_recovery(x, y) values), and a very large map_max_log2 for the top end of the HDR rendition's desired brightness (represented by large log_recovery(x, y) values). In this case, you can use a map_gamma higher than 1.0 so that recovery(x, y) can precisely encode the detail in both the low end and high end of log_recovery(x, y).


hdrCapacityMax

hdrCapacityMax: number

Defined in: src/core/types.ts:43

Stores the value of hdr_capacity_max. This is log2 of the maximum display boost value for which the map is applied completely.

Remarks

  • This value also affects how much to apply the gain map based on the display boost.
  • Must be greater than hdrCapacityMin.
  • Required.

Logarithmic space


hdrCapacityMin

hdrCapacityMin: number

Defined in: src/core/types.ts:32

This is log2 of the minimum display boost value for which the map is applied at all.

Remarks

  • This value also affects how much to apply the gain map based on the display boost.
  • Must be 0.0 or greater.

Logarithmic space


offsetHdr

offsetHdr: [number, number, number]

Defined in: src/core/types.ts:53

This is the offset to apply to the HDR pixel values during gain map generation and application.

Default Value

[1/64, 1/64, 1/64]

offsetSdr

offsetSdr: [number, number, number]

Defined in: src/core/types.ts:48

This is the offset to apply to the SDR pixel values during gain map generation and application

Default Value

[1/64, 1/64, 1/64]
Clone this wiki locally