Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.5.7
|
Leadtools.Jpeg2000 Namespace > Jpeg2000Engine Class : FragmentJpxFile Method |
public void FragmentJpxFile( string inputFileName, string outputFileName, List<UuidUrl> urls, List<Fragment> fragments )
'Declaration Public Sub FragmentJpxFile( _ ByVal inputFileName As String, _ ByVal outputFileName As String, _ ByVal urls As List(Of UuidUrl), _ ByVal fragments As List(Of Fragment) _ )
'Usage Dim instance As Jpeg2000Engine Dim inputFileName As String Dim outputFileName As String Dim urls As List(Of UuidUrl) Dim fragments As List(Of Fragment) instance.FragmentJpxFile(inputFileName, outputFileName, urls, fragments)
public: void FragmentJpxFile( String^ inputFileName, String^ outputFileName, List<UuidUrl>^ urls, List<Fragment>^ fragments )
It is up to the user to save the fragmented code streams in their URL locations.
Fragmentation in JPX works by specifying a table of pointers to the individual fragments. Each pointer specifies three things:
Fragmentation is an important feature of the JPX file format since it allows applications to implement such features as:
Imports Leadtools Imports Leadtools.Codecs Imports Leadtools.Jpeg2000 <TestMethod()> _ Public Sub FragmentJpxFileExample() Dim engine As New Jpeg2000Engine() Dim fileInfo As Jpeg2000FileInformation = engine.GetFileInformation(Path.Combine(LEAD_VARS.ImagesDir, "image1.jpx")) If (1 > fileInfo.CodeStream.GetLength(0)) Then Return End If Dim frames As New List(Of Integer) frames.Add(0) Dim url As New UuidUrl() ReDim url.Flag(2) url.Flag(0) = 0 url.Flag(1) = 0 url.Flag(2) = 0 url.Version = 0 Dim loaction As String = Path.Combine(LEAD_VARS.ImagesDir, "codestream.bin") Dim data() As Byte = Encoding.ASCII.GetBytes(loaction) ReDim url.Location(data.GetLength(0)) data.CopyTo(url.Location, 0) Dim urls As New List(Of UuidUrl) urls.Add(url) Dim _fragment As New Fragment() _fragment.CodeStreamIndex = 0 _fragment.Offset = 0 _fragment.UrlIndex = 0 Dim fragments As New List(Of Fragment) fragments.Add(_fragment) engine.FragmentJpxFile(Path.Combine(LEAD_VARS.ImagesDir, "image1.jpx"), Path.Combine(LEAD_VARS.ImagesDir, "Test.jpx"), urls, fragments) End Sub Public NotInheritable Class LEAD_VARS Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" End Class
using Leadtools; using Leadtools.Codecs; using Leadtools.Jpeg2000; [TestMethod] public void FragmentJpxFileExample() { Jpeg2000Engine engine = new Jpeg2000Engine(); Jpeg2000FileInformation fileInfo = engine.GetFileInformation(Path.Combine(LEAD_VARS.ImagesDir, "image1.jpx")); if (1 > fileInfo.CodeStream.GetLength(0)) return; List<int> frames = new List<int>(); frames.Add(0); UuidUrl url = new UuidUrl(); url.Flag = new byte[3]; url.Flag[0] = 0; url.Flag[1] = 0; url.Flag[2] = 0; url.Version = 0; String loaction = Path.Combine(LEAD_VARS.ImagesDir, "codestream.bin"); byte[] data = Encoding.ASCII.GetBytes(loaction); url.Location = new byte[data.GetLength(0)]; data.CopyTo(url.Location, 0); List<UuidUrl> urls = new List<UuidUrl>(); urls.Add(url); Fragment fragment = new Fragment(); fragment.CodeStreamIndex = 0; fragment.Offset = 0; fragment.UrlIndex = 0; List<Fragment> fragments = new List<Fragment>(); fragments.Add(fragment); engine.FragmentJpxFile(Path.Combine(LEAD_VARS.ImagesDir, "image1.jpx"), Path.Combine(LEAD_VARS.ImagesDir, "Test.jpx"), urls, fragments); } static class LEAD_VARS { public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; }
Jpeg2000Engine Class
Jpeg2000Engine Members
AppendFrames(RasterCodecs,String,List<CompositeJpxImages>,Int32,Int32) Method
AppendGmlData
ExtractFrames
ExtractFramesMemory
ExtractFramesNativeMemory
ReadBox
ReadFrames
ReadGmlData
Compression Using LEAD and JPEG Formats
File Formats - JPEG And LEAD Compressed
Bitmaps In Memory And In Files
JPEG2000 File Comments
JPEG And LEAD File Comments
Programming with JPEG 2000 Features
JPEG 2000 Boxes