#! /usr/bin/env python

PACKAGE='jsk_perception'

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

font_enum = gen.enum([
    gen.const("FONT_HERSHEY_SIMPLEX", int_t, 0, "normal size sans-serif font"),
    gen.const("FONT_HERSHEY_PLAIN", int_t, 1, "small size sans-serif font"),
    gen.const("FONT_HERSHEY_DUPLEX", int_t, 2, "normal size sans-serif font (more complex than FONT_HERSHEY_SIMPLEX )"),
    gen.const("FONT_HERSHEY_COMPLEX", int_t, 3, "normal size serif font"),
    gen.const("FONT_HERSHEY_TRIPLEX", int_t, 4, "normal size serif font (more complex than FONT_HERSHEY_COMPLEX )"),
    gen.const("FONT_HERSHEY_COMPLEX_SMALL", int_t, 5, "smaller version of FONT_HERSHEY_COMPLEX"),
    gen.const("FONT_HERSHEY_SCRIPT_SIMPLEX", int_t, 6, "hand-writing style font"),
    gen.const("FONT_HERSHEY_SCRIPT_COMPLEX", int_t, 7, "more complex variant of FONT_HERSHEY_SCRIPT_SIMPLEX")],
                     "font")

interp_enum = gen.enum([
    gen.const("INTER_NEAREST", int_t, 0, "a nearest-neighbor interpolation"),
    gen.const("INTER_LINEAR", int_t, 1, "a bilinear interpolation"),
    gen.const("INTER_AREA", int_t, 2, "resampling using pixel area relation. It may be a preferred method for image decimation, as it gives moire-free results. But when the image is zoomed, it is similar to the INTER_NEAREST method."),
    gen.const("INTER_CUBIC", int_t, 3, "a bicubic interpolation over 4x4 pixel neighborhood"),
    gen.const("INTER_LANCZOS4", int_t, 4, "a Lanczos interpolation over 8x8 pixel neighborhood")],
                       "interpolation")


#       name    type     level     description     default      min      max
gen.add("approximate_sync", bool_t, 0, "Enable Approximate Sync", False)
gen.add("queue_size", int_t, 0, "Queue size for message synchronization", 100, 1, 1000)

gen.add("use_classification_result", bool_t, 0, "Use classification result for visualization", False)
gen.add("show_proba", bool_t, 0, "Show probability for each labels", True)

gen.add("rect_boldness", int_t, 0, "Boldness of rects", 2, 1, 10)

gen.add("font_path", str_t, 0, "Font path", "")
gen.add("label_size", double_t, 0, "Text size of labels", 1.0, 0.5, 60.0)
gen.add("label_boldness", double_t, 0, "Text boldness of labels", 2.0, 1, 10)
gen.add("label_font", int_t, 0, "Font for labels", 0, edit_method=font_enum)

gen.add("label_margin_factor", double_t, 0, "Factor for label margin", 1.1, 0.1, 10.0)

gen.add("resolution_factor", double_t, 0, "Factor for resolution", 1.0, 0.5, 5.0)
gen.add("interpolation_method", int_t, 0, "Interpolation method", 4, edit_method=interp_enum)

exit(gen.generate(PACKAGE, "jsk_perception", "DrawRects"))
