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: #ifndef MOZILLA_IMAGELIB_IMAGEOPS_H_ michael@0: #define MOZILLA_IMAGELIB_IMAGEOPS_H_ michael@0: michael@0: #include "nsCOMPtr.h" michael@0: michael@0: class imgIContainer; michael@0: struct nsIntRect; michael@0: michael@0: namespace mozilla { michael@0: namespace image { michael@0: michael@0: class Image; michael@0: class Orientation; michael@0: michael@0: class ImageOps michael@0: { michael@0: public: michael@0: /** michael@0: * Creates a version of an existing image which does not animate and is frozen michael@0: * at the first frame. michael@0: * michael@0: * @param aImage The existing image. michael@0: */ michael@0: static already_AddRefed Freeze(Image* aImage); michael@0: static already_AddRefed Freeze(imgIContainer* aImage); michael@0: michael@0: /** michael@0: * Creates a clipped version of an existing image. Animation is unaffected. michael@0: * michael@0: * @param aImage The existing image. michael@0: * @param aClip The rectangle to clip the image against. michael@0: */ michael@0: static already_AddRefed Clip(Image* aImage, nsIntRect aClip); michael@0: static already_AddRefed Clip(imgIContainer* aImage, nsIntRect aClip); michael@0: michael@0: /** michael@0: * Creates a version of an existing image which is rotated and/or flipped to michael@0: * the specified orientation. michael@0: * michael@0: * @param aImage The existing image. michael@0: * @param aOrientation The desired orientation. michael@0: */ michael@0: static already_AddRefed Orient(Image* aImage, Orientation aOrientation); michael@0: static already_AddRefed Orient(imgIContainer* aImage, Orientation aOrientation); michael@0: michael@0: private: michael@0: // This is a static utility class, so disallow instantiation. michael@0: virtual ~ImageOps() = 0; michael@0: }; michael@0: michael@0: } // namespace image michael@0: } // namespace mozilla michael@0: michael@0: #endif // MOZILLA_IMAGELIB_IMAGEOPS_H_