LibreOffice Module vcl (master)  1
JpegReader.hxx
Go to the documentation of this file.
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_VCL_SOURCE_FILTER_JPEG_JPEGREADER_HXX
21 #define INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGREADER_HXX
22 
23 #include <vcl/graph.hxx>
24 #include <vcl/bitmap.hxx>
25 #include <bitmapwriteaccess.hxx>
27 
28 enum class GraphicFilterImportFlags;
29 
31 {
35 };
36 
38 {
39  unsigned long nWidth;
40  unsigned long nHeight;
41  unsigned long density_unit;
42  unsigned long X_density;
43  unsigned long Y_density;
44 
45  bool bGray;
46 };
47 
48 class JPEGReader : public GraphicReader
49 {
51  std::unique_ptr<Bitmap> mpBitmap;
52  std::unique_ptr<Bitmap> mpIncompleteAlpha;
53 
54  long mnLastPos;
57 
59 
60 public:
61  JPEGReader( SvStream& rStream, GraphicFilterImportFlags nImportFlags );
62  virtual ~JPEGReader() override;
63 
64  ReadState Read(Graphic& rGraphic, GraphicFilterImportFlags nImportFlags, BitmapScopedWriteAccess* ppAccess);
65 
66  bool CreateBitmap(JPEGCreateBitmapParam const & param);
67 
68  Bitmap& GetBitmap() { return *mpBitmap; }
69 };
70 
71 #endif // INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGREADER_HXX
72 
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< Bitmap > mpBitmap
Definition: JpegReader.hxx:51
virtual ~JPEGReader() override
Definition: JpegReader.cxx:187
bool CreateBitmap(JPEGCreateBitmapParam const &param)
Definition: JpegReader.cxx:191
ReadState Read(Graphic &rGraphic, GraphicFilterImportFlags nImportFlags, BitmapScopedWriteAccess *ppAccess)
Definition: JpegReader.cxx:285
long mnLastLines
Definition: JpegReader.hxx:55
bool mbSetLogSize
Definition: JpegReader.hxx:56
unsigned long X_density
Definition: JpegReader.hxx:42
unsigned long density_unit
Definition: JpegReader.hxx:41
ReadState
Definition: gifread.cxx:44
JPEGReader(SvStream &rStream, GraphicFilterImportFlags nImportFlags)
Definition: JpegReader.cxx:172
std::unique_ptr< Bitmap > mpIncompleteAlpha
Definition: JpegReader.hxx:52
unsigned long nWidth
Definition: JpegReader.hxx:39
SvStream & mrStream
Definition: JpegReader.hxx:50
unsigned long Y_density
Definition: JpegReader.hxx:43
Graphic CreateIntermediateGraphic(long nLines)
Definition: JpegReader.cxx:245
unsigned long nHeight
Definition: JpegReader.hxx:40
long mnLastPos
Definition: JpegReader.hxx:54
Bitmap & GetBitmap()
Definition: JpegReader.hxx:68
GraphicFilterImportFlags