1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/core/SkDistanceFieldGen.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,25 @@ 1.4 +/* 1.5 + * Copyright 2014 Google Inc. 1.6 + * 1.7 + * Use of this source code is governed by a BSD-style license that can be 1.8 + * found in the LICENSE file. 1.9 + */ 1.10 +#ifndef SkDistanceFieldGen_DEFINED 1.11 +#define SkDistanceFieldGen_DEFINED 1.12 + 1.13 +/** Given 8-bit mask data, generate the associated distance field 1.14 + 1.15 + * @param distanceField The distance field to be generated. Should already be allocated 1.16 + * by the client with the padding below. 1.17 + * @param image 8-bit mask we're using to generate the distance field. 1.18 + * @param w Width of the image. 1.19 + * @param h Height of the image. 1.20 + * @param distanceMagnitude Largest possible absolute value for the distance. The distance field 1.21 + * will be padded to w + 2*distanceMagnitude, h + 2*distanceMagnitude. 1.22 + */ 1.23 +bool SkGenerateDistanceFieldFromImage(unsigned char* distanceField, 1.24 + const unsigned char* image, 1.25 + int w, int h, 1.26 + int distanceMagnitude); 1.27 + 1.28 +#endif