C# Class SimplePaletteQuantizer.Helpers.ImageBuffer

Inheritance: IDisposable
Afficher le fichier Open project: RHY3756547/FreeSO Class Usage Examples

Méthodes publiques

Méthode Description
CalculateImageMeanError ( Image sourceImage, Image targetImage, Int32 parallelTaskCount = 4 ) : Double
CalculateImageMeanError ( Image sourceImage, ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
CalculateImageMeanError ( ImageBuffer source, Image targetImage, Int32 parallelTaskCount = 4 ) : Double
CalculateImageMeanError ( ImageBuffer source, ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
CalculateImageNormalizedMeanError ( Image sourceImage, Image targetImage, Int32 parallelTaskCount = 4 ) : Double
CalculateImageNormalizedMeanError ( Image sourceImage, ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
CalculateImageNormalizedMeanError ( ImageBuffer source, Image targetImage, Int32 parallelTaskCount = 4 ) : Double
CalculateImageNormalizedMeanError ( ImageBuffer source, ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
CalculateMeanError ( ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
CalculateNormalizedMeanError ( ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
ChangeFormat ( Image sourceImage, PixelFormat targetFormat, IColorQuantizer quantizer, Image &targetImage, Int32 parallelTaskCount = 4 ) : void
ChangeFormat ( ImageBuffer target, IColorQuantizer quantizer, Int32 parallelTaskCount = 4 ) : void
ChangeFormat ( ImageBuffer source, PixelFormat targetFormat, IColorQuantizer quantizer, Image &targetImage, Int32 parallelTaskCount = 4 ) : void
Clamp ( Int32 value, Int32 minimum, Int32 maximum = 255 ) : Int32
Copy ( ) : Byte[]
CorrectGamma ( System.Single gamma, IColorQuantizer quantizer, Int32 parallelTaskCount = 4 ) : void
CorrectImageGamma ( Image sourceImage, System.Single gamma, IColorQuantizer quantizer, Int32 parallelTaskCount = 4 ) : void
Dispose ( ) : void
Dither ( ImageBuffer target, IColorDitherer ditherer, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
DitherImage ( Image sourceImage, Image targetImage, IColorDitherer ditherer, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
DitherImage ( Image sourceImage, ImageBuffer target, IColorDitherer ditherer, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
DitherImage ( ImageBuffer source, Image targetImage, IColorDitherer ditherer, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
DitherImage ( ImageBuffer source, ImageBuffer target, IColorDitherer ditherer, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
GetBitOffset ( Int32 x ) : Int32
GetColorFromPixel ( Pixel pixel ) : Color
GetIndexFromPixel ( Pixel pixel ) : Int32
GetPaletteColor ( Int32 paletteIndex ) : Color
ImageBuffer ( Bitmap bitmap, ImageLockMode lockMode ) : System

Initializes a new instance of the ImageBuffer class.

ImageBuffer ( Image bitmap, ImageLockMode lockMode ) : System

Initializes a new instance of the ImageBuffer class.

Paste ( Byte buffer ) : void
ProcessPerPixel ( IList path, ProcessPixelFunction processPixelFunction, Int32 parallelTaskCount = 4 ) : void
ProcessPerPixelAdvanced ( IList path, ProcessPixelAdvancedFunction processPixelAdvancedFunction, Int32 parallelTaskCount = 4 ) : void
Quantize ( ImageBuffer target, IColorQuantizer quantizer, IColorDitherer ditherer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
Quantize ( ImageBuffer target, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
QuantizeImage ( Image sourceImage, IColorQuantizer quantizer, IColorDitherer ditherer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : Image
QuantizeImage ( Image sourceImage, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : Image
QuantizeImage ( ImageBuffer source, IColorQuantizer quantizer, IColorDitherer ditherer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : Image
QuantizeImage ( ImageBuffer source, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : Image
ReadColorUsingPixel ( Pixel pixel, Byte buffer = null ) : Color
ReadColorUsingPixelFrom ( Pixel pixel, Int32 x, Int32 y, Byte buffer = null ) : Color
ReadIndexUsingPixel ( Pixel pixel, Byte buffer = null ) : Int32
ReadIndexUsingPixelFrom ( Pixel pixel, Int32 x, Int32 y, Byte buffer = null ) : Int32
ReadPixel ( Pixel pixel, Byte buffer = null ) : void
ScanColors ( IColorQuantizer quantizer, Int32 parallelTaskCount = 4 ) : void
ScanImageColors ( Image sourceImage, IColorQuantizer quantizer, Int32 parallelTaskCount = 4 ) : void
SetColorToPixel ( Pixel pixel, Color color, IColorQuantizer quantizer ) : void
SetIndexToPixel ( Pixel pixel, Int32 index, Byte buffer = null ) : void
SynthetizeImagePalette ( Image sourceImage, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : List
SynthetizePalette ( IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : List
TransformPerPixel ( ImageBuffer target, IList path, TransformPixelFunction transformPixelFunction, Int32 parallelTaskCount = 4 ) : void
TransformPerPixelAdvanced ( ImageBuffer target, IList path, TransformPixelAdvancedFunction transformPixelAdvancedFunction, Int32 parallelTaskCount = 4 ) : void
WriteColorUsingPixel ( Pixel pixel, Color color, IColorQuantizer quantizer, Byte buffer = null ) : void
WriteColorUsingPixelAt ( Pixel pixel, Int32 x, Int32 y, Color color, IColorQuantizer quantizer, Byte buffer = null ) : void
WriteIndexUsingPixel ( Pixel pixel, Int32 index, Byte buffer = null ) : void
WriteIndexUsingPixelAt ( Pixel pixel, Int32 x, Int32 y, Int32 index, Byte buffer = null ) : void

Private Methods

Méthode Description
Precalculate ( ) : void
ProcessInParallel ( ICollection path, Action process, Int32 parallelTaskCount = 4 ) : void
ProcessPerPixelBase ( IList path, Delegate processingAction, Int32 parallelTaskCount = 4 ) : void
TransformPerPixelBase ( ImageBuffer target, IList path, Delegate transformAction, Int32 parallelTaskCount = 4 ) : void
UpdatePalette ( System.Boolean forceUpdate = false ) : List
WritePixel ( Pixel pixel, Byte buffer = null ) : void

Method Details

CalculateImageMeanError() public static méthode

public static CalculateImageMeanError ( Image sourceImage, Image targetImage, Int32 parallelTaskCount = 4 ) : Double
sourceImage Image
targetImage Image
parallelTaskCount System.Int32
Résultat Double

CalculateImageMeanError() public static méthode

public static CalculateImageMeanError ( Image sourceImage, ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
sourceImage Image
target ImageBuffer
parallelTaskCount System.Int32
Résultat Double

CalculateImageMeanError() public static méthode

public static CalculateImageMeanError ( ImageBuffer source, Image targetImage, Int32 parallelTaskCount = 4 ) : Double
source ImageBuffer
targetImage Image
parallelTaskCount System.Int32
Résultat Double

CalculateImageMeanError() public static méthode

public static CalculateImageMeanError ( ImageBuffer source, ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
source ImageBuffer
target ImageBuffer
parallelTaskCount System.Int32
Résultat Double

CalculateImageNormalizedMeanError() public static méthode

public static CalculateImageNormalizedMeanError ( Image sourceImage, Image targetImage, Int32 parallelTaskCount = 4 ) : Double
sourceImage Image
targetImage Image
parallelTaskCount System.Int32
Résultat Double

CalculateImageNormalizedMeanError() public static méthode

public static CalculateImageNormalizedMeanError ( Image sourceImage, ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
sourceImage Image
target ImageBuffer
parallelTaskCount System.Int32
Résultat Double

CalculateImageNormalizedMeanError() public static méthode

public static CalculateImageNormalizedMeanError ( ImageBuffer source, Image targetImage, Int32 parallelTaskCount = 4 ) : Double
source ImageBuffer
targetImage Image
parallelTaskCount System.Int32
Résultat Double

CalculateImageNormalizedMeanError() public static méthode

public static CalculateImageNormalizedMeanError ( ImageBuffer source, ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
source ImageBuffer
target ImageBuffer
parallelTaskCount System.Int32
Résultat Double

CalculateMeanError() public méthode

public CalculateMeanError ( ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
target ImageBuffer
parallelTaskCount System.Int32
Résultat Double

CalculateNormalizedMeanError() public méthode

public CalculateNormalizedMeanError ( ImageBuffer target, Int32 parallelTaskCount = 4 ) : Double
target ImageBuffer
parallelTaskCount System.Int32
Résultat Double

ChangeFormat() public static méthode

public static ChangeFormat ( Image sourceImage, PixelFormat targetFormat, IColorQuantizer quantizer, Image &targetImage, Int32 parallelTaskCount = 4 ) : void
sourceImage Image
targetFormat PixelFormat
quantizer IColorQuantizer
targetImage Image
parallelTaskCount System.Int32
Résultat void

ChangeFormat() public méthode

public ChangeFormat ( ImageBuffer target, IColorQuantizer quantizer, Int32 parallelTaskCount = 4 ) : void
target ImageBuffer
quantizer IColorQuantizer
parallelTaskCount System.Int32
Résultat void

ChangeFormat() public static méthode

public static ChangeFormat ( ImageBuffer source, PixelFormat targetFormat, IColorQuantizer quantizer, Image &targetImage, Int32 parallelTaskCount = 4 ) : void
source ImageBuffer
targetFormat PixelFormat
quantizer IColorQuantizer
targetImage Image
parallelTaskCount System.Int32
Résultat void

Clamp() public static méthode

public static Clamp ( Int32 value, Int32 minimum, Int32 maximum = 255 ) : Int32
value System.Int32
minimum System.Int32
maximum System.Int32
Résultat System.Int32

Copy() public méthode

public Copy ( ) : Byte[]
Résultat Byte[]

CorrectGamma() public méthode

public CorrectGamma ( System.Single gamma, IColorQuantizer quantizer, Int32 parallelTaskCount = 4 ) : void
gamma System.Single
quantizer IColorQuantizer
parallelTaskCount System.Int32
Résultat void

CorrectImageGamma() public static méthode

public static CorrectImageGamma ( Image sourceImage, System.Single gamma, IColorQuantizer quantizer, Int32 parallelTaskCount = 4 ) : void
sourceImage Image
gamma System.Single
quantizer IColorQuantizer
parallelTaskCount System.Int32
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dither() public méthode

public Dither ( ImageBuffer target, IColorDitherer ditherer, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
target ImageBuffer
ditherer IColorDitherer
quantizer IColorQuantizer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat void

DitherImage() public static méthode

public static DitherImage ( Image sourceImage, Image targetImage, IColorDitherer ditherer, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
sourceImage Image
targetImage Image
ditherer IColorDitherer
quantizer IColorQuantizer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat void

DitherImage() public static méthode

public static DitherImage ( Image sourceImage, ImageBuffer target, IColorDitherer ditherer, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
sourceImage Image
target ImageBuffer
ditherer IColorDitherer
quantizer IColorQuantizer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat void

DitherImage() public static méthode

public static DitherImage ( ImageBuffer source, Image targetImage, IColorDitherer ditherer, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
source ImageBuffer
targetImage Image
ditherer IColorDitherer
quantizer IColorQuantizer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat void

DitherImage() public static méthode

public static DitherImage ( ImageBuffer source, ImageBuffer target, IColorDitherer ditherer, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
source ImageBuffer
target ImageBuffer
ditherer IColorDitherer
quantizer IColorQuantizer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat void

GetBitOffset() public méthode

public GetBitOffset ( Int32 x ) : Int32
x System.Int32
Résultat System.Int32

GetColorFromPixel() public méthode

public GetColorFromPixel ( Pixel pixel ) : Color
pixel Pixel
Résultat Color

GetIndexFromPixel() public méthode

public GetIndexFromPixel ( Pixel pixel ) : Int32
pixel Pixel
Résultat System.Int32

GetPaletteColor() public méthode

public GetPaletteColor ( Int32 paletteIndex ) : Color
paletteIndex System.Int32
Résultat Color

ImageBuffer() public méthode

Initializes a new instance of the ImageBuffer class.
public ImageBuffer ( Bitmap bitmap, ImageLockMode lockMode ) : System
bitmap System.Drawing.Bitmap
lockMode ImageLockMode
Résultat System

ImageBuffer() public méthode

Initializes a new instance of the ImageBuffer class.
public ImageBuffer ( Image bitmap, ImageLockMode lockMode ) : System
bitmap Image
lockMode ImageLockMode
Résultat System

Paste() public méthode

public Paste ( Byte buffer ) : void
buffer Byte
Résultat void

ProcessPerPixel() public méthode

public ProcessPerPixel ( IList path, ProcessPixelFunction processPixelFunction, Int32 parallelTaskCount = 4 ) : void
path IList
processPixelFunction ProcessPixelFunction
parallelTaskCount System.Int32
Résultat void

ProcessPerPixelAdvanced() public méthode

public ProcessPerPixelAdvanced ( IList path, ProcessPixelAdvancedFunction processPixelAdvancedFunction, Int32 parallelTaskCount = 4 ) : void
path IList
processPixelAdvancedFunction ProcessPixelAdvancedFunction
parallelTaskCount System.Int32
Résultat void

Quantize() public méthode

public Quantize ( ImageBuffer target, IColorQuantizer quantizer, IColorDitherer ditherer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
target ImageBuffer
quantizer IColorQuantizer
ditherer IColorDitherer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat void

Quantize() public méthode

public Quantize ( ImageBuffer target, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : void
target ImageBuffer
quantizer IColorQuantizer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat void

QuantizeImage() public static méthode

public static QuantizeImage ( Image sourceImage, IColorQuantizer quantizer, IColorDitherer ditherer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : Image
sourceImage Image
quantizer IColorQuantizer
ditherer IColorDitherer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat Image

QuantizeImage() public static méthode

public static QuantizeImage ( Image sourceImage, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : Image
sourceImage Image
quantizer IColorQuantizer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat Image

QuantizeImage() public static méthode

public static QuantizeImage ( ImageBuffer source, IColorQuantizer quantizer, IColorDitherer ditherer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : Image
source ImageBuffer
quantizer IColorQuantizer
ditherer IColorDitherer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat Image

QuantizeImage() public static méthode

public static QuantizeImage ( ImageBuffer source, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : Image
source ImageBuffer
quantizer IColorQuantizer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat Image

ReadColorUsingPixel() public méthode

public ReadColorUsingPixel ( Pixel pixel, Byte buffer = null ) : Color
pixel Pixel
buffer Byte
Résultat Color

ReadColorUsingPixelFrom() public méthode

public ReadColorUsingPixelFrom ( Pixel pixel, Int32 x, Int32 y, Byte buffer = null ) : Color
pixel Pixel
x System.Int32
y System.Int32
buffer Byte
Résultat Color

ReadIndexUsingPixel() public méthode

public ReadIndexUsingPixel ( Pixel pixel, Byte buffer = null ) : Int32
pixel Pixel
buffer Byte
Résultat System.Int32

ReadIndexUsingPixelFrom() public méthode

public ReadIndexUsingPixelFrom ( Pixel pixel, Int32 x, Int32 y, Byte buffer = null ) : Int32
pixel Pixel
x System.Int32
y System.Int32
buffer Byte
Résultat System.Int32

ReadPixel() public méthode

public ReadPixel ( Pixel pixel, Byte buffer = null ) : void
pixel Pixel
buffer Byte
Résultat void

ScanColors() public méthode

public ScanColors ( IColorQuantizer quantizer, Int32 parallelTaskCount = 4 ) : void
quantizer IColorQuantizer
parallelTaskCount System.Int32
Résultat void

ScanImageColors() public static méthode

public static ScanImageColors ( Image sourceImage, IColorQuantizer quantizer, Int32 parallelTaskCount = 4 ) : void
sourceImage Image
quantizer IColorQuantizer
parallelTaskCount System.Int32
Résultat void

SetColorToPixel() public méthode

public SetColorToPixel ( Pixel pixel, Color color, IColorQuantizer quantizer ) : void
pixel Pixel
color Color
quantizer IColorQuantizer
Résultat void

SetIndexToPixel() public méthode

public SetIndexToPixel ( Pixel pixel, Int32 index, Byte buffer = null ) : void
pixel Pixel
index System.Int32
buffer Byte
Résultat void

SynthetizeImagePalette() public static méthode

public static SynthetizeImagePalette ( Image sourceImage, IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : List
sourceImage Image
quantizer IColorQuantizer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat List

SynthetizePalette() public méthode

public SynthetizePalette ( IColorQuantizer quantizer, Int32 colorCount, Int32 parallelTaskCount = 4 ) : List
quantizer IColorQuantizer
colorCount System.Int32
parallelTaskCount System.Int32
Résultat List

TransformPerPixel() public méthode

public TransformPerPixel ( ImageBuffer target, IList path, TransformPixelFunction transformPixelFunction, Int32 parallelTaskCount = 4 ) : void
target ImageBuffer
path IList
transformPixelFunction TransformPixelFunction
parallelTaskCount System.Int32
Résultat void

TransformPerPixelAdvanced() public méthode

public TransformPerPixelAdvanced ( ImageBuffer target, IList path, TransformPixelAdvancedFunction transformPixelAdvancedFunction, Int32 parallelTaskCount = 4 ) : void
target ImageBuffer
path IList
transformPixelAdvancedFunction TransformPixelAdvancedFunction
parallelTaskCount System.Int32
Résultat void

WriteColorUsingPixel() public méthode

public WriteColorUsingPixel ( Pixel pixel, Color color, IColorQuantizer quantizer, Byte buffer = null ) : void
pixel Pixel
color Color
quantizer IColorQuantizer
buffer Byte
Résultat void

WriteColorUsingPixelAt() public méthode

public WriteColorUsingPixelAt ( Pixel pixel, Int32 x, Int32 y, Color color, IColorQuantizer quantizer, Byte buffer = null ) : void
pixel Pixel
x System.Int32
y System.Int32
color Color
quantizer IColorQuantizer
buffer Byte
Résultat void

WriteIndexUsingPixel() public méthode

public WriteIndexUsingPixel ( Pixel pixel, Int32 index, Byte buffer = null ) : void
pixel Pixel
index System.Int32
buffer Byte
Résultat void

WriteIndexUsingPixelAt() public méthode

public WriteIndexUsingPixelAt ( Pixel pixel, Int32 x, Int32 y, Int32 index, Byte buffer = null ) : void
pixel Pixel
x System.Int32
y System.Int32
index System.Int32
buffer Byte
Résultat void