#include "src/core/SkDistanceFieldGen.h"
#include "include/core/SkPoint.h"
#include "include/core/SkScalar.h"
#include "include/private/base/SkMalloc.h"
#include "include/private/base/SkTPin.h"
#include "include/private/base/SkTemplates.h"
#include "src/base/SkAutoMalloc.h"
#include "src/core/SkMask.h"
#include "src/core/SkPointPriv.h"
#include <cstdint>
#include <cstring>
#include <utility>
usingnamespaceskia_private;
#if !defined(SK_DISABLE_SDF_TEXT)
struct DFData { … };
enum NeighborFlags { … };
static bool found_edge(const unsigned char* imagePtr, int width, int neighborFlags) { … }
static void init_glyph_data(DFData* data, unsigned char* edges, const unsigned char* image,
int dataWidth, int dataHeight,
int imageWidth, int imageHeight,
int pad) { … }
static float edge_distance(const SkPoint& direction, float alpha) { … }
static void init_distances(DFData* data, unsigned char* edges, int width, int height) { … }
static void F1(DFData* curr, int width) { … }
static void F2(DFData* curr, int width) { … }
static void B1(DFData* curr, int width) { … }
static void B2(DFData* curr, int width) { … }
#define DUMP_EDGE …
#if !DUMP_EDGE
template <int distanceMagnitude>
static unsigned char pack_distance_field_val(float dist) { … }
#endif
static bool generate_distance_field_from_image(unsigned char* distanceField,
const unsigned char* copyPtr,
int width, int height) { … }
bool SkGenerateDistanceFieldFromA8Image(unsigned char* distanceField,
const unsigned char* image,
int width, int height, size_t rowBytes) { … }
bool SkGenerateDistanceFieldFromLCD16Mask(unsigned char* distanceField,
const unsigned char* image,
int w, int h, size_t rowBytes) { … }
bool SkGenerateDistanceFieldFromBWImage(unsigned char* distanceField,
const unsigned char* image,
int width, int height, size_t rowBytes) { … }
#endif