imagequant: define more consts, move const definitions near their callers
This commit is contained in:
parent
40cdd10721
commit
0f93198ae1
@ -23,6 +23,11 @@ func NewAttributes() (*Attributes, error) {
|
||||
return &Attributes{p: pAttr}, nil
|
||||
}
|
||||
|
||||
const (
|
||||
COLORS_MIN = 2
|
||||
COLORS_MAX = 256
|
||||
)
|
||||
|
||||
func (this *Attributes) SetMaxColors(colors int) error {
|
||||
return translateError(C.liq_set_max_colors(this.p, C.int(colors)))
|
||||
}
|
||||
@ -31,6 +36,11 @@ func (this *Attributes) GetMaxColors() int {
|
||||
return int(C.liq_get_max_colors(this.p))
|
||||
}
|
||||
|
||||
const (
|
||||
QUALITY_MIN = 0
|
||||
QUALITY_MAX = 100
|
||||
)
|
||||
|
||||
func (this *Attributes) SetQuality(minimum, maximum int) error {
|
||||
return translateError(C.liq_set_quality(this.p, C.int(minimum), C.int(maximum)))
|
||||
}
|
||||
@ -43,6 +53,12 @@ func (this *Attributes) GetMaxQuality() int {
|
||||
return int(C.liq_get_max_quality(this.p))
|
||||
}
|
||||
|
||||
const (
|
||||
SPEED_SLOWEST = 1
|
||||
SPEED_DEFAULT = 3
|
||||
SPEED_FASTEST = 10
|
||||
)
|
||||
|
||||
func (this *Attributes) SetSpeed(speed int) error {
|
||||
return translateError(C.liq_set_speed(this.p, C.int(speed)))
|
||||
}
|
||||
|
@ -58,9 +58,3 @@ func GetLibraryVersion() int {
|
||||
func GetLibraryVersionString() string {
|
||||
return C.GoString(C.liqVersionString())
|
||||
}
|
||||
|
||||
const (
|
||||
SPEED_SLOWEST = 1
|
||||
SPEED_DEFAULT = 3
|
||||
SPEED_FASTEST = 10
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user