Skip to content

Commit

Permalink
add hyperbolic trig functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jcupitt committed Nov 2, 2021
1 parent 88e737c commit e705f88
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* `write_to_buffer` tries to use the new target API, then falls back to the old
buffer system [jcupitt]
* don't generate yard docs for deprecated args [jcupitt]
* add hyperbolic trig functions [jcupitt]

## Version 2.1.3 (2021-8-23)

Expand Down
44 changes: 43 additions & 1 deletion lib/vips/image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def write_to_buffer format_string, **opts
end

if !saver.nil?
target = Vips::Target::new_to_memory
target = Vips::Target.new_to_memory
Vips::Operation.call saver, [self, target], opts, option_string
buffer = target.get("blob")
else
Expand Down Expand Up @@ -1450,6 +1450,48 @@ def atan
math :atan
end

# Return the hyperbolic sine of an image in radians.
#
# @return [Image] sine of each pixel
def sinh
math :sinh
end

# Return the hyperbolic cosine of an image in radians.
#
# @return [Image] cosine of each pixel
def cosh
math :cosh
end

# Return the hyperbolic tangent of an image in radians.
#
# @return [Image] tangent of each pixel
def tanh
math :tanh
end

# Return the inverse hyperbolic sine of an image in radians.
#
# @return [Image] inverse sine of each pixel
def asinh
math :asinh
end

# Return the inverse hyperbolic cosine of an image in radians.
#
# @return [Image] inverse cosine of each pixel
def acosh
math :acosh
end

# Return the inverse hyperbolic tangent of an image in radians.
#
# @return [Image] inverse tangent of each pixel
def atanh
math :atanh
end

# Return the natural log of an image.
#
# @return [Image] natural log of each pixel
Expand Down
4 changes: 2 additions & 2 deletions lib/vips/operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module Vips
class Introspect
attr_reader :name, :description, :flags, :args, :required_input,
:optional_input, :required_output, :optional_output, :member_x,
:method_args, :vips_name, :destructive, :doc_optional_input,
:method_args, :vips_name, :destructive, :doc_optional_input,
:doc_optional_output

@@introspect_cache = {}
Expand Down Expand Up @@ -168,7 +168,7 @@ def add_yard_introspection name
end
end

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

0 comments on commit e705f88

Please sign in to comment.