sw: lokit: make sure to read annotation html with utf-8
[LibreOffice.git] / include / vcl / bitmap / Vectorizer.hxx
blob225d924233ae894c7ecfba1e50272930e6765fa7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <vcl/dllapi.h>
24 class GDIMetaFile;
25 class BitmapEx;
27 namespace vcl
30 /** Convert the bitmap to a meta file
32 * This works by putting continuous areas of the same color into
33 * polygons painted in this color, by tracing the area's bounding
34 * line.
36 * @param rMetafile
37 * The resulting meta file
40 class VCL_DLLPUBLIC Vectorizer
42 private:
43 /** If not 0, minimal size of bound rects for individual polygons. Smaller ones are ignored. */
44 sal_uInt8 mnReduce = 0;
45 /** A callback for showing the progress of the vectorization */
46 Link<tools::Long, void> const* mpProgress = nullptr;
48 public:
49 Vectorizer(sal_uInt8 nReduce)
50 : mnReduce(nReduce)
53 bool vectorize(BitmapEx const& rBitmap, GDIMetaFile& rMetafile);
55 void setProgressCallback(const Link<tools::Long,void>* pProgress)
57 mpProgress = pProgress;
60 void updateProgress(tools::Long nProgress);
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */