From 2fb8cf7cdc48aa97eabf14a51c2a141823368de3 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sun, 29 Mar 2015 17:50:40 +0900 Subject: vcl: cleanup pngreader, use unique_ptr for pImpl Change-Id: I36fb35338d8635e4bf1ac7c60e0f09da401406db --- include/vcl/pngread.hxx | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'include/vcl') diff --git a/include/vcl/pngread.hxx b/include/vcl/pngread.hxx index 8513a1a6c446..3954f5cba0ab 100644 --- a/include/vcl/pngread.hxx +++ b/include/vcl/pngread.hxx @@ -24,40 +24,38 @@ #include #include - -// - PNGReader - - - namespace vcl { - class PNGReaderImpl; - class VCL_DLLPUBLIC PNGReader - { - PNGReaderImpl* mpImpl; +class PNGReaderImpl; - public: +class VCL_DLLPUBLIC PNGReader +{ + std::unique_ptr mpImpl; - /* the PNG chunks are read within the c'tor, so the stream will - be positioned at the end of the PNG */ - explicit PNGReader( SvStream& rStm ); - ~PNGReader(); +public: - /* an empty preview size hint (=default) will read the whole image - */ - BitmapEx Read( const Size& i_rPreviewHint = Size() ); + /* the PNG chunks are read within the c'tor, so the stream will + be positioned at the end of the PNG */ + explicit PNGReader(SvStream& rStream); + ~PNGReader(); - // retrieve every chunk that resides inside the PNG - struct ChunkData - { - sal_uInt32 nType; - std::vector< sal_uInt8 > aData; - }; - const std::vector< ChunkData >& GetChunks() const; + /* an empty preview size hint (=default) will read the whole image + */ + BitmapEx Read(const Size& i_rPreviewHint = Size()); - void SetIgnoreGammaChunk( bool b ); + // retrieve every chunk that resides inside the PNG + struct ChunkData + { + sal_uInt32 nType; + std::vector aData; }; -} + const std::vector& GetChunks() const; + + void SetIgnoreGammaChunk(bool bIgnoreGammaChunk); +}; + +} // end namespace vcl #endif // INCLUDED_VCL_PNGREAD_HXX -- cgit