Skip to content

Commit e705f88

Browse files
committed
add hyperbolic trig functions
1 parent 88e737c commit e705f88

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* `write_to_buffer` tries to use the new target API, then falls back to the old
88
buffer system [jcupitt]
99
* don't generate yard docs for deprecated args [jcupitt]
10+
* add hyperbolic trig functions [jcupitt]
1011

1112
## Version 2.1.3 (2021-8-23)
1213

lib/vips/image.rb

+43-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ def write_to_buffer format_string, **opts
634634
end
635635

636636
if !saver.nil?
637-
target = Vips::Target::new_to_memory
637+
target = Vips::Target.new_to_memory
638638
Vips::Operation.call saver, [self, target], opts, option_string
639639
buffer = target.get("blob")
640640
else
@@ -1450,6 +1450,48 @@ def atan
14501450
math :atan
14511451
end
14521452

1453+
# Return the hyperbolic sine of an image in radians.
1454+
#
1455+
# @return [Image] sine of each pixel
1456+
def sinh
1457+
math :sinh
1458+
end
1459+
1460+
# Return the hyperbolic cosine of an image in radians.
1461+
#
1462+
# @return [Image] cosine of each pixel
1463+
def cosh
1464+
math :cosh
1465+
end
1466+
1467+
# Return the hyperbolic tangent of an image in radians.
1468+
#
1469+
# @return [Image] tangent of each pixel
1470+
def tanh
1471+
math :tanh
1472+
end
1473+
1474+
# Return the inverse hyperbolic sine of an image in radians.
1475+
#
1476+
# @return [Image] inverse sine of each pixel
1477+
def asinh
1478+
math :asinh
1479+
end
1480+
1481+
# Return the inverse hyperbolic cosine of an image in radians.
1482+
#
1483+
# @return [Image] inverse cosine of each pixel
1484+
def acosh
1485+
math :acosh
1486+
end
1487+
1488+
# Return the inverse hyperbolic tangent of an image in radians.
1489+
#
1490+
# @return [Image] inverse tangent of each pixel
1491+
def atanh
1492+
math :atanh
1493+
end
1494+
14531495
# Return the natural log of an image.
14541496
#
14551497
# @return [Image] natural log of each pixel

lib/vips/operation.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module Vips
4848
class Introspect
4949
attr_reader :name, :description, :flags, :args, :required_input,
5050
:optional_input, :required_output, :optional_output, :member_x,
51-
:method_args, :vips_name, :destructive, :doc_optional_input,
51+
:method_args, :vips_name, :destructive, :doc_optional_input,
5252
:doc_optional_output
5353

5454
@@introspect_cache = {}
@@ -168,7 +168,7 @@ def add_yard_introspection name
168168
end
169169
end
170170

171-
# and make the arg sets to document by filtering out deprecated args
171+
# and make the arg sets to document by filtering out deprecated args
172172
@optional_input.each do |arg_name, details|
173173
next if (details[:flags] & ARGUMENT_DEPRECATED) != 0
174174
@doc_optional_input[details[:arg_name]] = details

0 commit comments

Comments
 (0)