2011-07-28 14:26:00 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
/*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Copyright 2006 The Android Open Source Project
|
2008-12-17 15:59:43 +00:00
|
|
|
*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
2008-12-17 15:59:43 +00:00
|
|
|
*/
|
|
|
|
|
2011-07-28 14:26:00 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
#ifndef SkUnitMapper_DEFINED
|
|
|
|
#define SkUnitMapper_DEFINED
|
|
|
|
|
|
|
|
#include "SkRefCnt.h"
|
|
|
|
#include "SkScalar.h"
|
|
|
|
|
|
|
|
#include "SkFlattenable.h"
|
|
|
|
|
|
|
|
class SkUnitMapper : public SkFlattenable {
|
|
|
|
public:
|
2012-06-27 14:03:26 +00:00
|
|
|
SK_DECLARE_INST_COUNT(SkUnitMapper)
|
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
SkUnitMapper() {}
|
|
|
|
|
|
|
|
/** Given a value in [0..0xFFFF], return a value in the same range.
|
|
|
|
*/
|
|
|
|
virtual uint16_t mapUnit16(uint16_t x) = 0;
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
protected:
|
|
|
|
SkUnitMapper(SkFlattenableReadBuffer& rb) : SkFlattenable(rb) {}
|
2012-06-27 14:03:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef SkFlattenable INHERITED;
|
2008-12-17 15:59:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|