1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "ImageMetadata.h"
9 #include "RasterImage.h"
10 #include "nsComponentManagerUtils.h"
11 #include "nsISupportsPrimitives.h"
12 #include "nsXPCOMCID.h"
18 ImageMetadata::SetOnImage(RasterImage
* image
)
20 if (mHotspotX
!= -1 && mHotspotY
!= -1) {
21 nsCOMPtr
<nsISupportsPRUint32
> intwrapx
= do_CreateInstance(NS_SUPPORTS_PRUINT32_CONTRACTID
);
22 nsCOMPtr
<nsISupportsPRUint32
> intwrapy
= do_CreateInstance(NS_SUPPORTS_PRUINT32_CONTRACTID
);
23 intwrapx
->SetData(mHotspotX
);
24 intwrapy
->SetData(mHotspotY
);
25 image
->Set("hotspotX", intwrapx
);
26 image
->Set("hotspotY", intwrapy
);
29 image
->SetLoopCount(mLoopCount
);
33 } // namespace mozilla