←Select platform

SharpenCommand Constructor(int)

Summary
Initializes a new SharpenCommand class object with explicit parameters.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public SharpenCommand( 
   int sharpness 
) 
- (instancetype)initWithSharpness:(NSInteger)sharpness NS_DESIGNATED_INITIALIZER; 
public SharpenCommand( 
   int sharpness 
); 
public: 
SharpenCommand(  
   int sharpness 
) 
__init__(self,sharpness) # Overloaded constructor 

Parameters

sharpness
The amount to change the sharpness. Valid values range from -1000 to +1000. Negative sharpness values decrease the sharpness of the image. Specify -1000 for minimum sharpness. Positive sharpness values increase the sharpness. Specify +1000 for maximum sharpness.

Example

Run the SharpenCommand on an image and increases its sharpness.

C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Effects; 
 
 
public void SharpenCommandConstructorExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE1.CMP")); 
 
   // Prepare the command 
   SharpenCommand command = new SharpenCommand(950); 
   // Increase the sharpness by 95 percent of the possible range. 
   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:\LEADTOOLS23\Resources\Images"; 
} 
 
import java.io.File; 
import java.io.IOException; 
 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
import static org.junit.Assert.assertTrue; 
 
import leadtools.*; 
import leadtools.codecs.*; 
import leadtools.imageprocessing.effects.*; 
 
 
public void sharpenCommandConstructorExample() { 
   final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images"; 
 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.setThrowExceptionsOnInvalidImages(true); 
 
   RasterImage image = codecs.load(combine(LEAD_VARS_IMAGES_DIR, "IMAGE1.CMP")); 
 
   // Prepare the command 
   SharpenCommand command = new SharpenCommand(950); 
 
   // Increase the sharpness by 95 percent of the possible range. 
   int change = command.run(image); 
   assertTrue(change != RasterImageChangedFlags.NONE); 
 
   // Save the image 
   String outputFileName = combine(LEAD_VARS_IMAGES_DIR, "sharpenConstructorResult.jpg"); 
   codecs.save(image, outputFileName, RasterImageFormat.JPEG, 24); 
   System.out.println("Command run, image saved to " + outputFileName); 
} 
Requirements

Target Platforms

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

Leadtools.ImageProcessing.Effects Assembly

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