# - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
Transforms.VectorToImage
"""

import numbers

from ..utils.entrypoints import EntryPoint
from ..utils.utils import try_set, unlist


def transforms_vectortoimage(
        column,
        data,
        output_data=None,
        model=None,
        contains_alpha=False,
        contains_red=True,
        contains_green=True,
        contains_blue=True,
        interleave_argb=False,
        image_width=0,
        image_height=0,
        offset=None,
        scale=None,
        **params):
    """
    **Description**
        Converts vector array into image type.

    :param column: New column definition(s) (optional form: name:src)
        (inputs).
    :param data: Input dataset (inputs).
    :param contains_alpha: Whether to use alpha channel (inputs).
    :param contains_red: Whether to use red channel (inputs).
    :param contains_green: Whether to use green channel (inputs).
    :param contains_blue: Whether to use blue channel (inputs).
    :param interleave_argb: Whether to separate each channel or
        interleave in ARGB order (inputs).
    :param image_width: Width of the image (inputs).
    :param image_height: Height of the image (inputs).
    :param offset: Offset (pre-scale) (inputs).
    :param scale: Scale factor (inputs).
    :param output_data: Transformed dataset (outputs).
    :param model: Transform model (outputs).
    """

    entrypoint_name = 'Transforms.VectorToImage'
    inputs = {}
    outputs = {}

    if column is not None:
        inputs['Column'] = try_set(
            obj=column,
            none_acceptable=False,
            is_of_type=list,
            is_column=True)
    if data is not None:
        inputs['Data'] = try_set(
            obj=data,
            none_acceptable=False,
            is_of_type=str)
    if contains_alpha is not None:
        inputs['ContainsAlpha'] = try_set(
            obj=contains_alpha,
            none_acceptable=True,
            is_of_type=bool)
    if contains_red is not None:
        inputs['ContainsRed'] = try_set(
            obj=contains_red,
            none_acceptable=True,
            is_of_type=bool)
    if contains_green is not None:
        inputs['ContainsGreen'] = try_set(
            obj=contains_green,
            none_acceptable=True,
            is_of_type=bool)
    if contains_blue is not None:
        inputs['ContainsBlue'] = try_set(
            obj=contains_blue,
            none_acceptable=True,
            is_of_type=bool)
    if interleave_argb is not None:
        inputs['InterleaveArgb'] = try_set(
            obj=interleave_argb,
            none_acceptable=True,
            is_of_type=bool)
    if image_width is not None:
        inputs['ImageWidth'] = try_set(
            obj=image_width,
            none_acceptable=True,
            is_of_type=numbers.Real)
    if image_height is not None:
        inputs['ImageHeight'] = try_set(
            obj=image_height,
            none_acceptable=True,
            is_of_type=numbers.Real)
    if offset is not None:
        inputs['Offset'] = try_set(
            obj=offset,
            none_acceptable=True,
            is_of_type=numbers.Real)
    if scale is not None:
        inputs['Scale'] = try_set(
            obj=scale,
            none_acceptable=True,
            is_of_type=numbers.Real)
    if output_data is not None:
        outputs['OutputData'] = try_set(
            obj=output_data,
            none_acceptable=False,
            is_of_type=str)
    if model is not None:
        outputs['Model'] = try_set(
            obj=model,
            none_acceptable=False,
            is_of_type=str)

    input_variables = {
        x for x in unlist(inputs.values())
        if isinstance(x, str) and x.startswith("$")}
    output_variables = {
        x for x in unlist(outputs.values())
        if isinstance(x, str) and x.startswith("$")}

    entrypoint = EntryPoint(
        name=entrypoint_name, inputs=inputs, outputs=outputs,
        input_variables=input_variables,
        output_variables=output_variables)
    return entrypoint
