JBIG2 Decoder

Discussions about image processing and document imaging.
Post Reply
dan276
Posts: 20
Joined: Fri Mar 15, 2013 1:07 am

JBIG2 Decoder

Post by dan276 » Wed May 01, 2013 9:31 pm

I'm using a telerik WPF PDF viewer to view my PDFs and they have an option to decode JBIG2 if you add the decoding yourself. I'm wondering if I can do this with this plugin? I basically need to take the inputData which is the bytes for that page and decode it. I couldn't find anything to do that, but there probably should be a way.

public class CustomFilter : IPdfFilter
{
public byte[] Encode(PdfObject encodedObject, byte[] inputData)
{
throw new NotImplementedException();
}

public byte[] Decode(PdfObject decodedObject, byte[] inputData, DecodeParameters parms)
{
throw new NotImplementedException();
}

public string Name { get { return PdfFilterNames.JBIG2Decode; } }
}

Here is what they say about it:
The result that custom filter should return depends on the type of the filter. For the binary filters it is enough to decode the byte array into decoded byte array using the respective algorithm. As for the filters listed below, additional transformation is required.
RadPdfViewer expects these filters to return data that depends on the decoded object's colors space and bits per component (there are such properties in the decodedObject). The resulting byte array should contain exactly BitsPerComponent bits for each color component in the color space. For example, if you have RGB color space and 8 bits per component, the resulting byte array should contains a single byte value for each Red, Green and Blue value (for each pixel) in the decoded image.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest