mirror of
https://github.com/unidoc/unipdf.git
synced 2025-04-29 13:48:54 +08:00

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.
32 lines
416 B
Go
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
|
|
}
|