aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPixmapPriv.h
blob: 1d677fdc46645e540d35e63000b847713c7ece6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * Copyright 2015 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkPixmapPriv_DEFINED
#define SkPixmapPriv_DEFINED

#include "SkPixmap.h"
#include "SkEncodedOrigin.h"

class SkPixmapPriv {
public:
    // These flag are applied in this order (swap is applied last)
    enum OrientFlags {
        kMirrorX = 1 << 0,
        kMirrorY = 1 << 1,
        kSwapXY  = 1 << 2,
    };

    static OrientFlags OriginToOrient(SkEncodedOrigin);

    /**
     *  Copy the pixels in this pixmap into dst, applying the orientation transformations specified
     *  by the flags. If the inputs are invalid, this returns false and no copy is made.
     */
    static bool Orient(const SkPixmap& dst, const SkPixmap& src, OrientFlags);
};

#endif