LibreOffice Module drawinglayer (master) 1
emfpimageattributes.cxx
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#include <sal/log.hxx>
21
23
24using namespace ::com::sun::star;
25using namespace ::basegfx;
26
27namespace emfplushelper
28{
30 : EMFPObject()
31 , wrapMode(0)
32 , objectClamp(0)
33{
34}
35
37
39{
40 sal_uInt32 graphicsVersion, reserved1, reserved2, tempClampColor;
41 sal_uInt8 clampColorBlue, clampColorGreen, clampColorRed, clampColorAlpha;
42
43 s.ReadUInt32(graphicsVersion)
44 .ReadUInt32(reserved1)
46 .ReadUInt32(tempClampColor)
48 .ReadUInt32(reserved2);
49
50 clampColorBlue = tempClampColor >> 24;
51 clampColorGreen = (tempClampColor & 0x00FFFFFF) >> 16;
52 clampColorRed = (tempClampColor & 0x0000FFFF) >> 8;
53 clampColorAlpha = tempClampColor & 0x000000FF;
54
55 clampColor.SetRed(clampColorRed);
56 clampColor.SetGreen(clampColorGreen);
57 clampColor.SetBlue(clampColorBlue);
58 clampColor.SetAlpha(255 - clampColorAlpha);
59
60 SAL_INFO("drawinglayer.emf", "EMF+\timage attributes");
61 SAL_WARN_IF((reserved1 != 0) || (reserved2 != 0), "drawinglayer.emf",
62 "Reserved field(s) not zero - reserved1: " << std::hex << reserved1
63 << " reserved2: " << reserved2);
65 "drawinglayer.emf", "Invalid object clamp - set to" << std::hex << objectClamp);
66 SAL_INFO("drawinglayer.emf", "EMF+\t image graphics version: 0x"
67 << std::hex << graphicsVersion << " wrap mode: " << wrapMode
68 << " clamp color: " << clampColor
69 << " object clamp: " << objectClamp);
70}
71}
72
73/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetGreen(sal_uInt8 nGreen)
void SetRed(sal_uInt8 nRed)
void SetAlpha(sal_uInt8 nAlpha)
void SetBlue(sal_uInt8 nBlue)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
const sal_uInt32 EmpPlusRectClamp
const sal_uInt32 EmpPlusBitmapClamp
unsigned char sal_uInt8