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_JPEG_H 21 #define INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEG_H 22 23 #include <sal/config.h> 24 25 #include <com/sun/star/uno/Reference.hxx> 26 #include <basegfx/vector/b2dsize.hxx> 27 #include <bitmap/BitmapWriteAccess.hxx> 28 29 #include <jpeglib.h> 30 31 namespace com::sun::star::task { 32 class XStatusIndicator; 33 } 34 class JPEGReader; 35 class JPEGWriter; 36 class Size; 37 class SvStream; 38 enum class GraphicFilterImportFlags; 39 40 void jpeg_svstream_src (j_decompress_ptr cinfo, void* infile); 41 42 void jpeg_svstream_dest (j_compress_ptr cinfo, void* outfile); 43 44 bool WriteJPEG( JPEGWriter* pJPEGWriter, void* pOutputStream, 45 tools::Long nWidth, tools::Long nHeight, basegfx::B2DSize const & aPPI, bool bGreyScale, 46 tools::Long nQualityPercent, tools::Long aChromaSubsampling, 47 css::uno::Reference<css::task::XStatusIndicator> const & status); 48 49 void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, tools::Long* pLines, 50 GraphicFilterImportFlags nImportFlags, 51 BitmapScopedWriteAccess* ppAccess ); 52 53 void Transform(void* pInputStream, void* pOutputStream, Degree10 nAngle); 54 55 /* Expanded data source object for stdio input */ 56 57 struct SourceManagerStruct { 58 jpeg_source_mgr pub; /* public fields */ 59 SvStream* stream; /* source stream */ 60 JOCTET* buffer; /* start of buffer */ 61 boolean start_of_file; /* have we gotten any data yet? */ 62 int no_data_available_failures; 63 }; 64 65 #endif 66 67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 68