Commit Graph

4 Commits

Author SHA1 Message Date
Anuj Verma 45398811c7 [sdf] Added documentation for some structs.
* src/sdf/ftsdfrend.h
      .../ftsdfrend.c
      .../ftsdfcommon.h
      .../ftsdf.h
  : Added documentation for a few structs.
2020-08-05 17:55:02 +05:30
Anuj Verma a62fd640f3 [sdf -> bsdf] Added option to use squared distances.
* src/sdf/ftbsdf.c (bsdf_is_edge): Modified the function
  to use distance map rather than the alpha values from
  the source image.

* src/sdf/ftbsdf.c (bsdf_approximate_edge): Only calculate
  approximate edges for edge pixels. Use `bsdf_is_edge' is
  to check for edge pixels. For non edge pixel assgn far
  away distances.

* src/sdf/ftbsdf.c (finalize_sdf): Handle distances in case
  of squared distances.
  And also use the macro `VECTOR_LENGTH_16D16' in the entire
  code to compute vector length. This takes care of squared
  distances.

* src/sdf/ftsdfcommon.c (VECTOR_LENGTH_16D16): Move the macro
  `VECTOR_LENGTH_16D16' from `ftsdf.c' to this file because
  it is also used by the `bsdf' renderer.
2020-08-02 16:33:21 +05:30
Anuj Verma dcdcc65201 * src/sdf/ftsdfcommon.h (*): Fix line endings.
Always use LF line endings.
2020-08-02 16:33:21 +05:30
Anuj Verma f2553d89b2 [sdf,bsdf] Put common propertied and functions in one file.
* src/sdf/ftsdfcommon.h: Added new file which contains
  common function, macros, properties for both `sdf' and
  `bsdf' renderer.

* src/sdf/ftsdf.c, src/sdf/ftsdf.h, src/sdf/ftbsdf.c:
  Remove common properties and include `ftsdfcommon.h'.

* src/sdf/rules.mk (SDF_DRV_H): Add the new `ftsdfcommon.h'
  file to include list.
2020-08-02 16:33:21 +05:30