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>
26 
27 enum class GraphicFilterImportFlags;
28 
30 {
34 };
35 
37 {
38  unsigned long nWidth;
39  unsigned long nHeight;
40  unsigned long density_unit;
41  unsigned long X_density;
42  unsigned long Y_density;
43 
44  bool bGray;
45 };
46 
47 class JPEGReader : public GraphicReader
48 {
50  std::unique_ptr<Bitmap> mpBitmap;
51  std::unique_ptr<Bitmap> mpIncompleteAlpha;
52 
53  long const mnLastPos;
55  bool const mbSetLogSize;
56 
58 
59 public:
60  JPEGReader( SvStream& rStream, GraphicFilterImportFlags nImportFlags );
61  virtual ~JPEGReader() override;
62 
63  ReadState Read(Graphic& rGraphic, GraphicFilterImportFlags nImportFlags, BitmapScopedWriteAccess* ppAccess);
64 
65  bool CreateBitmap(JPEGCreateBitmapParam const & param);
66 
67  Bitmap& GetBitmap() { return *mpBitmap; }
68 };
69 
70 #endif // INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEGREADER_HXX
71 
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< Bitmap > mpBitmap
Definition: JpegReader.hxx:50
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:54
unsigned long X_density
Definition: JpegReader.hxx:41
unsigned long density_unit
Definition: JpegReader.hxx:40
ReadState
Definition: gifread.cxx:43
JPEGReader(SvStream &rStream, GraphicFilterImportFlags nImportFlags)
Definition: JpegReader.cxx:172
std::unique_ptr< Bitmap > mpIncompleteAlpha
Definition: JpegReader.hxx:51
unsigned long nWidth
Definition: JpegReader.hxx:38
SvStream & mrStream
Definition: JpegReader.hxx:49
unsigned long Y_density
Definition: JpegReader.hxx:42
Graphic CreateIntermediateGraphic(long nLines)
Definition: JpegReader.cxx:245
long const mnLastPos
Definition: JpegReader.hxx:53
unsigned long nHeight
Definition: JpegReader.hxx:39
Bitmap & GetBitmap()
Definition: JpegReader.hxx:67
bool const mbSetLogSize
Definition: JpegReader.hxx:55
GraphicFilterImportFlags