* 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 skdiff_utils_DEFINED
#define skdiff_utils_DEFINED
#include "tools/skdiff/skdiff.h"
class SkBitmap;
class SkData;
class SkString;
* have the same length, and contain exactly the same byte values.
*/
bool are_buffers_equal(SkData* skdata1, SkData* skdata2);
* SkData object (or returns nullptr on error).
*/
sk_sp<SkData> read_file(const char* file_path);
bool get_bitmap(sk_sp<SkData> fileBits, DiffResource& resource, bool sizeOnly,
bool ignoreColorSpace);
bool write_bitmap(const SkString& path, const SkBitmap& bitmap);
* the associated difference image.
*/
SkString filename_to_diff_filename(const SkString& filename);
* the "white" difference image.
*/
SkString filename_to_white_filename(const SkString& filename);
* If !outputDir.isEmpty(), writes out difference and white images.
*/
void create_and_write_diff_image(DiffRecord* drp,
DiffMetricProc dmp,
const int colorThreshold,
const SkString& outputDir,
const SkString& filename);
#endif