blob: 63ac726c2eba69e48fa96a522cbf38f77e59d02a (
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
36
37
|
/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkBitmapChecksummer_DEFINED
#define SkBitmapChecksummer_DEFINED
#include "SkBitmap.h"
#include "SkBitmapTransformer.h"
/**
* Static class that can generate checksums from SkBitmaps.
*/
class SkBitmapChecksummer {
public:
/**
* Returns a 64-bit checksum of the pixels in this bitmap.
*
* If this is unable to compute the checksum for some reason,
* it returns 0.
*
* Note: depending on the bitmap config, we may need to create an
* intermediate SkBitmap and copy the pixels over to it... so in some
* cases, performance and memory usage can suffer.
*/
static uint64_t Compute64(const SkBitmap& bitmap);
private:
static uint64_t Compute64Internal(const SkBitmap& bitmap,
const SkBitmapTransformer& transformer);
};
#endif
|