コード例 #1
0
        internal override ImageData PrepareImageData()
        {
            ImagePrivateDataDct data      = (ImagePrivateDataDct)Data;
            ImageDataDct        imageData = new ImageDataDct
            {
                Data   = data.Data,
                Length = data.Length
            };

            return(imageData);
        }
コード例 #2
0
        // TODO Find information about JPEG2000.

        // Notes: JFIF is big-endian.

        public ImportedImage ImportImage(StreamReaderHelper stream, PDFDocument document)
        {
            try
            {
                stream.CurrentOffset = 0;
                // Test 2 magic bytes.
                if (TestFileHeader(stream))
                {
                    // Skip over 2 magic bytes.
                    stream.CurrentOffset += 2;

                    ImagePrivateDataDct ipd = new ImagePrivateDataDct(stream.Data, stream.Length);
                    ImportedImage       ii  = new ImportedImageJpeg(this, ipd, document);
                    if (TestJfifHeader(stream, ii))
                    {
                        bool colorHeader = false, infoHeader = false;

                        while (MoveToNextHeader(stream))
                        {
                            if (TestColorFormatHeader(stream, ii))
                            {
                                colorHeader = true;
                            }
                            else if (TestInfoHeader(stream, ii))
                            {
                                infoHeader = true;
                            }
                        }
                        if (colorHeader && infoHeader)
                        {
                            return(ii);
                        }
                    }
                }
            }
            // ReSharper disable once EmptyGeneralCatchClause
            catch (Exception)
            {
            }
            return(null);
        }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ImportedImageJpeg"/> class.
 /// </summary>
 public ImportedImageJpeg(IImageImporter importer, ImagePrivateDataDct data, PDFDocument document)
     : base(importer, data, document)
 {
 }