interleave_channelsinterleave_channelsInterleaveChannelsInterleaveChannelsinterleave_channels(算子)
名称
interleave_channelsinterleave_channelsInterleaveChannelsInterleaveChannelsinterleave_channels — 从多通道图像创建交错图像。
签名
void InterleaveChannels(const HObject& MultichannelImage, HObject* InterleavedImage, const HTuple& PixelFormat, const HTuple& RowBytes, const HTuple& Alpha)
HImage HImage::InterleaveChannels(const HString& PixelFormat, const HTuple& RowBytes, Hlong Alpha) const
HImage HImage::InterleaveChannels(const HString& PixelFormat, const HString& RowBytes, Hlong Alpha) const
HImage HImage::InterleaveChannels(const char* PixelFormat, const char* RowBytes, Hlong Alpha) const
HImage HImage::InterleaveChannels(const wchar_t* PixelFormat, const wchar_t* RowBytes, Hlong Alpha) const
(
Windows only)
描述
算子 interleave_channelsinterleave_channelsInterleaveChannelsInterleaveChannelsInterleaveChannelsinterleave_channels creates an InterleavedImageInterleavedImageInterleavedImageInterleavedImageinterleavedImageinterleaved_image
from the input MultichannelImageMultichannelImageMultichannelImageMultichannelImagemultichannelImagemultichannel_image containing three or four
channels. This is useful to prepare a color image for visualization, e.g., by
converting it to a .NET Bitmap.
Pixel format
The format of the pixels in InterleavedImageInterleavedImageInterleavedImageInterleavedImageinterleavedImageinterleaved_image is specified with
PixelFormatPixelFormatPixelFormatPixelFormatpixelFormatpixel_format. Possible formats are 'rgb'"rgb""rgb""rgb""rgb""rgb", 'rgba'"rgba""rgba""rgba""rgba""rgba",
'argb'"argb""argb""argb""argb""argb", 'bgr'"bgr""bgr""bgr""bgr""bgr", 'bgra'"bgra""bgra""bgra""bgra""bgra", and 'abgr'"abgr""abgr""abgr""abgr""abgr" for BYTE images and
'rgb48'"rgb48""rgb48""rgb48""rgb48""rgb48", 'bgr48'"bgr48""bgr48""bgr48""bgr48""bgr48", 'rgba64'"rgba64""rgba64""rgba64""rgba64""rgba64", 'bgra64'"bgra64""bgra64""bgra64""bgra64""bgra64", 'argb64'"argb64""argb64""argb64""argb64""argb64" 和
'abgr64'"abgr64""abgr64""abgr64""abgr64""abgr64" for UINT2 images, where 'a' denotes the 4th ('alpha') channel.
Be aware that, in contrast to gen_image_interleavedgen_image_interleavedGenImageInterleavedGenImageInterleavedGenImageInterleavedgen_image_interleaved, LittleEndian
byte ordering is used in PixelFormatPixelFormatPixelFormatPixelFormatpixelFormatpixel_format。
Alpha channel
The alpha channel can be defined in the following ways:
Row alignment
The number of bytes between the beginning of two rows in the output
image can be set in RowBytesRowBytesRowBytesRowBytesrowBytesrow_bytes, e.g., to fulfill specific
alignment criteria.
Set RowBytesRowBytesRowBytesRowBytesrowBytesrow_bytes to 'match'"match""match""match""match""match" if no additional padding is
required. RowBytesRowBytesRowBytesRowBytesrowBytesrow_bytes must be at least the number of bytes in
PixelFormatPixelFormatPixelFormatPixelFormatpixelFormatpixel_format times the width of MultichannelImageMultichannelImageMultichannelImageMultichannelImagemultichannelImagemultichannel_image。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 在内部数据级别上自动并行化。
参数
MultichannelImageMultichannelImageMultichannelImageMultichannelImagemultichannelImagemultichannel_image (输入对象) multichannel-image → objectHImageHObjectHImageHobject (byte)
Input multichannel image.
InterleavedImageInterleavedImageInterleavedImageInterleavedImageinterleavedImageinterleaved_image (输出对象) singlechannelimage → objectHImageHObjectHImageHobject * (byte)
Output interleaved image.
PixelFormatPixelFormatPixelFormatPixelFormatpixelFormatpixel_format (输入控制) string → HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Target format for InterleavedImage.
默认值:
'rgba'
"rgba"
"rgba"
"rgba"
"rgba"
"rgba"
值列表:
'abgr'"abgr""abgr""abgr""abgr""abgr", 'abgr64'"abgr64""abgr64""abgr64""abgr64""abgr64", 'argb'"argb""argb""argb""argb""argb", 'argb64'"argb64""argb64""argb64""argb64""argb64", 'bgr'"bgr""bgr""bgr""bgr""bgr", 'bgr48'"bgr48""bgr48""bgr48""bgr48""bgr48", 'bgra'"bgra""bgra""bgra""bgra""bgra", 'bgra64'"bgra64""bgra64""bgra64""bgra64""bgra64", 'rgb'"rgb""rgb""rgb""rgb""rgb", 'rgb48'"rgb48""rgb48""rgb48""rgb48""rgb48", 'rgba'"rgba""rgba""rgba""rgba""rgba", 'rgba64'"rgba64""rgba64""rgba64""rgba64""rgba64"
RowBytesRowBytesRowBytesRowBytesrowBytesrow_bytes (输入控制) integer → HTupleUnion[str, int]HTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)
Number of bytes in a row of the output image.
默认值:
'match'
"match"
"match"
"match"
"match"
"match"
建议值:
'match'"match""match""match""match""match"
AlphaAlphaAlphaAlphaalphaalpha (输入控制) integer → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Alpha value for three channel input images.
默认值:
255
建议值:
255, 0
Example (C#)
HTuple type, width, height;
HImage patras = new HImage("patras");
HImage interleaved = patras.InterleaveChannels("argb", "match", 255);
IntPtr ptr = interleaved.GetImagePointer1(out type, out width, out height);
Image img = new Bitmap(width/4, height, width,
PixelFormat.Format32bppArgb, ptr);
pictureBox.Image = img;
另见
gen_image_interleavedgen_image_interleavedGenImageInterleavedGenImageInterleavedGenImageInterleavedgen_image_interleaved
模块
基础