Skip to content

Commit

Permalink
Update for itrunc->trunc
Browse files Browse the repository at this point in the history
See JuliaLang/julia#9133
This uses Compat to ensure backwards-compatibility
  • Loading branch information
timholy committed Nov 30, 2014
1 parent 6a6df43 commit 9ce88e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/colormatch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ function interpolate_table(tbl, start, step, wavelen)
stop = start + step * (n - 1)
i = (wavelen - start) / step

a = ifloor(i) + 1
a = floor(Integer, i) + 1
ac = 1 <= a <= n ? tbl[a,:] : [0.0 0.0 0.0]

b = iceil(i) + 1
b = ceil(Integer, i) + 1
bc = 1 <= b <= n ? tbl[b,:] : [0.0 0.0 0.0]

p = i % 1.0
Expand Down
8 changes: 4 additions & 4 deletions src/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,9 @@ convert{T}(::Type{LMS{T}}, c::ColorValue) = convert(LMS{T}, convert(XYZ{T}, c))
# -------------------

convert(::Type{RGB24}, c::AbstractRGB{Ufixed8}) = RGB24(c.r, c.g, c.b)
convert(::Type{RGB24}, c::AbstractRGB) = RGB24(iround(Uint32, 255*c.r)<<16 +
iround(Uint32, 255*c.g)<<8 +
iround(Uint32, 255*c.b))
convert(::Type{RGB24}, c::AbstractRGB) = RGB24(round(Uint32, 255*c.r)<<16 +
round(Uint32, 255*c.g)<<8 +
round(Uint32, 255*c.b))
to32(x::Ufixed8) = convert(Uint32, reinterpret(x))
convert(::Type{RGB24}, val::Uint32) = RGB24(val & 0x00ffffff)

Expand Down Expand Up @@ -705,7 +705,7 @@ convert(::Type{ARGB32}, c::ARGB32) = c
convert{CV<:AbstractRGB{Ufixed8}}(::Type{ARGB32}, c::AbstractAlphaColorValue{CV,Ufixed8}) =
ARGB32(c.c.r, c.c.g, c.c.b, c.alpha)
convert(::Type{ARGB32}, c::AbstractAlphaColorValue) =
ARGB32(convert(RGB24, c.c).color | iround(Uint32, 255*c.alpha)<<24)
ARGB32(convert(RGB24, c.c).color | round(Uint32, 255*c.alpha)<<24)
convert(::Type{ARGB32}, c::ColorValue) = ARGB32(convert(RGB24, c).color | 0xff000000)
convert(::Type{ARGB32}, val::Uint32) = ARGB32(val)

Expand Down

0 comments on commit 9ce88e9

Please sign in to comment.