Skip to content

Commit

Permalink
Add color space for Linear Rec2100
Browse files Browse the repository at this point in the history
Closes #443
  • Loading branch information
lloydk committed Aug 26, 2024
1 parent 40e7a05 commit a16165f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/space-coord-accessors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ declare class SpaceAccessors {
prophoto_linear: SpaceAccessor;
rec2020: SpaceAccessor;
rec2020_linear: SpaceAccessor;
rec2100_linear: SpaceAccessor;
rec2100hlg: SpaceAccessor;
rec2100pq: SpaceAccessor;
srgb: SpaceAccessor;
Expand Down
1 change: 1 addition & 0 deletions src/spaces/index-fn-hdr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export {default as Jzazbz} from "./jzazbz.js";
export {default as JzCzHz} from "./jzczhz.js";
export {default as ICTCP} from "./ictcp.js";
export {default as REC_2100_Linear} from "./rec2100-linear.js";
export {default as REC_2100_PQ} from "./rec2100-pq.js";
export {default as REC_2100_HLG} from "./rec2100-hlg.js";
export {default as ACEScg} from "./acescg.js";
Expand Down
4 changes: 2 additions & 2 deletions src/spaces/rec2100-hlg.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import RGBColorSpace from "../RGBColorSpace.js";
import REC2020Linear from "./rec2020-linear.js";
import REC_2100_Linear from "./rec2100-linear.js";
import {spow} from "../util.js";


Expand All @@ -15,7 +15,7 @@ export default new RGBColorSpace({
name: "REC.2100-HLG",
referred: "scene",

base: REC2020Linear,
base: REC_2100_Linear,
toBase (RGB) {
// given HLG encoded component in range [0, 1]
// return media-white relative linear-light
Expand Down
10 changes: 10 additions & 0 deletions src/spaces/rec2100-linear.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import RGBColorSpace from "../RGBColorSpace.js";
import REC_2020_Linear from "./rec2020-linear.js";

export default new RGBColorSpace({
id: "rec2100-linear",
name: "Linear REC.2100",
white: "D65",
toBase: REC_2020_Linear.toBase,
fromBase: REC_2020_Linear.fromBase,
});
4 changes: 2 additions & 2 deletions src/spaces/rec2100-pq.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import RGBColorSpace from "../RGBColorSpace.js";
import REC2020Linear from "./rec2020-linear.js";
import REC_2100_Linear from "./rec2100-linear.js";

const Yw = 203; // absolute luminance of media white, cd/m²
const n = 2610 / (2 ** 14);
Expand All @@ -14,7 +14,7 @@ export default new RGBColorSpace({
id: "rec2100pq",
cssId: "rec2100-pq",
name: "REC.2100-PQ",
base: REC2020Linear,
base: REC_2100_Linear,
toBase (RGB) {
// given PQ encoded component in range [0, 1]
// return media-white relative linear-light
Expand Down

0 comments on commit a16165f

Please sign in to comment.