michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "imgIContainer.h" michael@0: #include "ClippedImage.h" michael@0: #include "FrozenImage.h" michael@0: #include "OrientedImage.h" michael@0: #include "Image.h" michael@0: michael@0: #include "ImageOps.h" michael@0: michael@0: namespace mozilla { michael@0: namespace image { michael@0: michael@0: /* static */ already_AddRefed michael@0: ImageOps::Freeze(Image* aImage) michael@0: { michael@0: nsRefPtr frozenImage = new FrozenImage(aImage); michael@0: return frozenImage.forget(); michael@0: } michael@0: michael@0: /* static */ already_AddRefed michael@0: ImageOps::Freeze(imgIContainer* aImage) michael@0: { michael@0: nsCOMPtr frozenImage = michael@0: new FrozenImage(static_cast(aImage)); michael@0: return frozenImage.forget(); michael@0: } michael@0: michael@0: /* static */ already_AddRefed michael@0: ImageOps::Clip(Image* aImage, nsIntRect aClip) michael@0: { michael@0: nsRefPtr clippedImage = new ClippedImage(aImage, aClip); michael@0: return clippedImage.forget(); michael@0: } michael@0: michael@0: /* static */ already_AddRefed michael@0: ImageOps::Clip(imgIContainer* aImage, nsIntRect aClip) michael@0: { michael@0: nsCOMPtr clippedImage = michael@0: new ClippedImage(static_cast(aImage), aClip); michael@0: return clippedImage.forget(); michael@0: } michael@0: michael@0: /* static */ already_AddRefed michael@0: ImageOps::Orient(Image* aImage, Orientation aOrientation) michael@0: { michael@0: nsRefPtr orientedImage = new OrientedImage(aImage, aOrientation); michael@0: return orientedImage.forget(); michael@0: } michael@0: michael@0: /* static */ already_AddRefed michael@0: ImageOps::Orient(imgIContainer* aImage, Orientation aOrientation) michael@0: { michael@0: nsCOMPtr orientedImage = michael@0: new OrientedImage(static_cast(aImage), aOrientation); michael@0: return orientedImage.forget(); michael@0: } michael@0: michael@0: } // namespace image michael@0: } // namespace mozilla