image/src/ImageOps.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     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 #ifndef MOZILLA_IMAGELIB_IMAGEOPS_H_
     8 #define MOZILLA_IMAGELIB_IMAGEOPS_H_
    10 #include "nsCOMPtr.h"
    12 class imgIContainer;
    13 struct nsIntRect;
    15 namespace mozilla {
    16 namespace image {
    18 class Image;
    19 class Orientation;
    21 class ImageOps
    22 {
    23 public:
    24   /**
    25    * Creates a version of an existing image which does not animate and is frozen
    26    * at the first frame.
    27    *
    28    * @param aImage         The existing image.
    29    */
    30   static already_AddRefed<Image> Freeze(Image* aImage);
    31   static already_AddRefed<imgIContainer> Freeze(imgIContainer* aImage);
    33   /**
    34    * Creates a clipped version of an existing image. Animation is unaffected.
    35    *
    36    * @param aImage         The existing image.
    37    * @param aClip          The rectangle to clip the image against.
    38    */
    39   static already_AddRefed<Image> Clip(Image* aImage, nsIntRect aClip);
    40   static already_AddRefed<imgIContainer> Clip(imgIContainer* aImage, nsIntRect aClip);
    42   /**
    43    * Creates a version of an existing image which is rotated and/or flipped to
    44    * the specified orientation.
    45    *
    46    * @param aImage         The existing image.
    47    * @param aOrientation   The desired orientation.
    48    */
    49   static already_AddRefed<Image> Orient(Image* aImage, Orientation aOrientation);
    50   static already_AddRefed<imgIContainer> Orient(imgIContainer* aImage, Orientation aOrientation);
    52 private:
    53   // This is a static utility class, so disallow instantiation.
    54   virtual ~ImageOps() = 0;
    55 };
    57 } // namespace image
    58 } // namespace mozilla
    60 #endif // MOZILLA_IMAGELIB_IMAGEOPS_H_

mercurial