Cleanup: spelling in comments

This commit is contained in:
Campbell Barton 2022-08-19 13:49:13 +10:00
parent 2a15040777
commit 1a3bc09e89
8 changed files with 27 additions and 22 deletions

View File

@ -42,9 +42,11 @@
#include "BLI_strict_flags.h"
#include "BLI_string_utf8.h"
/* Convert glyph converage amounts to lightness values. Uses a LUT that perceptually improves
/**
* Convert glyph coverage amounts to lightness values. Uses a LUT that perceptually improves
* anti-aliasing and results in text that looks a bit fuller and slightly brighter. This should
* be reconsidered in some - or all - cases when we transform the entire UI. */
* be reconsidered in some - or all - cases when we transform the entire UI.
*/
#define BLF_GAMMA_CORRECT_GLYPHS
/* -------------------------------------------------------------------- */
@ -190,19 +192,20 @@ static GlyphBLF *blf_glyph_cache_find_glyph(GlyphCacheBLF *gc, uint charcode)
#ifdef BLF_GAMMA_CORRECT_GLYPHS
/* Gamma correction of glyph converage values with widely-recommended gamma of 1.43.
/**
* Gamma correction of glyph coverage values with widely-recommended gamma of 1.43.
* "The reasons are historical. Because so many programmers have neglected gamma blending for so
* long, people who have created fonts have tried to work around the problem of fonts looking too
* thin by just making the fonts thicker! Obviously it doesnt help the jaggedness, but it does
* thin by just making the fonts thicker! Obviously it doesn't help the jaggedness, but it does
* make them look the proper weight, as originally intended. The obvious problem with this is
* that if we want to gamma blend correctly many older fonts will look wrong. So we compromise,
* and use a lower gamma value, so we get a bit better antialiasing, but the fonts dont look too
* and use a lower gamma value, so we get a bit better anti-aliasing, but the fonts don't look too
* heavy."
* https://www.puredevsoftware.com/blog/2019/01/22/sub-pixel-gamma-correct-font-rendering/
*/
static char blf_glyph_gamma(char c)
{
/* The following is (char)(powf(c / 256.0f, 1.0f / 1.43f) * 256.0f). */
/* The following is `(char)(powf(c / 256.0f, 1.0f / 1.43f) * 256.0f)`. */
static const char gamma[256] = {
0, 5, 9, 11, 14, 16, 19, 21, 23, 25, 26, 28, 30, 32, 34, 35, 37, 38,
40, 41, 43, 44, 46, 47, 49, 50, 52, 53, 54, 56, 57, 58, 60, 61, 62, 64,

View File

@ -26,23 +26,24 @@ class TreeHash {
public:
~TreeHash();
/* create and fill hashtable with treestore elements */
/** Create and fill hash-table with treestore elements */
static std::unique_ptr<TreeHash> create_from_treestore(BLI_mempool &treestore);
/* full rebuild for already allocated hashtable */
/** Full rebuild for already allocated hash-table. */
void rebuild_from_treestore(BLI_mempool &treestore);
/* clear element usage flags */
/** Clear element usage flags. */
void clear_used();
/* Add/remove hashtable elements */
/** Add hash-table element. */
void add_element(TreeStoreElem &elem);
/** Remove hash-table element. */
void remove_element(TreeStoreElem &elem);
/* find first unused element with specific type, nr and id */
/** Find first unused element with specific type, nr and id. */
TreeStoreElem *lookup_unused(short type, short nr, ID *id) const;
/* find user or unused element with specific type, nr and id */
/** Find user or unused element with specific type, nr and id. */
TreeStoreElem *lookup_any(short type, short nr, ID *id) const;
private:

View File

@ -39,9 +39,11 @@ class TseGroup {
/* Only allow reset of #TseGroup.lastused counter to 0 once every 1k search. */
#define TSEGROUP_LASTUSED_RESET_VALUE 10000
/* Allocate structure for TreeStoreElements;
/**
Allocate structure for TreeStoreElements;
* Most of elements in treestore have no duplicates,
* so there is no need to preallocate memory for more than one pointer */
* so there is no need to pre-allocate memory for more than one pointer.
*/
static TseGroup *tse_group_create(void)
{
TseGroup *tse_group = MEM_new<TseGroup>("TseGroup");

View File

@ -3406,9 +3406,8 @@ static size_t animdata_filter_remove_duplis(ListBase *anim_data)
GSet *gs;
size_t items = 0;
/* build new hashtable to efficiently store and retrieve which entries have been
* encountered already while searching
*/
/* Build new hash-table to efficiently store and retrieve which entries have been
* encountered already while searching. */
gs = BLI_gset_ptr_new(__func__);
/* loop through items, removing them from the list if a similar item occurs already */

View File

@ -12,7 +12,7 @@
namespace Freestyle {
/** Class to define a regular grid used for ray casting computations
* We don't use a hashtable here. The grid is explicitly stored for faster computations.
* We don't use a hash-table here. The grid is explicitly stored for faster computations.
* However, this might result in significant increase in memory usage
* (compared to the regular grid).
*/
@ -31,7 +31,7 @@ class FastGrid : public Grid {
/**
* clears the grid
* Deletes all the cells, clears the hashtable, resets size, size of cell, number of cells.
* Deletes all the cells, clears the hash-table, resets size, size of cell, number of cells.
*/
virtual void clear();

View File

@ -187,7 +187,7 @@ class Grid {
}
/** clears the grid
* Deletes all the cells, clears the hashtable, resets size, size of cell, number of cells.
* Deletes all the cells, clears the hash-table, resets size, size of cell, number of cells.
*/
virtual void clear();

View File

@ -52,7 +52,7 @@ class HashGrid : public Grid {
}
/** clears the grid
* Deletes all the cells, clears the hashtable, resets size, size of cell, number of cells.
* Deletes all the cells, clears the hash-table, resets size, size of cell, number of cells.
*/
virtual void clear();

View File

@ -91,7 +91,7 @@ class BokehImageOperation : public NodeOperation {
return *static_cast<NodeBokehImage *>(bnode().storage);
}
/* The exterior angle is the angle between each two consective vertices of the regular polygon
/* The exterior angle is the angle between each two consecutive vertices of the regular polygon
* from its center. */
float get_exterior_angle()
{