Sha256: 52f54939a42b4bc224cab4095da79057ff909a0cc50d53a502ce4fa5f32d6082

Contents?: true

Size: 260 Bytes

Versions: 15

Compression:

Stored size: 260 Bytes

Contents

class PSD
  module Util
    extend self
    
    def pad2(i)
      (i + 1) & ~0x01
    end

    # Ensures value is a multiple of 4
    def pad4(i)
      ((i + 4) & ~0x03) - 1
    end

    def clamp(num, min, max)
      [min, num, max].sort[1]
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
bench9000-0.1 vendor/psd.rb/lib/psd/util.rb
psd-3.2.2 lib/psd/util.rb
psd-3.2.1 lib/psd/util.rb
psd-3.2.0 lib/psd/util.rb
psd-3.1.5 lib/psd/util.rb
psd-3.1.4 lib/psd/util.rb
psd-3.1.3 lib/psd/util.rb
psd-3.1.2 lib/psd/util.rb
psd-2.1.2 lib/psd/util.rb
psd-2.1.1 lib/psd/util.rb
psd-2.1.0 lib/psd/util.rb
psd-2.0.0 lib/psd/util.rb
psd-1.5.0 lib/psd/util.rb
psd-1.4.5 lib/psd/util.rb
psd-1.4.4 lib/psd/util.rb