←Select platform

SelectiveColorCommandData Constructor(int,int,int,int)

Summary
Initializes a new SelectiveColorCommandData class with explicit parameters.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public SelectiveColorCommandData( 
   int cyan, 
   int magenta, 
   int yellow, 
   int black 
) 
- (instancetype)initWithCyan:(int8_t)cyan magenta:(int8_t)magenta yellow:(int8_t)yellow black:(int8_t)black NS_DESIGNATED_INITIALIZER; 
public SelectiveColorCommandData( 
   int cyan, 
   int magenta, 
   int yellow, 
   int black 
); 
public: 
SelectiveColorCommandData(  
   int cyan, 
   int magenta, 
   int yellow, 
   int black 
) 
__init__(self,cyan,magenta,yellow,black) # Overloaded constructor 

Parameters

cyan
Value that specifies the percentage of cyan in a color. Valid values range from -100 to 100, which is interpreted as -100 to 100.

magenta
Value that specifies the percentage of magenta in a color. Valid values range from -100 to 100, which is interpreted as -100 to 100.

yellow
Value that specifies the percentage of yellow in a color. Valid values range from -100 to 100, which is interpreted as -100 to 100.

black
Value that specifies the percentage of black in a color. Valid values range from -100 to 100, which is interpreted as -100 to 100.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Color; 
 
 
public void SelectiveColorConstructorExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "cannon.jpg")); 
 
   // Prepare the command 
   //Manipulate values. 
   SelectiveColorCommandData[] colorsData = new SelectiveColorCommandData[9]; 
 
   for (int i = 0; i < 8; i++) 
      colorsData[i] = new SelectiveColorCommandData(); 
 
   colorsData[(int)SelectiveCommandColorTypes.Black] = new SelectiveColorCommandData(-65, -39, 65, 0); 
   SelectiveColorCommand command = new SelectiveColorCommand(colorsData); 
   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"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Color Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.