ApplyMathematicalLogicCommand Class (original) (raw)

Summary

Performs specific mathematical or logical operations on the colors of the image.

Syntax

C#

Objective-C

C++/CLI

Java

Python

@interface LTApplyMathematicalLogicCommand : LTRasterCommand 

public class ApplyMathematicalLogicCommand extends RasterCommand

class ApplyMathematicalLogicCommand(RasterCommand): 

Example

Run the ApplyMathematicalLogicCommand on an image.

using Leadtools; using Leadtools.Codecs; using Leadtools.ImageProcessing.Color; public void ApplyMathematicalLogicCommandExample() { // Load an image RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, @"ImageProcessingDemo\NaturalFruits.jpg")); // Prepare the command ApplyMathematicalLogicCommand command = new ApplyMathematicalLogicCommand(); command.Factor = 151; command.Flags = ApplyMathematicalLogicCommandFlags.OperationMultiply | ApplyMathematicalLogicCommandFlags.ValueDoNothing | ApplyMathematicalLogicCommandFlags.ResultDoNothing; // Multiply the colors of the bitmap using a factor of 1.51 . command.Run(image); codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24); } static class LEAD_VARS { public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; }