Skip to content

Commit

Permalink
Convert ASCII-art tables back to HTML
Browse files Browse the repository at this point in the history
This reverts commit 5984718 and 870f9e5.
  • Loading branch information
kleisauke committed Sep 12, 2024
1 parent ba88fb5 commit 0a699e5
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 29 deletions.
58 changes: 38 additions & 20 deletions libvips/create/buildlut.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,29 +284,47 @@ vips_buildlut_init(VipsBuildlut *lut)
*
* For example, consider this 2 x 2 matrix of (x, y) coordinates:
*
* |[
* |-------|-------|
* | 0 | 0 |
* |-------|-------|
* | 255 | 100 |
* |-------|-------|
* ]|
* <tgroup cols='2' align='left' colsep='1' rowsep='1'>
* <tbody>
* <row>
* <entry>0</entry>
* <entry>0</entry>
* </row>
* <row>
* <entry>255</entry>
* <entry>100</entry>
* </row>
* </tbody>
* </tgroup>
*
* We then generate a 1 x 256 element LUT like this:
*
* |[
* |-------|-------|
* | Index | Value |
* |-------|-------|
* | 0 | 0 |
* |-------|-------|
* | 1 | 0.4 |
* |-------|-------|
* | etc. | 0.4 |
* |-------|-------|
* | 255 | 100 |
* |-------|-------|
* ]|
* <tgroup cols='2' align='left' colsep='1' rowsep='1'>
* <thead>
* <row>
* <entry>Index</entry>
* <entry>Value</entry>
* </row>
* </thead>
* <tbody>
* <row>
* <entry>0</entry>
* <entry>0</entry>
* </row>
* <row>
* <entry>1</entry>
* <entry>0.4</entry>
* </row>
* <row>
* <entry>etc.</entry>
* <entry>0.4</entry>
* </row>
* <row>
* <entry>255</entry>
* <entry>100</entry>
* </row>
* </tbody>
* </tgroup>
*
* This is then written as the output image, with the left column giving the
* index in the image to place the value.
Expand Down
35 changes: 26 additions & 9 deletions libvips/create/invertlut.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,32 @@ vips_invertlut_init(VipsInvertlut *lut)
*
* Eg. input like this:
*
* |[
* |-------|-------|-------|-------|
* | 0.1 | 0.2 | 0.3 | 0.1 |
* |-------|-------|-------|-------|
* | 0.2 | 0.4 | 0.4 | 0.2 |
* |-------|-------|-------|-------|
* | 0.7 | 0.5 | 0.6 | 0.3 |
* |-------|-------|-------|-------|
* ]|
* <tgroup cols='4' align='left' colsep='1' rowsep='1'>
* <tbody>
* <row>
* <entry>4</entry>
* <entry>3</entry>
* </row>
* <row>
* <entry>0.1</entry>
* <entry>0.2</entry>
* <entry>0.3</entry>
* <entry>0.1</entry>
* </row>
* <row>
* <entry>0.2</entry>
* <entry>0.4</entry>
* <entry>0.4</entry>
* <entry>0.2</entry>
* </row>
* <row>
* <entry>0.7</entry>
* <entry>0.5</entry>
* <entry>0.6</entry>
* <entry>0.3</entry>
* </row>
* </tbody>
* </tgroup>
*
* Means a patch with 10% reflectance produces an image with 20% in
* channel 1, 30% in channel 2, and 10% in channel 3, and so on.
Expand Down

0 comments on commit 0a699e5

Please sign in to comment.