Sha256: 76913f0f8add596562adbe1fafb5af5f1d26c7779f8d2317d21ed2a67668392f

Contents?: true

Size: 1.1 KB

Versions: 12

Compression:

Stored size: 1.1 KB

Contents

# This module provides an interface to the top level bits of libvips
# via ruby-ffi.
#
# Author::    John Cupitt  (mailto:jcupitt@gmail.com)
# License::   MIT

require "ffi"

module Vips
  if Vips.at_least_libvips?(8, 9)
    attach_function :vips_connection_filename, [:pointer], :string
    attach_function :vips_connection_nick, [:pointer], :string
  end

  # Abstract base class for connections.
  class Connection < Vips::Object
    # The layout of the VipsRegion struct.
    module ConnectionLayout
      def self.included(base)
        base.class_eval do
          layout :parent, Vips::Object::Struct
          # rest opaque
        end
      end
    end

    class Struct < Vips::Object::Struct
      include ConnectionLayout
    end

    class ManagedStruct < Vips::Object::ManagedStruct
      include ConnectionLayout
    end

    # Get any filename associated with a connection, or nil.
    def filename
      Vips.vips_connection_filename self
    end

    # Get a nickname (short description) of a connection that could be shown to
    # the user.
    def nick
      Vips.vips_connection_nick self
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/ruby-vips-2.2.1/lib/vips/connection.rb
ruby-vips-2.2.2 lib/vips/connection.rb
ruby-vips-2.2.1 lib/vips/connection.rb
vips-8.15.1 lib/vips/connection.rb
ruby-vips-2.2.0 lib/vips/connection.rb
vips-8.12.2 lib/vips/connection.rb
vips-8.12.1 lib/vips/connection.rb
ruby-vips-2.1.4 lib/vips/connection.rb
ruby-vips-2.1.3 lib/vips/connection.rb
ruby-vips-2.1.2 lib/vips/connection.rb
ruby-vips-2.1.1 lib/vips/connection.rb
ruby-vips-2.1.0 lib/vips/connection.rb