CrImage::Math::Fixed::Int26_6
Inherits Struct / Value / Object
Int26_6 is a signed 26.6 fixed-point number.
Format: 26 bits for integer part, 6 bits for fractional part
- Integer range: -33554432 to 33554431
- Fractional precision: 1/64 (0.015625)
Used for sub-pixel positioning in font rendering and graphics.
Example:
# One and a quarter: 1 + 16/64 = 1.25
value = CrImage::Math::Fixed::Int26_6[1 << 6 + 1 << 4]
puts value.to_s # => "1:16"
Class methods
[](value : Number)
SourceInstance methods
%(y : Int26_6)
Source%(y : Number)
Source*(y : Int26_6)
Source*(y : Int32)
Source*(y : Number)
Source+(y : self)
Source+(y : Number)
Source-(y : Int26_6)
Source-(y : Number)
Source/(y : Int32)
Source//(y : Int26_6)
Source//(y : Number)
Source<(y : Int26_6)
Source<=(y : Int26_6)
Source==(y : Int26_6)
Source==(y : Number)
Source>(y : Int26_6)
Source>=(y : Int26_6)
Sourceceil
ceil returns the least integer value less than or equal to @val.
Its return is Int32, not Int26_6
floor
floor returns the greatest integer value less than or equal to @val.
Its return is Int32, not Int26_6
to_i
Sourceto_s
returns human-readable representation of 26.6 fixed-point number. For example, the number one-and-a-quarter becomes "1:16".