Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for libvips 8.15.5 #110

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ repositories {
}

dependencies {
implementation("app.photofox.vips-ffm:vips-ffm-core:1.2.0")
implementation("app.photofox.vips-ffm:vips-ffm-core:1.2.1")
}
```
When running your project you must add `--enable-native-access=ALL-UNNAMED` to your JVM runtime arguments. If you
don't, you'll get a warning about "Restricted methods". In the future, the JVM will throw an error if you don't
explicitly include this flag.

As the project uses the Java FFM API, it must target JDK 22+. Bindings are currently generated from libvips `8.15.3`,
As the project uses the Java FFM API, it must target JDK 22+. Bindings are currently generated from libvips `8.15.5`,
however they use the underlying libvips operation API. Most operations **do not** use the C API directly (as described
in the [bindings docs](https://www.libvips.org/API/current/binding.html)) - they should be safe to use with different
libvips versions, assuming there haven't been major changes.
Expand Down Expand Up @@ -116,14 +116,14 @@ To get set up to run samples (on macOS):
```
[main] INFO vipsffm.SampleRunner - clearing sample run directory at path "sample_run"
[main] INFO vipsffm.SampleRunner - running sample "RawGetVersionSample"...
[main] INFO vipsffm.RawGetVersionSample - libvips version: "8.15.3"
[main] INFO vipsffm.sample.RawGetVersionSample - libvips version: "8.15.5"
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - running sample "HelperGetVersionSample"...
[main] INFO vipsffm.HelperGetVersionSample - libvips version: "8.15.3"
[main] INFO vipsffm.sample.HelperGetVersionSample - libvips version: "8.15.5"
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - running sample "VImageCreateThumbnailSample"...
[main] INFO vipsffm.RawGetVersionSample - source image size: 2490 x 3084
[main] INFO vipsffm.RawGetVersionSample - thumbnail image size: 323 x 400
[main] INFO vipsffm.sample.VImageCreateThumbnailSample - source image size: 2490 x 3084
[main] INFO vipsffm.sample.VImageCreateThumbnailSample - thumbnail image size: 323 x 400
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - running sample "VImageChainSample"...
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
Expand All @@ -135,8 +135,22 @@ To get set up to run samples (on macOS):
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - running sample "VImageCachingSample"...
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - running sample "VImageBlobSample"...
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - running sample "VImageArrayJoinSample"...
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - running sample "VBlobByteBufferSample"...
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - running sample "VTargetToFileSample"...
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - running sample "VImageJoinSample"...
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - running sample "VImageFromBytesSample"...
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - running sample "VImageStreamSample"...
[main] INFO vipsffm.SampleRunner - validation succeeded ✅
[main] INFO vipsffm.SampleRunner - shutting down vips to check for memory leaks...
memory: high-water mark 128.35 MB
memory: high-water mark 151.24 MB
[main] INFO vipsffm.SampleRunner - all samples ran successfully 🎉
```

Expand Down
107 changes: 71 additions & 36 deletions core/src/main/java/app/photofox/vipsffm/VImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -983,31 +983,49 @@ public VImage booleanConst(VipsOperationBoolean boolean1, List<Double> c, VipsOp
* always of type {@link VipsBandFormat#FORMAT_DOUBLE}, use {@link VImage#cast} to change it to the
* type you need.</p>
*
* <p>For example, consider this 2 x 2 matrix of (x, y) coordinates:</p>
*
* <pre>{@code
* |-------|-------|
* | 0 | 0 |
* |-------|-------|
* | 255 | 100 |
* |-------|-------|
* }</pre>
*
* <p>We then generate a 1 x 256 element LUT like this:</p>
*
* <pre>{@code
* |-------|-------|
* | Index | Value |
* |-------|-------|
* | 0 | 0 |
* |-------|-------|
* | 1 | 0.4 |
* |-------|-------|
* | etc. | 0.4 |
* |-------|-------|
* | 255 | 100 |
* |-------|-------|
* }</pre>
* <p>For example, consider this 2 x 2 matrix of (x, y) coordinates:
*
* &lt;tgroup cols='2' align='left' colsep='1' rowsep='1'&gt;
* &lt;tbody&gt;
* &lt;row&gt;
* &lt;entry&gt;0&lt;/entry&gt;
* &lt;entry&gt;0&lt;/entry&gt;
* &lt;/row&gt;
* &lt;row&gt;
* &lt;entry&gt;255&lt;/entry&gt;
* &lt;entry&gt;100&lt;/entry&gt;
* &lt;/row&gt;
* &lt;/tbody&gt;
* &lt;/tgroup&gt;</p>
*
* <p>We then generate a 1 x 256 element LUT like this:
*
* &lt;tgroup cols='2' align='left' colsep='1' rowsep='1'&gt;
* &lt;thead&gt;
* &lt;row&gt;
* &lt;entry&gt;Index&lt;/entry&gt;
* &lt;entry&gt;Value&lt;/entry&gt;
* &lt;/row&gt;
* &lt;/thead&gt;
* &lt;tbody&gt;
* &lt;row&gt;
* &lt;entry&gt;0&lt;/entry&gt;
* &lt;entry&gt;0&lt;/entry&gt;
* &lt;/row&gt;
* &lt;row&gt;
* &lt;entry&gt;1&lt;/entry&gt;
* &lt;entry&gt;0.4&lt;/entry&gt;
* &lt;/row&gt;
* &lt;row&gt;
* &lt;entry&gt;etc.&lt;/entry&gt;
* &lt;entry&gt;0.4&lt;/entry&gt;
* &lt;/row&gt;
* &lt;row&gt;
* &lt;entry&gt;255&lt;/entry&gt;
* &lt;entry&gt;100&lt;/entry&gt;
* &lt;/row&gt;
* &lt;/tbody&gt;
* &lt;/tgroup&gt;</p>
*
* <p>This is then written as the output image, with the left column giving the
* index in the image to place the value.</p>
Expand Down Expand Up @@ -4084,17 +4102,34 @@ public VImage invert(VipsOption... args) throws VipsError {
* measurements of a colour chart. All values in [0,1]. Piecewise linear
* interpolation, extrapolate head and tail to 0 and 1.</p>
*
* <p>Eg. input like this:</p>
*
* <pre>{@code
* |-------|-------|-------|-------|
* | 0.1 | 0.2 | 0.3 | 0.1 |
* |-------|-------|-------|-------|
* | 0.2 | 0.4 | 0.4 | 0.2 |
* |-------|-------|-------|-------|
* | 0.7 | 0.5 | 0.6 | 0.3 |
* |-------|-------|-------|-------|
* }</pre>
* <p>Eg. input like this:
*
* &lt;tgroup cols='4' align='left' colsep='1' rowsep='1'&gt;
* &lt;tbody&gt;
* &lt;row&gt;
* &lt;entry&gt;4&lt;/entry&gt;
* &lt;entry&gt;3&lt;/entry&gt;
* &lt;/row&gt;
* &lt;row&gt;
* &lt;entry&gt;0.1&lt;/entry&gt;
* &lt;entry&gt;0.2&lt;/entry&gt;
* &lt;entry&gt;0.3&lt;/entry&gt;
* &lt;entry&gt;0.1&lt;/entry&gt;
* &lt;/row&gt;
* &lt;row&gt;
* &lt;entry&gt;0.2&lt;/entry&gt;
* &lt;entry&gt;0.4&lt;/entry&gt;
* &lt;entry&gt;0.4&lt;/entry&gt;
* &lt;entry&gt;0.2&lt;/entry&gt;
* &lt;/row&gt;
* &lt;row&gt;
* &lt;entry&gt;0.7&lt;/entry&gt;
* &lt;entry&gt;0.5&lt;/entry&gt;
* &lt;entry&gt;0.6&lt;/entry&gt;
* &lt;entry&gt;0.3&lt;/entry&gt;
* &lt;/row&gt;
* &lt;/tbody&gt;
* &lt;/tgroup&gt;</p>
*
* <p>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.</p>
Expand Down
16 changes: 8 additions & 8 deletions core/src/main/java/app/photofox/vipsffm/jextract/VipsRaw.java
Original file line number Diff line number Diff line change
Expand Up @@ -12242,25 +12242,25 @@ public static int VIPS_SBUF_BUFFER_SIZE() {
}
/**
* {@snippet lang=c :
* #define VIPS_VERSION "8.15.3"
* #define VIPS_VERSION "8.15.5"
* }
*/
public static MemorySegment VIPS_VERSION() {
class Holder {
static final MemorySegment VIPS_VERSION
= VipsRaw.LIBRARY_ARENA.allocateFrom("8.15.3");
= VipsRaw.LIBRARY_ARENA.allocateFrom("8.15.5");
}
return Holder.VIPS_VERSION;
}
/**
* {@snippet lang=c :
* #define VIPS_VERSION_STRING "8.15.3"
* #define VIPS_VERSION_STRING "8.15.5"
* }
*/
public static MemorySegment VIPS_VERSION_STRING() {
class Holder {
static final MemorySegment VIPS_VERSION_STRING
= VipsRaw.LIBRARY_ARENA.allocateFrom("8.15.3");
= VipsRaw.LIBRARY_ARENA.allocateFrom("8.15.5");
}
return Holder.VIPS_VERSION_STRING;
}
Expand All @@ -12282,10 +12282,10 @@ public static int VIPS_MAJOR_VERSION() {
public static int VIPS_MINOR_VERSION() {
return VIPS_MINOR_VERSION;
}
private static final int VIPS_MICRO_VERSION = (int)3L;
private static final int VIPS_MICRO_VERSION = (int)5L;
/**
* {@snippet lang=c :
* #define VIPS_MICRO_VERSION 3
* #define VIPS_MICRO_VERSION 5
* }
*/
public static int VIPS_MICRO_VERSION() {
Expand All @@ -12300,10 +12300,10 @@ public static int VIPS_MICRO_VERSION() {
public static int VIPS_LIBRARY_CURRENT() {
return VIPS_LIBRARY_CURRENT;
}
private static final int VIPS_LIBRARY_REVISION = (int)3L;
private static final int VIPS_LIBRARY_REVISION = (int)5L;
/**
* {@snippet lang=c :
* #define VIPS_LIBRARY_REVISION 3
* #define VIPS_LIBRARY_REVISION 5
* }
*/
public static int VIPS_LIBRARY_REVISION() {
Expand Down
99 changes: 67 additions & 32 deletions docs/app.photofox.vipsffm/app/photofox/vipsffm/VImage.html
Original file line number Diff line number Diff line change
Expand Up @@ -3563,31 +3563,49 @@ <h3>buildlut</h3>
always of type <a href="enums/VipsBandFormat.html#FORMAT_DOUBLE"><code>VipsBandFormat.FORMAT_DOUBLE</code></a>, use <a href="#cast(app.photofox.vipsffm.enums.VipsBandFormat,app.photofox.vipsffm.VipsOption...)"><code>cast(app.photofox.vipsffm.enums.VipsBandFormat, app.photofox.vipsffm.VipsOption...)</code></a> to change it to the
type you need.</p>

<p>For example, consider this 2 x 2 matrix of (x, y) coordinates:</p>
<p>For example, consider this 2 x 2 matrix of (x, y) coordinates:

<pre><code>
|-------|-------|
| 0 | 0 |
|-------|-------|
| 255 | 100 |
|-------|-------|
</code></pre>
&lt;tgroup cols='2' align='left' colsep='1' rowsep='1'&gt;
&lt;tbody&gt;
&lt;row&gt;
&lt;entry&gt;0&lt;/entry&gt;
&lt;entry&gt;0&lt;/entry&gt;
&lt;/row&gt;
&lt;row&gt;
&lt;entry&gt;255&lt;/entry&gt;
&lt;entry&gt;100&lt;/entry&gt;
&lt;/row&gt;
&lt;/tbody&gt;
&lt;/tgroup&gt;</p>

<p>We then generate a 1 x 256 element LUT like this:</p>
<p>We then generate a 1 x 256 element LUT like this:

<pre><code>
|-------|-------|
| Index | Value |
|-------|-------|
| 0 | 0 |
|-------|-------|
| 1 | 0.4 |
|-------|-------|
| etc. | 0.4 |
|-------|-------|
| 255 | 100 |
|-------|-------|
</code></pre>
&lt;tgroup cols='2' align='left' colsep='1' rowsep='1'&gt;
&lt;thead&gt;
&lt;row&gt;
&lt;entry&gt;Index&lt;/entry&gt;
&lt;entry&gt;Value&lt;/entry&gt;
&lt;/row&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;row&gt;
&lt;entry&gt;0&lt;/entry&gt;
&lt;entry&gt;0&lt;/entry&gt;
&lt;/row&gt;
&lt;row&gt;
&lt;entry&gt;1&lt;/entry&gt;
&lt;entry&gt;0.4&lt;/entry&gt;
&lt;/row&gt;
&lt;row&gt;
&lt;entry&gt;etc.&lt;/entry&gt;
&lt;entry&gt;0.4&lt;/entry&gt;
&lt;/row&gt;
&lt;row&gt;
&lt;entry&gt;255&lt;/entry&gt;
&lt;entry&gt;100&lt;/entry&gt;
&lt;/row&gt;
&lt;/tbody&gt;
&lt;/tgroup&gt;</p>

<p>This is then written as the output image, with the left column giving the
index in the image to place the value.</p>
Expand Down Expand Up @@ -6556,17 +6574,34 @@ <h3>invertlut</h3>
measurements of a colour chart. All values in [0,1]. Piecewise linear
interpolation, extrapolate head and tail to 0 and 1.</p>

<p>Eg. input like this:</p>
<p>Eg. input like this:

<pre><code>
|-------|-------|-------|-------|
| 0.1 | 0.2 | 0.3 | 0.1 |
|-------|-------|-------|-------|
| 0.2 | 0.4 | 0.4 | 0.2 |
|-------|-------|-------|-------|
| 0.7 | 0.5 | 0.6 | 0.3 |
|-------|-------|-------|-------|
</code></pre>
&lt;tgroup cols='4' align='left' colsep='1' rowsep='1'&gt;
&lt;tbody&gt;
&lt;row&gt;
&lt;entry&gt;4&lt;/entry&gt;
&lt;entry&gt;3&lt;/entry&gt;
&lt;/row&gt;
&lt;row&gt;
&lt;entry&gt;0.1&lt;/entry&gt;
&lt;entry&gt;0.2&lt;/entry&gt;
&lt;entry&gt;0.3&lt;/entry&gt;
&lt;entry&gt;0.1&lt;/entry&gt;
&lt;/row&gt;
&lt;row&gt;
&lt;entry&gt;0.2&lt;/entry&gt;
&lt;entry&gt;0.4&lt;/entry&gt;
&lt;entry&gt;0.4&lt;/entry&gt;
&lt;entry&gt;0.2&lt;/entry&gt;
&lt;/row&gt;
&lt;row&gt;
&lt;entry&gt;0.7&lt;/entry&gt;
&lt;entry&gt;0.5&lt;/entry&gt;
&lt;entry&gt;0.6&lt;/entry&gt;
&lt;entry&gt;0.3&lt;/entry&gt;
&lt;/row&gt;
&lt;/tbody&gt;
&lt;/tgroup&gt;</p>

<p>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.</p>
Expand Down
Loading