Skip to content

Commit

Permalink
Merge branch 'master' into simd-highway
Browse files Browse the repository at this point in the history
  • Loading branch information
kleisauke committed Sep 22, 2023
2 parents 7243040 + 0789614 commit 4876673
Show file tree
Hide file tree
Showing 69 changed files with 2,519 additions and 1,738 deletions.
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,15 @@ $ git commit --amend -a
```

in order to update the last commit with all pending changes.

In an emergency, reformat the entire project with something like:

```shell
find . \
\( -name "*.[hc]" -o -name "*.cc" -o -name "*.cpp" \) \
-not \( -path "./libvips/foreign/libnsgif/*" -o \
-name vips-operators.cpp -o \
-name StandaloneFuzzTargetMain.c -o \
-name profiles.c \) | \
xargs clang-format -i
```
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@
- swap built-in profiles with ICC v4 variants [kleisauke]
- remove libgsf dependency in favor of libarchive [kleisauke]
- better chunking for small shrinks [jcupitt]
- use alpha range of 0.0 - 1.0 for scRGB images [DarthSim]
- add support for 16-bit float TIFFs [DarthSim]
- add direct mode to dzsave [jcupitt]
- require C++11 as a minimum standard [kleisauke]
- add support for SIMD via Highway [kleisauke]

18/9/23 8.14.5

- fix a crash with alpha plus icc_import and icc_export [jcupitt]
- fix a crash in jxlsave [jcupitt]

15/8/23 8.14.4

- fix null-pointer dereference during svgload [kleisauke]
Expand Down
2 changes: 1 addition & 1 deletion cplusplus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ C convenience function `vips_sin()`:

and a C++ member function `VImage::sin()`:

VImage VImage::sin (VOption *options = 0) const
VImage VImage::sin (VOption *options = nullptr) const

### Image metadata

Expand Down
20 changes: 10 additions & 10 deletions cplusplus/VImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ VOption::set(const char *name, std::vector<int> value)
pair->input = true;

g_value_init(&pair->value, VIPS_TYPE_ARRAY_INT);
vips_value_set_array_int(&pair->value, NULL,
vips_value_set_array_int(&pair->value, nullptr,
static_cast<int>(value.size()));
array = vips_value_get_array_int(&pair->value, NULL);
array = vips_value_get_array_int(&pair->value, nullptr);

for (std::vector<double>::size_type i = 0; i < value.size(); i++)
array[i] = value[i];
Expand All @@ -236,9 +236,9 @@ VOption::set(const char *name, std::vector<double> value)
pair->input = true;

g_value_init(&pair->value, VIPS_TYPE_ARRAY_DOUBLE);
vips_value_set_array_double(&pair->value, NULL,
vips_value_set_array_double(&pair->value, nullptr,
static_cast<int>(value.size()));
array = vips_value_get_array_double(&pair->value, NULL);
array = vips_value_get_array_double(&pair->value, nullptr);

for (std::vector<double>::size_type i = 0; i < value.size(); i++)
array[i] = value[i];
Expand All @@ -261,7 +261,7 @@ VOption::set(const char *name, std::vector<VImage> value)
g_value_init(&pair->value, VIPS_TYPE_ARRAY_IMAGE);
vips_value_set_array_image(&pair->value,
static_cast<int>(value.size()));
array = vips_value_get_array_image(&pair->value, NULL);
array = vips_value_get_array_image(&pair->value, nullptr);

for (std::vector<double>::size_type i = 0; i < value.size(); i++) {
VipsImage *vips_image = value[i].get_image();
Expand Down Expand Up @@ -554,7 +554,7 @@ VImage::call_option_string(const char *operation_name,
void
VImage::call(const char *operation_name, VOption *options)
{
call_option_string(operation_name, NULL, options);
call_option_string(operation_name, nullptr, options);
}

VImage
Expand Down Expand Up @@ -595,7 +595,7 @@ VImage::new_from_buffer(const void *buf, size_t len, const char *option_string,

/* We don't take a copy of the data or free it.
*/
blob = vips_blob_new(NULL, buf, len);
blob = vips_blob_new(nullptr, buf, len);
options = (options ? options : VImage::option())
->set("buffer", blob)
->set("out", &out);
Expand Down Expand Up @@ -732,7 +732,7 @@ VImage::write_to_buffer(const char *suffix, void **buf, size_t *size,
->set("in", *this)
->set("target", target));

g_object_get(target.get_target(), "blob", &blob, (void *) NULL);
g_object_get(target.get_target(), "blob", &blob, nullptr);
}
else if ((operation_name = vips_foreign_find_save_buffer(filename))) {
call_option_string(operation_name, option_string,
Expand All @@ -748,7 +748,7 @@ VImage::write_to_buffer(const char *suffix, void **buf, size_t *size,
if (blob) {
if (buf) {
*buf = VIPS_AREA(blob)->data;
VIPS_AREA(blob)->free_fn = NULL;
VIPS_AREA(blob)->free_fn = nullptr;
}
if (size)
*size = VIPS_AREA(blob)->length;
Expand Down Expand Up @@ -785,7 +785,7 @@ VImage::thumbnail_buffer(void *buf, size_t len, int width, VOption *options)

/* We don't take a copy of the data or free it.
*/
blob = vips_blob_new(NULL, buf, len);
blob = vips_blob_new(nullptr, buf, len);
options = (options ? options : VImage::option())->set("buffer", blob)->set("width", width)->set("out", &out);
vips_area_unref(VIPS_AREA(blob));

Expand Down
4 changes: 2 additions & 2 deletions cplusplus/gen-operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# pip install --user pyvips

# Sample member declaration:
# VImage invert(VOption *options = 0) const;
# VImage invert(VOption *options = nullptr) const;

# Sample member definition:
# VImage
Expand Down Expand Up @@ -171,7 +171,7 @@ def generate_operation(operation_name, declaration_only=False, indent=''):
spacing = '' if cpp_type.endswith(cplusplus_suffixes) else ' '
result += f'{cpp_type}{spacing}*{cppize(name)}, '

result += f'VOption *options{" = 0" if declaration_only else ""})'
result += f'VOption *options{" = nullptr" if declaration_only else ""})'

# if no 'this' available, it's a class method and they are all const
if intro.member_x is not None:
Expand Down
4 changes: 2 additions & 2 deletions cplusplus/include/vips/VConnection8.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class VSource : public VObject {
/**
* Wrap a VSource around an underlying VipsSource object.
*/
VSource(VipsSource *input, VSteal steal = STEAL)
explicit VSource(VipsSource *input, VSteal steal = STEAL)
: VObject((VipsObject *) input, steal)
{
}
Expand Down Expand Up @@ -106,7 +106,7 @@ class VTarget : public VObject {
/**
* Wrap a VTarget around an underlying VipsTarget object.
*/
VTarget(VipsTarget *output, VSteal steal = STEAL)
explicit VTarget(VipsTarget *output, VSteal steal = STEAL)
: VObject((VipsObject *) output, steal)
{
}
Expand Down
Loading

0 comments on commit 4876673

Please sign in to comment.