元编程参考文档

HDR 像素图像

46 个节点

本页内容 46

HDR 像素图像

函数

重载 1/7

签名
HDR 像素图像() -> Hdr Pixel Image
HdrPixelImage HdrPixelImage()

此节点没有文档说明。

返回

HDR 像素图像Hdr Pixel Image

备注

Required for serialization and empty values.

重载 2/7

签名
HDR 像素图像(宽度: 整数, 高度: 整数) -> Hdr Pixel Image
HdrPixelImage HdrPixelImage(int width, int height)

Creates a blank HDR image of the given size, with every pixel transparent black (all channels 0).

参数

名称类型默认值说明
宽度整数—Number of columns, in pixels.
高度整数—Number of rows, in pixels.

返回

HDR 像素图像Hdr Pixel Image

重载 3/7

签名
HDR 像素图像 -> Hdr Pixel Image
    宽度: 整数
    高度: 整数
    值: Hdr Color Element
HdrPixelImage HdrPixelImage(
    int width,
    int height,
    HdrColorElement value)

Creates an HDR image of the given size with every pixel set to one color.

参数

名称类型默认值说明
宽度整数—Number of columns, in pixels.
高度整数—Number of rows, in pixels.
值Hdr Color Element—The color every pixel starts with.

返回

HDR 像素图像Hdr Pixel Image

重载 4/7

签名
HDR 像素图像(像素: Hdr Color Element 数组数组) -> Hdr Pixel Image
HdrPixelImage HdrPixelImage(HdrColorElement[][] pixels)

此节点没有文档说明。

参数

名称类型默认值说明
像素Hdr Color Element 数组数组—Direct reference without copy.

返回

HDR 像素图像Hdr Pixel Image

重载 5/7

签名
HDR 像素图像 -> Hdr Pixel Image
    宽度: 整数
    高度: 整数
    平面值: Hdr Color Element 数组
HdrPixelImage HdrPixelImage(
    int width,
    int height,
    HdrColorElement[] flat)

Creates an HDR image from a single flat run of pixels, read row by row from the top-left corner; the same as HdrPixelImage.FromFlatArray.

参数

名称类型默认值说明
宽度整数—Number of columns, in pixels.
高度整数—Number of rows, in pixels.
平面值Hdr Color Element 数组—Exactly Width × Height pixels; the first Width are the top row.

返回

HDR 像素图像Hdr Pixel Image

备注

The pixels are copied, so later changes to Flat do not affect the image.

重载 6/7

签名
HDR 像素图像 -> Hdr Pixel Image
    图像: Pixel Image
    选项: Pixel To Hdr Image Options
HdrPixelImage HdrPixelImage(
    PixelImage image,
    PixelToHdrImageOptions options)

Converts sRGB bytes into linear floating-point RGB by default.

参数

名称类型默认值说明
图像Pixel Image—
选项Pixel To Hdr Image Options—

返回

HDR 像素图像Hdr Pixel Image

重载 7/7

签名
HDR 像素图像 -> Hdr Pixel Image
    图像: Pixel Image
    RGB 转换器: Func<Vector3, Vector3>
HdrPixelImage HdrPixelImage(
    PixelImage image,
    Func<Vector3, Vector3> rgbConverter)

Converts normalized PixelImage RGB through a caller-provided conversion function.

参数

名称类型默认值说明
图像Pixel Image—
RGB 转换器Func<Vector3, Vector3>—

返回

HDR 像素图像Hdr Pixel Image

备注

The converter completely replaces built-in transfer-function conversion. Alpha is copied separately as a normalized value.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

复制图像

函数

Makes an independent copy of the image, so editing the copy leaves the original untouched.

签名
复制图像(HDR Pixel Image: Hdr Pixel Image) -> Hdr Pixel Image
HdrPixelImage Clone(HdrPixelImage Hdr Pixel Image)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—

返回

结果Hdr Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

列数

函数

Width of the image in pixels, that is, the number of pixels in each row.

签名
列数(HDR Pixel Image: Hdr Pixel Image) -> 整数
int Columns(HdrPixelImage Hdr Pixel Image)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—

返回

结果整数
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

像素

函数

重载 1/2

签名
像素 -> Hdr Color Element
    HDR Pixel Image: Hdr Pixel Image
    索引: 整数
HdrColorElement Item(HdrPixelImage Hdr Pixel Image, int index)

Reads or writes a pixel by its position in row-major order, counting from 0 at the top-left corner along each row in turn, so index y * Columns + x is the pixel at column x of row y.

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
索引整数—The pixel's position, from 0 to HdrPixelImage.Columns × HdrPixelImage.Rows - 1.

返回

结果Hdr Color Element

重载 2/2

签名
像素 -> Hdr Color Element
    HDR Pixel Image: Hdr Pixel Image
    X: 整数
    Y: 整数
HdrColorElement Item(
    HdrPixelImage Hdr Pixel Image,
    int x,
    int y)

Reads or writes the pixel at a column and row, the same as HdrPixelImage.GetHdrColor and HdrPixelImage.SetHdrColor.

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
X整数—Column, counted from 0 at the left edge.
Y整数—Row, counted from 0 at the top edge.

返回

结果Hdr Color Element
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

像素

函数

此节点没有文档说明。

签名
像素(HDR Pixel Image: Hdr Pixel Image) -> Hdr Color Element 数组数组
HdrColorElement[][] Pixels(HdrPixelImage Hdr Pixel Image)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—

返回

结果Hdr Color Element 数组数组

备注

Row-major data in the form Pixels[y][x].

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

原始数据

函数

The whole image as raw bytes, four little-endian 32-bit floats per pixel (red, green, blue, alpha), row by row from the top-left corner; see HdrPixelImage.ToTightlyPackedFloat32LittleEndianBytes.

签名
原始数据(HDR Pixel Image: Hdr Pixel Image) -> 字节数组
byte[] Raw(HdrPixelImage Hdr Pixel Image)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—

返回

结果字节数组

备注

Every read builds a new copy of the pixel data, so read it once and keep the result rather than reading it inside a loop.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

行数

函数

Height of the image in pixels, that is, the number of rows.

签名
行数(HDR Pixel Image: Hdr Pixel Image) -> 整数
int Rows(HdrPixelImage Hdr Pixel Image)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—

返回

结果整数
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

获取颜色

函数

Returns the fixed default tone-mapped preview color.

签名
获取颜色 -> 颜色
    HDR Pixel Image: Hdr Pixel Image
    X: 整数
    Y: 整数
ColorElement GetColor(
    HdrPixelImage Hdr Pixel Image,
    int x,
    int y)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
X整数—
Y整数—

返回

结果颜色
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

获取浮点值

函数

Returns fixed-default tone-mapped linear luminance.

签名
获取浮点值 -> 低精度数字
    HDR Pixel Image: Hdr Pixel Image
    X: 整数
    Y: 整数
float GetFloatValue(HdrPixelImage Hdr Pixel Image, int x, int y)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
X整数—
Y整数—

返回

结果低精度数字
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

获取灰度字节

函数

Returns fixed-default tone-mapped linear luminance as an 8-bit value.

签名
获取灰度字节 -> 字节
    HDR Pixel Image: Hdr Pixel Image
    X: 整数
    Y: 整数
byte GetGrayByte(HdrPixelImage Hdr Pixel Image, int x, int y)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
X整数—
Y整数—

返回

结果字节
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

获取 HDR 颜色

函数

The full-precision HDR color of one pixel, exactly as stored.

签名
获取 HDR 颜色 -> Hdr Color Element
    HDR Pixel Image: Hdr Pixel Image
    X: 整数
    Y: 整数
HdrColorElement GetHdrColor(
    HdrPixelImage Hdr Pixel Image,
    int x,
    int y)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
X整数—Column, counted from 0 at the left edge.
Y整数—Row, counted from 0 at the top edge.

返回

结果Hdr Color Element
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

获取 HDR 亮度

函数

Returns luminance directly from stored RGB values without transfer conversion.

签名
获取 HDR 亮度 -> 低精度数字
    HDR Pixel Image: Hdr Pixel Image
    X: 整数
    Y: 整数
float GetHdrLuminance(
    HdrPixelImage Hdr Pixel Image,
    int x,
    int y)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
X整数—
Y整数—

返回

结果低精度数字
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

获取摘要

函数

A one-line description of the image: its size, the lowest and highest value of each channel, and the range of its Rec. 709 luminance.

签名
获取摘要(HDR Pixel Image: Hdr Pixel Image) -> 文本
string GetSummary(HdrPixelImage Hdr Pixel Image)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—

返回

结果文本

备注

NaN samples are skipped when finding each channel's range and non-finite luminance is skipped for the luminance range, so a channel with nothing else to report shows NaN. An empty image is reported as such.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

直方图

函数

Returns a normalized histogram of stored linear luminance.
Bins span the actual finite luminance range of the image.
The returned values sum to 1 when at least one finite sample exists.

签名
直方图(HDR Pixel Image: Hdr Pixel Image, 柱数: 整数) -> 数字数组
double[] Histogram(HdrPixelImage Hdr Pixel Image, int bars)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
柱数整数—

返回

结果数字数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

是否在显示范围内

函数

Whether every RGB sample, scaled by Exposure Multiplier, already lies
at or below 1.0 — so there is no range for a tone-mapping operator to compress.

签名
是否在显示范围内 -> 真否
    HDR Pixel Image: Hdr Pixel Image
    曝光倍数: 低精度数字
bool IsWithinDisplayRange(
    HdrPixelImage Hdr Pixel Image,
    float exposureMultiplier = 1f)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
曝光倍数低精度数字1The linear exposure factor the conversion will apply.

返回

结果真否

备注

NaN counts as in range because every preview path maps it to zero rather than tone
mapping it; positive infinity counts as out of range because it is the extreme case of
the thing tone mapping exists for. Alpha is not considered: it is never tone mapped.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

最大值

函数

此节点没有文档说明。

签名
最大值(HDR Pixel Image: Hdr Pixel Image, 声道: 整数) -> 数字
double Max(HdrPixelImage Hdr Pixel Image, int channel)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
声道整数—0-3

返回

结果数字
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

最小值

函数

此节点没有文档说明。

签名
最小值(HDR Pixel Image: Hdr Pixel Image, 声道: 整数) -> 数字
double Min(HdrPixelImage Hdr Pixel Image, int channel)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
声道整数—0-3

返回

结果数字
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

保存为 PFM

函数

Writes the image as Portable FloatMap (.pfm).

签名
保存为 PFM
    HDR Pixel Image: Hdr Pixel Image
    路径: 文本
    选项: Portable Float Map Image Writer Options
void SaveAsPortableFloatMap(
    HdrPixelImage Hdr Pixel Image,
    string path,
    PortableFloatMapImageWriterOptions options)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
路径文本—
选项Portable Float Map Image Writer Options—

备注

Unlike Radiance RGBE this keeps full 32-bit float precision per channel and can represent
negative values, at the cost of a much larger file.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

保存为 Radiance HDR

函数

Writes the image as a Radiance RGBE (.hdr) file, the common format for HDR environment maps; alpha is not stored.

签名
保存为 Radiance HDR
    HDR Pixel Image: Hdr Pixel Image
    路径: 文本
    选项: Radiance Hdr Image Writer Options
void SaveAsRadianceHdr(
    HdrPixelImage Hdr Pixel Image,
    string path,
    RadianceHdrImageWriterOptions options)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
路径文本—The file to create or overwrite.
选项Radiance Hdr Image Writer Options—Encoder settings; null uses the defaults.

备注

RGBE shares one exponent between the three channels, so it is compact but less precise than HdrPixelImage.SaveAsPortableFloatMap, and it cannot hold negative values.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

保存为文本

函数

The image as Base64 text, encoding the same bytes as HdrPixelImage.SerializeIntoBytes, for storing an image inside a text document.

签名
保存为文本(HDR Pixel Image: Hdr Pixel Image) -> 文本
string SaveAsText(HdrPixelImage Hdr Pixel Image)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—

返回

结果文本
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

序列化为字节

函数

Serializes the image into Divooka's own binary form, as written by HdrPixelImage.WriteToStream, preserving every float exactly.

签名
序列化为字节(HDR Pixel Image: Hdr Pixel Image) -> 字节数组
byte[] SerializeIntoBytes(HdrPixelImage Hdr Pixel Image)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—

返回

结果字节数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

设置 HDR 颜色

函数

Replaces the HDR color of one pixel, changing the image in place.

签名
设置 HDR 颜色
    HDR Pixel Image: Hdr Pixel Image
    X: 整数
    Y: 整数
    颜色: Hdr Color Element
void SetHdrColor(
    HdrPixelImage Hdr Pixel Image,
    int x,
    int y,
    HdrColorElement color)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
X整数—Column, counted from 0 at the left edge.
Y整数—Row, counted from 0 at the top edge.
颜色Hdr Color Element—The new color, stored exactly as given.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

转为平铺数组

函数

Copies all pixels into a single array, row by row from the top-left corner, so pixel (x, y) is at index y * Columns + x.

签名
转为平铺数组(HDR Pixel Image: Hdr Pixel Image) -> Hdr Color Element 数组
HdrColorElement[] ToFlatArray(HdrPixelImage Hdr Pixel Image)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—

返回

结果Hdr Color Element 数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

转为像素图像

函数

重载 1/3

签名
转为像素图像(HDR Pixel Image: Hdr Pixel Image) -> Pixel Image
PixelImage ToPixelImage(HdrPixelImage Hdr Pixel Image)

Converts the image to an 8-bit sRGB image for display, choosing the exposure automatically from the image's average brightness and compressing highlights with a luminance-based curve that keeps colors from washing out to white.

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—

返回

结果Pixel Image

备注

Exposure places the image's log-average luminance at middle gray (0.18), so a few very bright pixels such as the sun barely affect it. Negative values become 0 and alpha is clamped to 0-1. Use HdrPixelImage.ToPixelImage for a fixed exposure and a chosen tone-mapping operator.

重载 2/3

签名
转为像素图像 -> Pixel Image
    HDR Pixel Image: Hdr Pixel Image
    选项: Hdr To Pixel Image Options
PixelImage ToPixelImage(
    HdrPixelImage Hdr Pixel Image,
    HdrToPixelImageOptions options)

Converts the image to an 8-bit image with explicit control over exposure, tone mapping, transfer functions and alpha.

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
选项Hdr To Pixel Image Options—The conversion settings; null uses HdrToPixelImageOptions.Default (ACES tone mapping, linear to sRGB, no exposure change).

返回

结果Pixel Image

备注

Each pixel goes through: source transfer decode, exposure (in stops), optional clamping of negatives, the tone-mapping operator, clamping to 0-1, destination transfer encode and rounding to a byte. NaN and negative infinity become 0 and positive infinity becomes 1.

重载 3/3

签名
转为像素图像 -> Pixel Image
    HDR Pixel Image: Hdr Pixel Image
    传递函数: Func<Vector3, 颜色>
PixelImage ToPixelImage(
    HdrPixelImage Hdr Pixel Image,
    Func<Vector3, ColorElement> transferFunction)

Converts the image to an 8-bit image using your own conversion for every pixel.

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
传递函数Func<Vector3, 颜色>—Turns one pixel's stored red, green and blue into the 8-bit color to write.

返回

结果Pixel Image

备注

The function receives only red, green and blue (in X, Y and Z, as stored), so the HDR alpha is discarded; the alpha of each returned color is used as is.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

转为 PFM 字节

函数

Encodes the image as a Portable FloatMap (.pfm) file in memory, producing the same bytes HdrPixelImage.SaveAsPortableFloatMap writes to disk.

签名
转为 PFM 字节 -> 字节数组
    HDR Pixel Image: Hdr Pixel Image
    选项: Portable Float Map Image Writer Options
byte[] ToPortableFloatMapBytes(
    HdrPixelImage Hdr Pixel Image,
    PortableFloatMapImageWriterOptions options)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
选项Portable Float Map Image Writer Options—Encoder settings; null uses the defaults.

返回

结果字节数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

转为 Radiance HDR 字节

函数

Encodes the image as a Radiance RGBE (.hdr) file in memory, producing the same bytes HdrPixelImage.SaveAsRadianceHdr writes to disk.

签名
转为 Radiance HDR 字节 -> 字节数组
    HDR Pixel Image: Hdr Pixel Image
    选项: Radiance Hdr Image Writer Options
byte[] ToRadianceHdrBytes(
    HdrPixelImage Hdr Pixel Image,
    RadianceHdrImageWriterOptions options)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
选项Radiance Hdr Image Writer Options—Encoder settings; null uses the defaults.

返回

结果字节数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

转为紧凑小端 32 位浮点字节

函数

The whole image as raw bytes: four little-endian 32-bit floats per pixel (red, green, blue, alpha), row by row from the top-left corner with no header or padding.

签名
转为紧凑小端 32 位浮点字节(HDR Pixel Image: Hdr Pixel Image) -> 字节数组
byte[] ToTightlyPackedFloat32LittleEndianBytes(HdrPixelImage Hdr Pixel Image)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—

返回

结果字节数组

备注

The values are written exactly, NaN and infinity included; HdrPixelImage.FromTightlyPackedFloat32LittleEndianBytes reads them back.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

变换 HDR 数据

函数

重载 1/2

签名
变换 HDR 数据
    HDR Pixel Image: Hdr Pixel Image
    变换函数: Func<Hdr Color Element, Hdr Color Element>
void TransformHdrData(
    HdrPixelImage Hdr Pixel Image,
    Func<HdrColorElement, HdrColorElement> transformer)

Applies an element transform atomically using a deep copy.

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
变换函数Func<Hdr Color Element, Hdr Color Element>—

重载 2/2

签名
变换 HDR 数据
    HDR Pixel Image: Hdr Pixel Image
    变换函数: Func<整数, 整数, Hdr Color Element, Hdr Color Element>
void TransformHdrData(
    HdrPixelImage Hdr Pixel Image,
    Func<int, int, HdrColorElement, HdrColorElement> transformer)

Applies a coordinate-aware element transform atomically using a deep copy.

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
变换函数Func<整数, 整数, Hdr Color Element, Hdr Color Element>—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

更新颜色数据

函数

Performs a deliberately lossy sRGB-preview update and converts the result back into linear HDR data.

签名
更新颜色数据
    HDR Pixel Image: Hdr Pixel Image
    更新函数: Func<颜色数组数组, 颜色数组数组>
void UpdateColorData(
    HdrPixelImage Hdr Pixel Image,
    Func<ColorElement[][], ColorElement[][]> updater)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
更新函数Func<颜色数组数组, 颜色数组数组>—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

更新 HDR 数据

函数

Applies a shape-preserving or shape-changing HDR update from a deep copy.

签名
更新 HDR 数据
    HDR Pixel Image: Hdr Pixel Image
    更新函数: Func<Hdr Color Element 数组数组, Hdr Color Element 数组数组>
void UpdateHdrData(
    HdrPixelImage Hdr Pixel Image,
    Func<HdrColorElement[][], HdrColorElement[][]> updater)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
更新函数Func<Hdr Color Element 数组数组, Hdr Color Element 数组数组>—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

写入 PFM

函数

Encodes the image as a Portable FloatMap (.pfm) file into a stream, starting at its current position; the stream is left open.

签名
写入 PFM
    HDR Pixel Image: Hdr Pixel Image
    流式输出: Stream
    选项: Portable Float Map Image Writer Options
void WritePortableFloatMap(
    HdrPixelImage Hdr Pixel Image,
    Stream stream,
    PortableFloatMapImageWriterOptions options)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
流式输出Stream—A writable stream to receive the file.
选项Portable Float Map Image Writer Options—Encoder settings; null uses the defaults.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

写入 Radiance HDR

函数

Encodes the image as a Radiance RGBE (.hdr) file into a stream, starting at its current position; the stream is left open.

签名
写入 Radiance HDR
    HDR Pixel Image: Hdr Pixel Image
    流式输出: Stream
    选项: Radiance Hdr Image Writer Options
void WriteRadianceHdr(
    HdrPixelImage Hdr Pixel Image,
    Stream stream,
    RadianceHdrImageWriterOptions options)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
流式输出Stream—A writable stream to receive the file.
选项Radiance Hdr Image Writer Options—Encoder settings; null uses the defaults.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

写入紧凑小端 32 位浮点数据

函数

Writes tightly packed little-endian float RGBA data without a header.

签名
写入紧凑小端 32 位浮点数据 -> 大整数
    HDR Pixel Image: Hdr Pixel Image
    流式输出: Stream
long WriteTightlyPackedFloat32LittleEndian(
    HdrPixelImage Hdr Pixel Image,
    Stream stream)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
流式输出Stream—

返回

结果大整数
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

写入流

函数

The binary format uses an eight-byte HDR-specific magic, version, dimensions, Int64 payload length, then row-wise little-endian IEEE-754 RGBA floats.

签名
写入流 -> 大整数
    HDR Pixel Image: Hdr Pixel Image
    写入器: BinaryWriter
long WriteToStream(
    HdrPixelImage Hdr Pixel Image,
    BinaryWriter writer)

参数

名称类型默认值说明
HDR Pixel ImageHdr Pixel Image—
写入器BinaryWriter—

返回

结果大整数
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
HDR 像素图像
所属包
图像处理

分配像素

函数

Allocates a new [row][column] HDR pixel grid of the given size, optionally filled with one color.

签名
分配像素 -> Hdr Color Element 数组数组
    宽度: 整数
    高度: 整数
    值: 可选 Hdr Color Element
HdrColorElement[][] AllocatePixels(
    int width,
    int height,
    HdrColorElement? value)

参数

名称类型默认值说明
宽度整数—Number of pixels in each row.
高度整数—Number of rows.
值可选 Hdr Color Element—The fill color; null leaves every pixel transparent black (all channels 0).

返回

结果Hdr Color Element 数组数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

从平铺数组生成

函数

Creates an HDR image from a single array of pixels laid out row by row from the top-left corner, the inverse of HdrPixelImage.ToFlatArray.

签名
从平铺数组生成 -> Hdr Pixel Image
    宽度: 整数
    高度: 整数
    平面值: Hdr Color Element 数组
HdrPixelImage FromFlatArray(
    int width,
    int height,
    HdrColorElement[] flat)

参数

名称类型默认值说明
宽度整数—Number of columns, in pixels.
高度整数—Number of rows, in pixels.
平面值Hdr Color Element 数组—Exactly Width × Height pixels; the first Width are the top row.

返回

结果Hdr Pixel Image

备注

The pixels are copied, so later changes to Flat do not affect the image.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

从像素图像生成

函数

重载 1/2

签名
从像素图像生成 -> Hdr Pixel Image
    图像: Pixel Image
    选项: Pixel To Hdr Image Options
HdrPixelImage FromPixelImage(
    PixelImage image,
    PixelToHdrImageOptions options)

Converts an 8-bit image to HDR, turning each byte into a 0-1 value and, by default, decoding the sRGB curve so the result is in linear light.

参数

名称类型默认值说明
图像Pixel Image—The 8-bit image to convert.
选项Pixel To Hdr Image Options—The source and destination transfer functions; null uses PixelToHdrImageOptions.Default (sRGB to linear).

返回

结果Hdr Pixel Image

备注

Alpha is copied as a 0-1 value without conversion. The result is a new image; the source is not changed.

重载 2/2

签名
从像素图像生成 -> Hdr Pixel Image
    图像: Pixel Image
    RGB 转换器: Func<Vector3, Vector3>
HdrPixelImage FromPixelImage(
    PixelImage image,
    Func<Vector3, Vector3> rgbConverter)

Converts normalized PixelImage RGB through a caller-provided conversion function.

参数

名称类型默认值说明
图像Pixel Image—
RGB 转换器Func<Vector3, Vector3>—

返回

结果Hdr Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

从紧凑小端 32 位浮点字节生成

函数

Creates an HDR image from raw bytes holding four little-endian 32-bit floats per pixel (red, green, blue, alpha), row by row from the top-left corner with no header or padding.

签名
从紧凑小端 32 位浮点字节生成 -> Hdr Pixel Image
    宽度: 整数
    高度: 整数
    原始字节: 字节数组
HdrPixelImage FromTightlyPackedFloat32LittleEndianBytes(
    int width,
    int height,
    byte[] rawBytes)

参数

名称类型默认值说明
宽度整数—Number of columns, in pixels.
高度整数—Number of rows, in pixels.
原始字节字节数组—Exactly Width × Height × 16 bytes.

返回

结果Hdr Pixel Image

备注

The inverse of HdrPixelImage.ToTightlyPackedFloat32LittleEndianBytes. The values are copied exactly, NaN and infinity included.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

初始化黑色图像

函数

Creates an HDR image of the given size filled with opaque black (red, green and blue 0, alpha 1).

签名
初始化黑色图像(宽度: 整数, 高度: 整数) -> Hdr Pixel Image
HdrPixelImage InitializeBlackImage(int width, int height)

参数

名称类型默认值说明
宽度整数—Number of columns, in pixels.
高度整数—Number of rows, in pixels.

返回

结果Hdr Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

从字节初始化

函数

Rebuilds an image from bytes produced by HdrPixelImage.SerializeIntoBytes.

签名
从字节初始化(数据: 字节数组) -> Hdr Pixel Image
HdrPixelImage InitializeFromBytes(byte[] data)

参数

名称类型默认值说明
数据字节数组—The serialized image, with nothing after it.

返回

结果Hdr Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

初始化图像

函数

Creates an HDR image of the given size with every pixel set to one color.

签名
初始化图像 -> Hdr Pixel Image
    宽度: 整数
    高度: 整数
    值: Hdr Color Element
HdrPixelImage InitializeImage(
    int width,
    int height,
    HdrColorElement value)

参数

名称类型默认值说明
宽度整数—Number of columns, in pixels.
高度整数—Number of rows, in pixels.
值Hdr Color Element—The color every pixel starts with.

返回

结果Hdr Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

从文件加载

函数

重载 1/3

签名
从文件加载(路径: 文本) -> Hdr Pixel Image
HdrPixelImage LoadFromFile(string path)

Loads any format accepted by StbImageSharp's floating-point decoder.

参数

名称类型默认值说明
路径文本—

返回

结果Hdr Pixel Image

备注

Values returned by StbImageSharp are stored without further conversion.
This should support Radiance HDR (.pic, .hdr) file format.

重载 2/3

签名
从文件加载 -> Hdr Pixel Image
    路径: 文本
    源传递函数: Color Transfer Function
    目标传递函数: Color Transfer Function
HdrPixelImage LoadFromFile(
    string path,
    ColorTransferFunction sourceTransfer,
    ColorTransferFunction destinationTransfer)

Loads an image and converts its decoded RGB values between built-in transfer functions.

参数

名称类型默认值说明
路径文本—
源传递函数Color Transfer Function—
目标传递函数Color Transfer Function—

返回

结果Hdr Pixel Image

重载 3/3

签名
从文件加载 -> Hdr Pixel Image
    路径: 文本
    RGB 转换器: Func<Vector3, Vector3>
HdrPixelImage LoadFromFile(
    string path,
    Func<Vector3, Vector3> rgbConverter)

Loads an image and applies a caller-provided conversion to decoded RGB values.

参数

名称类型默认值说明
路径文本—
RGB 转换器Func<Vector3, Vector3>—

返回

结果Hdr Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

从文件缓冲区加载

函数

重载 1/3

签名
从文件缓冲区加载(文件数据: 字节数组) -> Hdr Pixel Image
HdrPixelImage LoadFromFileBuffer(byte[] fileData)

Decodes an image file held in memory into HDR values, in any format StbImageSharp's floating-point decoder accepts, such as Radiance .hdr.

参数

名称类型默认值说明
文件数据字节数组—The complete file contents.

返回

结果Hdr Pixel Image

备注

Values returned by the decoder are stored without further conversion.

重载 2/3

签名
从文件缓冲区加载 -> Hdr Pixel Image
    文件数据: 字节数组
    源传递函数: Color Transfer Function
    目标传递函数: Color Transfer Function
HdrPixelImage LoadFromFileBuffer(
    byte[] fileData,
    ColorTransferFunction sourceTransfer,
    ColorTransferFunction destinationTransfer)

Decodes an image file held in memory into HDR values, then converts the decoded red, green and blue from one transfer function to another.

参数

名称类型默认值说明
文件数据字节数组—The complete file contents.
源传递函数Color Transfer Function—The transfer function the decoded values are in.
目标传递函数Color Transfer Function—The transfer function to store them in.

返回

结果Hdr Pixel Image

备注

Alpha is stored as decoded. When the two transfer functions are the same, the values are left unchanged.

重载 3/3

签名
从文件缓冲区加载 -> Hdr Pixel Image
    文件数据: 字节数组
    RGB 转换器: Func<Vector3, Vector3>
HdrPixelImage LoadFromFileBuffer(
    byte[] fileData,
    Func<Vector3, Vector3> rgbConverter)

Decodes an image file held in memory into HDR values, passing each pixel's decoded red, green and blue through a conversion of your choice.

参数

名称类型默认值说明
文件数据字节数组—The complete file contents.
RGB 转换器Func<Vector3, Vector3>—Receives red, green and blue in X, Y and Z and returns the values to store; null stores them unchanged.

返回

结果Hdr Pixel Image

备注

Alpha is stored as decoded and is not passed to the converter.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

从流加载

函数

重载 1/3

签名
从流加载(流式输出: Stream) -> Hdr Pixel Image
HdrPixelImage LoadFromStream(Stream stream)

Decodes an image from a stream into HDR values, in any format StbImageSharp's floating-point decoder accepts, such as Radiance .hdr.

参数

名称类型默认值说明
流式输出Stream—A readable stream holding the image file.

返回

结果Hdr Pixel Image

备注

Values returned by the decoder are stored without further conversion. The stream is read from its current position and is not closed.

重载 2/3

签名
从流加载 -> Hdr Pixel Image
    流式输出: Stream
    源传递函数: Color Transfer Function
    目标传递函数: Color Transfer Function
HdrPixelImage LoadFromStream(
    Stream stream,
    ColorTransferFunction sourceTransfer,
    ColorTransferFunction destinationTransfer)

Decodes an image from a stream into HDR values, then converts the decoded red, green and blue from one transfer function to another.

参数

名称类型默认值说明
流式输出Stream—A readable stream holding the image file.
源传递函数Color Transfer Function—The transfer function the decoded values are in.
目标传递函数Color Transfer Function—The transfer function to store them in.

返回

结果Hdr Pixel Image

备注

Alpha is stored as decoded. When the two transfer functions are the same, the values are left unchanged. The stream is not closed.

重载 3/3

签名
从流加载 -> Hdr Pixel Image
    流式输出: Stream
    RGB 转换器: Func<Vector3, Vector3>
HdrPixelImage LoadFromStream(
    Stream stream,
    Func<Vector3, Vector3> rgbConverter)

Decodes an image from a stream into HDR values, passing each pixel's decoded red, green and blue through a conversion of your choice.

参数

名称类型默认值说明
流式输出Stream—A readable stream holding the image file.
RGB 转换器Func<Vector3, Vector3>—Receives red, green and blue in X, Y and Z and returns the values to store; null stores them unchanged.

返回

结果Hdr Pixel Image

备注

Alpha is stored as decoded and is not passed to the converter. The stream is read from its current position and is not closed.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

从文本加载

函数

Rebuilds an image from Base64 text produced by HdrPixelImage.SaveAsText.

签名
从文本加载(文本: 文本) -> Hdr Pixel Image
HdrPixelImage LoadFromText(string text)

参数

名称类型默认值说明
文本文本—The Base64 text.

返回

结果Hdr Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理

从流读取

函数

Reads an image written by HdrPixelImage.WriteToStream, leaving the reader just past it.

签名
从流读取(读取器: BinaryReader) -> (结果: 大整数, 值: Hdr Pixel Image)
long ReadFromStream(
    BinaryReader reader,
    out HdrPixelImage value)

参数

名称类型默认值说明
读取器BinaryReader—The reader positioned at the image.

返回

结果大整数
值Hdr Pixel Image
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
HDR 像素图像
所属包
图像处理