From 0f93198ae16f6a219d98dd90274dcb9de0a59027 Mon Sep 17 00:00:00 2001 From: mappu Date: Thu, 24 Nov 2016 20:53:18 +1300 Subject: [PATCH] imagequant: define more consts, move const definitions near their callers --- Attributes.go | 16 ++++++++++++++++ imagequant.go | 6 ------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Attributes.go b/Attributes.go index 23ae418..f301d7c 100644 --- a/Attributes.go +++ b/Attributes.go @@ -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))) } diff --git a/imagequant.go b/imagequant.go index 9c42c23..77a0b52 100644 --- a/imagequant.go +++ b/imagequant.go @@ -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 -)