public int ImageGbatX1 {get; set;}
@property (nonatomic, assign) NSInteger imageGbatX1;
public int getImageGbatX1()
public void setImageGbatX1(int value)
ImageGbatX1 # get and set (CodecsJbig2SaveOptions)
Value | Description |
---|---|
-128 to 127 | An integer that represents the X-location of the adaptive template pixel A1 for non-text area except when ImageGbatY1 is zero. The default value is -1 . |
128 to 1 | An integer that represents the X-location of the adaptive template pixel A1 for non-text area when ImageGbatY1 is zero. |
using Leadtools;
using Leadtools.Codecs;
using Leadtools.ImageProcessing.Core;
public void CodecsJbig2OptionsExample()
{
RasterCodecs codecs = new RasterCodecs();
string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "ocr1.tif");
RasterImage srcImage = codecs.Load(srcFileName);
codecs.Options.Jbig2.Load.LoadOldFiles = false; // CodecsJbig2Options & CodecsJbig2LoadOptions reference
// Save as JBIG2 with Template #3
// CodecsJbig2SaveOptions reference. All properties are set to default values.
codecs.Options.Jbig2.Save.RemoveMarker = true;
codecs.Options.Jbig2.Save.EnableDictionary = true;
codecs.Options.Jbig2.Save.RemoveHeaderSegment = true;
codecs.Options.Jbig2.Save.RemoveEopSegment = true;
codecs.Options.Jbig2.Save.RemoveEofSegment = true;
codecs.Options.Jbig2.Save.ImageTypicalPredictionOn = true;
codecs.Options.Jbig2.Save.ImageTemplateType = 3;
codecs.Options.Jbig2.Save.ImageQualityFactor = 0; // Lossless image compression
codecs.Options.Jbig2.Save.ImageGbatX1 = -1;
codecs.Options.Jbig2.Save.ImageGbatX2 = -1;
codecs.Options.Jbig2.Save.ImageGbatX3 = -2;
codecs.Options.Jbig2.Save.ImageGbatX4 = -2;
codecs.Options.Jbig2.Save.ImageGbatY1 = -3;
codecs.Options.Jbig2.Save.ImageGbatY2 = 2;
codecs.Options.Jbig2.Save.ImageGbatY3 = -2;
codecs.Options.Jbig2.Save.ImageGbatY4 = 0;
codecs.Options.Jbig2.Save.TextDifferentialThreshold = 30;
codecs.Options.Jbig2.Save.TextGbatX1 = 3;
codecs.Options.Jbig2.Save.TextGbatX2 = -3;
codecs.Options.Jbig2.Save.TextGbatX3 = 2;
codecs.Options.Jbig2.Save.TextGbatX4 = -2;
codecs.Options.Jbig2.Save.TextGbatY1 = -1;
codecs.Options.Jbig2.Save.TextGbatY2 = -1;
codecs.Options.Jbig2.Save.TextGbatY3 = -2;
codecs.Options.Jbig2.Save.TextGbatY4 = -2;
codecs.Options.Jbig2.Save.TextKeepAllSymbols = true;
codecs.Options.Jbig2.Save.TextMaximumSymbolArea = 2000;
codecs.Options.Jbig2.Save.TextMaximumSymbolHeight = 200;
codecs.Options.Jbig2.Save.TextMaximumSymbolWidth = 200;
codecs.Options.Jbig2.Save.TextMinimumSymbolArea = 50;
codecs.Options.Jbig2.Save.TextMinimumSymbolHeight = 1;
codecs.Options.Jbig2.Save.TextMinimumSymbolWidth = 1;
codecs.Options.Jbig2.Save.TextQualityFactor = 0; // Lossless. 0 is the default value. Lossy is > 0
codecs.Options.Jbig2.Save.TextRemoveUnrepeatedSymbol = false;
codecs.Options.Jbig2.Save.TextTemplateType = 0;
codecs.Options.Jbig2.Save.XResolution = 150;
codecs.Options.Jbig2.Save.YResolution = 150;
codecs.Save(srcImage, Path.Combine(LEAD_VARS.ImagesDir, "jbig2.jb2"), RasterImageFormat.Jbig2, 1);
// Clean up
srcImage.Dispose();
codecs.Dispose();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document