allc
Version:
A small typescript package for color conversion.
95 lines • 4.47 kB
TypeScript
/**
* Calculates the linear sRGB component from a sRGB component by
* applying the inverse sRGB transfer function.
*
* @param component The input component (r, g, or b), typically in the range [0, 1].
*
* @returns The linear sRGB component, typically in the range [0, 1].
* @see https://en.wikipedia.org/wiki/SRGB#Transfer_function_(%22gamma%22)
*/
export declare const toLinearSRGBComponentFromSRGBComponent: (component: number) => number;
/**
* Calculates the linear Display P3 component from a Display P3 component by
* applying the inverse sRGB transfer function.
* This function is identical to
* {@link toLinearSRGBComponentFromSRGBComponent `toLinearSRGBComponentFromSRGBComponent(...)`}.
*
* @param component The input component (r, g, or b), typically in the range [0, 1].
*
* @returns The linear Display P3 component, typically in the range [0, 1].
* @see https://en.wikipedia.org/wiki/SRGB#Transfer_function_(%22gamma%22)
*/
export declare const toLinearDisplayP3ComponentFromDisplayP3Component: (component: number) => number;
/**
* Calculates the linear Adobe RGB component from an Adobe RGB component by
* applying the inverse Adobe RGB transfer function.
*
* @param component The input component (r, g, or b), typically in the range [0, 1].
*
* @returns The linear Adobe RGB component, typically in the range [0, 1].
* @see https://en.wikipedia.org/wiki/Adobe_RGB_color_space#Reference_viewing_conditions
*/
export declare const toLinearAdobeRGBComponentFromAdobeRGBComponent: (component: number) => number;
/**
* Calculates the linear Rec. 2020 component from a Rec. 2020 component
* by applying the BT.709 component transfer function.
*
* @param component The Rec. 2020 component (r, g, or b), typically in the range [0, 1].
*
* @return The linear Rec. 2020 component, typically in the range [0, 1].
* @see https://en.wikipedia.org/wiki/Rec._2020#Transfer_characteristics
*/
export declare const toLinearRec2020ComponentFromRec2020Component: (component: number) => number;
/**
* Calculates a linear DCI-P3 component from a DCI-P3 component
* by applying inverse gamma correction using a simple 2.6 gamma curve.
*
* @param component The DCI-P3 component (r, g, or b), range [0, 1].
*
* @returns The linear DCI-P3 component, range [0, 1].
* @see https://en.wikipedia.org/wiki/DCI-P3#DCI_P3
*/
export declare const toLinearDCIP3ComponentFromDCIP3Component: (component: number) => number;
/**
* Calculates a linear DCI-P3 "D60 sim" component from a DCI-P3 "D60 sim" component
* by applying inverse gamma correction using a simple 2.6 gamma curve.
* This function is identical to
* {@link toLinearDCIP3ComponentFromDCIP3Component `toLinearDCIP3ComponentFromDCIP3Component(...)`}.
*
* @param component The DCI-P3 "D60 sim" component (r, g, or b), range [0, 1].
*
* @returns The linear DCI-P3 "D60 sim" component, range [0, 1].
* @see https://en.wikipedia.org/wiki/DCI-P3#DCI_P3
*/
export declare const toLinearDCIP3D60ComponentFromDCIP3D60Component: (component: number) => number;
/**
* Calculates a linear ProPhoto RGB component from a ProPhoto RGB Component
* by applying inverse gamma correction.
*
* @param component The ProPhoto RGB component (r, g, or b), range [0, 1].
*
* @returns The linear ProPhoto RGB component, range [0, 1].
* @see https://en.wikipedia.org/wiki/ProPhoto_RGB_color_space#Encoding_function
*/
export declare const toLinearProPhotoRGBComponentFromProPhotoRGBComponent: (component: number) => number;
/**
* Calculates a linear NTSC (1953) component from a NTSC (1953) component
* by applying inverse gamma correction using a gamma of 2.2.
*
* @param component The NTSC (1953) component, range [0, 1].
*
* @returns The linear NTSC (1953) component, range [0, 1].
*/
export declare const toLinearNTSCComponentFromNTSCComponent: (component: number) => number;
/**
* Calculates a linear SMPTE C (1987) component from a SMPTE C (1987) component
* by applying inverse gamma correction using the inverse BT.709 piecewise component transfer function.
* This function is identical to
* {@link toLinearRec2020ComponentFromRec2020Component `toLinearRec2020ComponentFromRec2020Component(...)`}.
*
* @param component The SMPTE C (1987) component (r, g, or b), range [0, 1].
*
* @returns The linear SMPTE C (1987) component, range [0, 1].
*/
export declare const toLinearSMPTECComponentFromSMPTECComponent: (component: number) => number;
//# sourceMappingURL=to-linear.d.ts.map