Flutter Engine
The Flutter Engine
|
#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>
Go to the source code of this file.
Classes | |
struct | DFData |
Macros | |
#define | DUMP_EDGE 0 |
Enumerations | |
enum | NeighborFlags { kLeft_NeighborFlag = 0x01 , kRight_NeighborFlag = 0x02 , kTopLeft_NeighborFlag = 0x04 , kTop_NeighborFlag = 0x08 , kTopRight_NeighborFlag = 0x10 , kBottomLeft_NeighborFlag = 0x20 , kBottom_NeighborFlag = 0x40 , kBottomRight_NeighborFlag = 0x80 , kAll_NeighborFlags = 0xff , kNeighborFlagCount = 8 } |
Functions | |
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) |
template<int distanceMagnitude> | |
static unsigned char | pack_distance_field_val (float dist) |
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) |
#define DUMP_EDGE 0 |
Definition at line 332 of file SkDistanceFieldGen.cpp.
enum NeighborFlags |
Definition at line 33 of file SkDistanceFieldGen.cpp.
Definition at line 273 of file SkDistanceFieldGen.cpp.
Definition at line 287 of file SkDistanceFieldGen.cpp.
|
static |
Definition at line 125 of file SkDistanceFieldGen.cpp.
Definition at line 213 of file SkDistanceFieldGen.cpp.
Definition at line 259 of file SkDistanceFieldGen.cpp.
Definition at line 51 of file SkDistanceFieldGen.cpp.
|
static |
Definition at line 354 of file SkDistanceFieldGen.cpp.
Definition at line 165 of file SkDistanceFieldGen.cpp.
|
static |
Definition at line 82 of file SkDistanceFieldGen.cpp.
|
static |
Definition at line 336 of file SkDistanceFieldGen.cpp.
bool SkGenerateDistanceFieldFromA8Image | ( | unsigned char * | distanceField, |
const unsigned char * | image, | ||
int | w, | ||
int | h, | ||
size_t | rowBytes | ||
) |
Given 8-bit mask data, generate the associated distance field
distanceField | The distance field to be generated. Should already be allocated by the client with the padding above. |
image | 8-bit mask we're using to generate the distance field. |
w | Width of the original image. |
h | Height of the original image. |
rowBytes | Size of each row in the image, in bytes |
Definition at line 479 of file SkDistanceFieldGen.cpp.
bool SkGenerateDistanceFieldFromBWImage | ( | unsigned char * | distanceField, |
const unsigned char * | image, | ||
int | w, | ||
int | h, | ||
size_t | rowBytes | ||
) |
Given 1-bit mask data, generate the associated distance field
distanceField | The distance field to be generated. Should already be allocated by the client with the padding above. |
image | 1-bit mask we're using to generate the distance field. |
w | Width of the original image. |
h | Height of the original image. |
rowBytes | Size of each row in the image, in bytes |
Definition at line 537 of file SkDistanceFieldGen.cpp.
bool SkGenerateDistanceFieldFromLCD16Mask | ( | unsigned char * | distanceField, |
const unsigned char * | image, | ||
int | w, | ||
int | h, | ||
size_t | rowBytes | ||
) |
Given LCD16 mask data (not a 16-bit image), generate the associated distance field
distanceField | The distance field to be generated. Should already be allocated by the client with the padding above. |
image | 16-bit LCD data we're using to generate the distance field. |
w | Width of the original image. |
h | Height of the original image. |
rowBytes | Size of each row in the image, in bytes |
Definition at line 507 of file SkDistanceFieldGen.cpp.