* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkIPoint16_DEFINED
#define SkIPoint16_DEFINED
#include "include/core/SkTypes.h"
#include "include/private/SkTo.h"
SkIPoint16 holds two 16 bit integer coordinates.
*/
struct SkIPoint16 {
int16_t fX;
int16_t fY;
if x or y does not fit in 16 bits.
@param x integer x-axis value of constructed SkIPoint
@param y integer y-axis value of constructed SkIPoint
@return SkIPoint16 (x, y)
*/
static constexpr SkIPoint16 Make(int x, int y) {
return {SkToS16(x), SkToS16(y)};
}
@return fX
*/
int16_t x() const { return fX; }
@return fY
*/
int16_t y() const { return fY; }
@param x new value for fX
@param y new value for fY
*/
void set(int x, int y) {
fX = SkToS16(x);
fY = SkToS16(y);
}
};
#endif