/*
 * Copyright 2024 KylinSoft Co., Ltd.
 *
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef __KYLIN_AI_GEN_AI_VISION_IMAGE_H__
#define __KYLIN_AI_GEN_AI_VISION_IMAGE_H__

#include <kylin-ai/common/macros.h>

#include "imageconfig.h"
#include "imageresult.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef void (*ImageResultCallback)(VisionImageResult *image_data,
                                    void *user_data);
typedef struct _GenAiImageSession GenAiImageSession;

AISDK_EXTERN
GenAiImageSession *genai_image_create_session();

AISDK_EXTERN
void genai_image_destroy_session(GenAiImageSession **session);

AISDK_EXTERN
int genai_image_init_session(GenAiImageSession *session);

AISDK_EXTERN
void genai_image_set_config(GenAiImageSession *session, ImageConfig *config);

AISDK_EXTERN
void genai_image_result_set_callback(GenAiImageSession *session,
                                     ImageResultCallback callback,
                                     void *user_data);

AISDK_EXTERN
const char **genai_image_get_supported_image_style(GenAiImageSession *session,
                                                   int *number);

AISDK_EXTERN
const ImageSize *genai_image_get_supported_image_size(
    GenAiImageSession *session, int *number);

AISDK_EXTERN
int genai_image_get_supported_image_number(GenAiImageSession *session);

AISDK_EXTERN
void genai_image_generate_image_async(GenAiImageSession *session,
                                      const char *prompt);

#ifdef __cplusplus
}
#endif

#endif
