nss: upgrade to release 3.73
[LibreOffice.git] / drawinglayer / source / tools / emfpimageattributes.cxx
blob8508172fe6a5e9b00201e33962d492c4005ac7eb
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 #include <sal/log.hxx>
22 #include "emfpimageattributes.hxx"
24 using namespace ::com::sun::star;
25 using namespace ::basegfx;
27 namespace emfplushelper
29 EMFPImageAttributes::EMFPImageAttributes()
30 : EMFPObject()
31 , wrapMode(0)
32 , clampColor(Color())
33 , objectClamp(0)
37 EMFPImageAttributes::~EMFPImageAttributes() {}
39 void EMFPImageAttributes::Read(SvStream& s)
41 sal_uInt32 graphicsVersion, reserved1, reserved2, tempClampColor;
42 sal_uInt8 clampColorBlue, clampColorGreen, clampColorRed, clampColorAlpha;
44 s.ReadUInt32(graphicsVersion)
45 .ReadUInt32(reserved1)
46 .ReadUInt32(wrapMode)
47 .ReadUInt32(tempClampColor)
48 .ReadUInt32(objectClamp)
49 .ReadUInt32(reserved2);
51 clampColorBlue = tempClampColor >> 24;
52 clampColorGreen = (tempClampColor & 0x00FFFFFF) >> 16;
53 clampColorRed = (tempClampColor & 0x0000FFFF) >> 8;
54 clampColorAlpha = tempClampColor & 0x000000FF;
56 clampColor.SetRed(clampColorRed);
57 clampColor.SetGreen(clampColorGreen);
58 clampColor.SetBlue(clampColorBlue);
59 clampColor.SetTransparency(clampColorAlpha);
61 SAL_INFO("drawinglayer", "EMF+\timage attributes");
62 SAL_WARN_IF((reserved1 != 0) || (reserved2 != 0), "drawinglayer",
63 "Reserved field(s) not zero - reserved1: " << std::hex << reserved1
64 << " reserved2: " << reserved2);
65 SAL_WARN_IF((objectClamp != EmpPlusRectClamp) && (objectClamp != EmpPlusBitmapClamp),
66 "drawinglayer", "Invalid object clamp - set to" << std::hex << objectClamp);
67 SAL_INFO("drawinglayer", "EMF+\t image graphics version: 0x"
68 << std::hex << graphicsVersion << " wrap mode: " << wrapMode
69 << " clamp color: " << clampColor
70 << " object clamp: " << objectClamp);
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */