unipdf/pdf/ps/handy.go
Gunnsteinn Hall b8a3ec7180 Initial colorspace and functions support.
Implementation of ps parser for function type 4.  Function type 3 not
implemented yet and type 0 needs a better interpolation. Functions and
colorspaces need more testing.
2017-02-22 21:10:57 +00:00

32 lines
416 B
Go

package ps
func MakeReal(val float64) PSObject {
obj := PSReal{}
obj.Val = val
return &obj
}
func MakeInteger(val int) PSObject {
obj := PSInteger{}
obj.Val = val
return &obj
}
func MakeBool(val bool) *PSBoolean {
obj := PSBoolean{}
obj.Val = val
return &obj
}
func MakeOperand(val string) *PSOperand {
obj := PSOperand(val)
return &obj
}
func abs(x int) int {
if x < 0 {
return -x
}
return x
}