←Select platform

CodecsJbig2LoadOptions Class

Summary
Provides options specifically for loading JBIG2 images.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public class CodecsJbig2LoadOptions  
@interface LTCodecsJbig2LoadOptions : NSObject 
public class CodecsJbig2LoadOptions 
public ref class CodecsJbig2LoadOptions  
class CodecsJbig2LoadOptions: 
Example
C#
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"; 
} 
Requirements

Target Platforms

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

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