Class: Xberg::ImageOutputFormatHeif

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
ImageOutputFormat
Defined in:
lib/xberg/native.rb

Overview

Re-encode all extracted images as HEIF/HEIC at the given quality level.

Requires the heic feature. quality must be in 1..=100. Values outside this range are clamped and a warning is emitted. 80 is a reasonable default.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#qualityObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



177
178
179
# File 'lib/xberg/native.rb', line 177

def quality
  @quality
end

Class Method Details

.from_hash(hash) ⇒ Object



200
201
202
# File 'lib/xberg/native.rb', line 200

def self.from_hash(hash)
  new(quality: hash[:quality] || hash["quality"])
end

Instance Method Details

#heif?Boolean

Returns:

  • (Boolean)


194
# File 'lib/xberg/native.rb', line 194

def heif? = true

#jpeg?Boolean

Returns:

  • (Boolean)


190
# File 'lib/xberg/native.rb', line 190

def jpeg? = false

#native?Boolean

Returns:

  • (Boolean)


186
# File 'lib/xberg/native.rb', line 186

def native? = false

#png?Boolean

Returns:

  • (Boolean)


188
# File 'lib/xberg/native.rb', line 188

def png? = false

#svg?Boolean

Returns:

  • (Boolean)


196
197
198
# File 'lib/xberg/native.rb', line 196

def svg? = false
# @param hash [Hash] deserialized from the native extension
# @return [self]

#webp?Boolean

Returns:

  • (Boolean)


192
# File 'lib/xberg/native.rb', line 192

def webp? = false