1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef __com_sun_star_drawing_XSlideRenderer_idl__
21 #define __com_sun_star_drawing_XSlideRenderer_idl__
23 #include
<com
/sun
/star
/awt
/XBitmap.idl
>
24 #include
<com
/sun
/star
/drawing
/XDrawPage.idl
>
25 #include
<com
/sun
/star
/rendering
/XBitmap.idl
>
26 #include
<com
/sun
/star
/rendering
/XSpriteCanvas.idl
>
29 module com
{ module sun
{ module star
{ module drawing
{
31 /** Create preview bitmaps for single slides.
33 interface XSlideRenderer
35 /** Create a preview for the given slide that has the same aspect ratio
36 as the page and is as large as possible but not larger than the
39 The reason for not using the given size directly as preview size and
40 thus possibly changing the aspect ratio is that
41 a) a different aspect ratio is not used often, and
42 b) leaving the adaption of the actual preview size (according to the
43 aspect ratio of the slide) to the slide renderer is more convenient
44 to the caller than having to this himself.
47 The slide for which a preview will be created.
48 @param aMaximumPreviewPixelSize
49 The maximum size of the preview measured in pixels. When the
50 aspect ratios of this size and of the given slide differ, then
51 resulting preview will either have the width or the height of
53 @param nSuperSampleFactor
54 When larger than the default 1 then internally a larger preview
55 is created which, before it is returned, is scaled down to the
56 requested size. The intermediate size is nSuperSampleFactor
57 times the original size. Values larger than 1 result in higher
58 memory consumption and longer runtime.
59 This value is an attempt to provide some antialiasing and so to
60 provide more readable slide previews. May become obsolete in
61 the future when true antialiasing support will be integrated.
63 com
::sun
::star
::awt
::XBitmap createPreview
(
64 [in] XDrawPage xSlide
,
65 [in] com
::sun
::star
::awt
::Size aMaximumPreviewPixelSize
,
66 [in] short nSuperSampleFactor
);
68 /** Exactly the same functionality as createPreview(),
69 only a different return type:
70 com::sun::star::rendering::XBitmap instead
71 of com::sun::star::awt::XBitmap.
74 See description in #createPreview.
75 @param aMaximumPreviewPixelSize
76 See description in #createPreview.
77 @param nSuperSampleFactor
78 See description in #createPreview.
80 This canvas is used create a canvas specific bitmap.
82 com
::sun
::star
::rendering
::XBitmap createPreviewForCanvas
(
83 [in] XDrawPage xSlide
,
84 [in] com
::sun
::star
::awt
::Size aMaximumPreviewPixelSize
,
85 [in] short nSuperSampleFactor
,
86 [in] com
::sun
::star
::rendering
::XCanvas xCanvas
);
88 /** Return a size that has the given aspect ratio and shares either the
89 width or the height with the given maximum size.
90 @param nSlideAspectRatio
91 The aspect ratio must not be 0.
92 @param aMaximumPreviewPixelSize
93 The maximum size of the returned preview size.
95 com
::sun
::star
::awt
::Size calculatePreviewSize
(
96 [in] double nSlideAspectRatio
,
97 [in] com
::sun
::star
::awt
::Size aMaximumPreviewPixelSize
);
100 }; }; }; }; // ::com::sun::star::drawing
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */