LCOV - code coverage report
Current view: top level - sdext/source/pdfimport/xpdfwrapper - pnghelper.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 5 5 100.0 %
Date: 2015-06-13 12:38:46 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #ifndef INCLUDED_SDEXT_SOURCE_PDFIMPORT_XPDFWRAPPER_PNGHELPER_HXX
      21             : #define INCLUDED_SDEXT_SOURCE_PDFIMPORT_XPDFWRAPPER_PNGHELPER_HXX
      22             : 
      23             : #include "sal/types.h"
      24             : #include "pdfioutdev_gpl.hxx"
      25             : 
      26             : 
      27             : namespace pdfi
      28             : {
      29             :     class PngHelper
      30             :     {
      31             :         static sal_uInt32 crc_table[ 256 ];
      32             :         static bool bCRCTableInit;
      33             : 
      34             :         static void initCRCTable();
      35             :         static void appendFileHeader( OutputBuffer& o_rOutputBuf );
      36             :         static size_t startChunk( const char* pChunkName, OutputBuffer& o_rOut );
      37             :         static void endChunk( size_t nStart, OutputBuffer& o_rOut );
      38             : 
      39             :         static void set( sal_uInt32 i_nValue, OutputBuffer& o_rOutputBuf, size_t i_nIndex );
      40           5 :         static void append( sal_uInt32 i_nValue, OutputBuffer& o_rOutputBuf )
      41             :         {
      42           5 :             size_t nCur = o_rOutputBuf.size();
      43           5 :             o_rOutputBuf.insert( o_rOutputBuf.end(), 4, (Output_t)0 );
      44           5 :             set( i_nValue, o_rOutputBuf, nCur );
      45           5 :         }
      46             : 
      47             :         static void appendIHDR( OutputBuffer& o_rOutputBuf, int width, int height, int depth, int colortype );
      48             :         static void appendIEND( OutputBuffer& o_rOutputBuf );
      49             : 
      50             :     public:
      51             :         static void updateCRC( sal_uInt32& io_rCRC, const sal_uInt8* i_pBuf, size_t i_nLen );
      52             :         static sal_uInt32 getCRC( const sal_uInt8* i_pBuf, size_t i_nLen );
      53             : 
      54             :         // deflates the passed buff i_pBuf and appends it to the output vector
      55             :         // returns the number of bytes added to the output
      56             :         static sal_uInt32 deflateBuffer( const Output_t* i_pBuf, size_t i_nLen, OutputBuffer& o_rOut );
      57             : 
      58             :         static void createPng( OutputBuffer&     o_rOutputBuf,
      59             :                                Stream*           str,
      60             :                                int               width,
      61             :                                int               height,
      62             :                                GfxRGB&           zeroColor,
      63             :                                GfxRGB&           oneColor,
      64             :                                bool              bIsMask
      65             :                                );
      66             :         static void createPng( OutputBuffer& o_rOutputBuf,
      67             :                                Stream* str,
      68             :                                int width, int height, GfxImageColorMap* colorMap,
      69             :                                Stream* maskStr,
      70             :                                int maskWidth, int maskHeight, GfxImageColorMap* maskColorMap );
      71             : 
      72             :         // for one bit masks
      73             :         static void createPng( OutputBuffer& o_rOutputBuf,
      74             :                                Stream* str,
      75             :                                int width, int height, GfxImageColorMap* colorMap,
      76             :                                Stream* maskStr,
      77             :                                int maskWidth, int maskHeight, bool maskInvert );
      78             : 
      79             :     };
      80             : }
      81             : 
      82             : #endif
      83             : 
      84             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11