aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkGifInterlaceIter.h
blob: 970cd4950f3207e29f1df7f0eec67b6ba7b26274 (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
34
35
/*
 * Copyright 2015 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "SkTypes.h"

/*
 * Helper class to determine the destination y-values for interlaced gifs
 */
class SkGifInterlaceIter : SkNoncopyable {
public:

    explicit SkGifInterlaceIter(int32_t height);

    /*
     * Get the next destination y-value
     */
    int32_t nextY();

private:

    /*
     * Updates the iterator to prepare the next y-value
     */
    void prepareY();

    const int32_t fHeight;
    int32_t        fCurrY;
    int32_t        fDeltaY;
    const uint8_t* fStartYPtr;
    const uint8_t* fDeltaYPtr;
};