C# Класс Axiom.Media.PixelConverter

A class to convert/copy pixels of the same or different formats
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
IndexedPixelFormats Axiom.Media.PixelFormatDescription[]
UnindexedPixelFormats Axiom.Media.PixelFormatDescription[]

Открытые методы

Метод Описание
BulkPixelConversion ( IntPtr srcBytes, int srcOffset, PixelFormat srcFormat, IntPtr dstBytes, int dstOffset, PixelFormat dstFormat, int count ) : void

Convert consecutive pixels from one format to another. No dithering or filtering is being done. Converting from RGB to luminance takes the R channel. In case the source and destination format match, just a copy is done.

BulkPixelConversion ( PixelBox src, PixelBox dst ) : void

Convert pixels from one format to another. No dithering or filtering is being done. Converting from RGB to luminance takes the R channel.

The source and destination boxes must have the same dimensions. In case the source and destination format match, a plain copy is done.

GetDescriptionFor ( PixelFormat format ) : Axiom.Media.PixelFormatDescription
Initialize ( ) : void
PackColor ( ColorEx color, PixelFormat format, IntPtr dest ) : void

Pack a color value to memory

PackColor ( float r, float g, float b, float a, PixelFormat format, IntPtr dest ) : void

Pack a color value to memory

PackColor ( uint r, uint g, uint b, uint a, PixelFormat format, IntPtr dest ) : void

Pack a color value to memory

UnpackColor ( PixelFormat pf, IntPtr src ) : ColorEx

Unpack a color value from memory

UnpackColor ( byte &r, byte &g, byte &b, byte &a, PixelFormat pf, IntPtr src ) : void

Unpack a color value from memory

This function returns the color components in 8 bit precision, this will lose precision when coming from A2R10G10B10 or floating point formats.

UnpackColor ( float &r, float &g, float &b, float &a, PixelFormat pf, IntPtr src ) : void

Unpack a color value from memory

Описание методов

BulkPixelConversion() публичный статический метод

Convert consecutive pixels from one format to another. No dithering or filtering is being done. Converting from RGB to luminance takes the R channel. In case the source and destination format match, just a copy is done.
public static BulkPixelConversion ( IntPtr srcBytes, int srcOffset, PixelFormat srcFormat, IntPtr dstBytes, int dstOffset, PixelFormat dstFormat, int count ) : void
srcBytes System.IntPtr Pointer to source region
srcOffset int
srcFormat PixelFormat Pixel format of source region
dstBytes System.IntPtr Pointer to destination region
dstOffset int
dstFormat PixelFormat Pixel format of destination region
count int
Результат void

BulkPixelConversion() публичный статический метод

Convert pixels from one format to another. No dithering or filtering is being done. Converting from RGB to luminance takes the R channel.
The source and destination boxes must have the same dimensions. In case the source and destination format match, a plain copy is done.
public static BulkPixelConversion ( PixelBox src, PixelBox dst ) : void
src PixelBox PixelBox containing the source pixels, pitches and format
dst PixelBox PixelBox containing the destination pixels, pitches and format
Результат void

GetDescriptionFor() публичный статический метод

public static GetDescriptionFor ( PixelFormat format ) : Axiom.Media.PixelFormatDescription
format PixelFormat
Результат Axiom.Media.PixelFormatDescription

Initialize() публичный статический метод

public static Initialize ( ) : void
Результат void

PackColor() публичный статический метод

Pack a color value to memory
public static PackColor ( ColorEx color, PixelFormat format, IntPtr dest ) : void
color Axiom.Core.ColorEx The color
format PixelFormat Pixel format in which to write the color
dest System.IntPtr Destination memory location
Результат void

PackColor() публичный статический метод

Pack a color value to memory
public static PackColor ( float r, float g, float b, float a, PixelFormat format, IntPtr dest ) : void
r float /// The four color components, range 0.0f to 1.0f /// (an exception to this case exists for floating point pixel /// formats, which don't clamp to 0.0f..1.0f) ///
g float /// The four color components, range 0.0f to 1.0f /// (an exception to this case exists for floating point pixel /// formats, which don't clamp to 0.0f..1.0f) ///
b float /// The four color components, range 0.0f to 1.0f /// (an exception to this case exists for floating point pixel /// formats, which don't clamp to 0.0f..1.0f) ///
a float /// The four color components, range 0.0f to 1.0f /// (an exception to this case exists for floating point pixel /// formats, which don't clamp to 0.0f..1.0f) ///
format PixelFormat Pixelformat in which to write the color
dest System.IntPtr Destination memory location
Результат void

PackColor() публичный статический метод

Pack a color value to memory
public static PackColor ( uint r, uint g, uint b, uint a, PixelFormat format, IntPtr dest ) : void
r uint Red component, range 0x00 to 0xFF
g uint Green component, range 0x00 to 0xFF
b uint Blue component, range 0x00 to 0xFF
a uint Alpha component, range 0x00 to 0xFF
format PixelFormat Pixelformat in which to write the color
dest System.IntPtr Destination memory location
Результат void

UnpackColor() публичный статический метод

Unpack a color value from memory
public static UnpackColor ( PixelFormat pf, IntPtr src ) : ColorEx
pf PixelFormat Pixelformat in which to read the color
src System.IntPtr Source memory location
Результат Axiom.Core.ColorEx

UnpackColor() публичный статический метод

Unpack a color value from memory
This function returns the color components in 8 bit precision, this will lose precision when coming from A2R10G10B10 or floating point formats.
public static UnpackColor ( byte &r, byte &g, byte &b, byte &a, PixelFormat pf, IntPtr src ) : void
r byte The color is returned here (as byte)
g byte The color is returned here (as byte)
b byte The color is returned here (as byte)
a byte The color is returned here (as byte)
pf PixelFormat Pixelformat in which to read the color
src System.IntPtr Source memory location
Результат void

UnpackColor() публичный статический метод

Unpack a color value from memory
public static UnpackColor ( float &r, float &g, float &b, float &a, PixelFormat pf, IntPtr src ) : void
r float The color is returned here (as float)
g float The color is returned here (as float)
b float The color is returned here (as float)
a float The color is returned here (as float)
pf PixelFormat Pixelformat in which to read the color
src System.IntPtr Source memory location
Результат void

Описание свойств

IndexedPixelFormats защищенное статическое свойство

protected static PixelFormatDescription[],Axiom.Media IndexedPixelFormats
Результат Axiom.Media.PixelFormatDescription[]

UnindexedPixelFormats защищенное статическое свойство

Pixel format database
protected static PixelFormatDescription[],Axiom.Media UnindexedPixelFormats
Результат Axiom.Media.PixelFormatDescription[]