# Copyright (C) 2024 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build/ohos.gni")
import("//foundation/multimedia/image_framework/ide/image_decode_config.gni")

config("native_public_config") {
  include_dirs = [
    "include",
    "${image_subsystem}/interfaces/kits/native/include/image",
    "${image_subsystem}/frameworks/innerkitsimpl/receiver/include",
  ]
}

ohos_shared_library("ohimage") {
  sanitize = {
    cfi = true
    cfi_cross_dso = true
    cfi_vcall_icall_only = true
    debug = false
  }

  cflags = [
    "-DIMAGE_COLORSPACE_FLAG",
  ]

  output_name = "ohimage"
  output_extension = "so"

  sources = [ "image_native.cpp" ]
  public_configs = [ ":native_public_config" ]
  deps = [
    "${image_subsystem}/frameworks/innerkitsimpl/utils:image_utils",
    "${image_subsystem}/interfaces/innerkits:image_native",
  ]

  external_deps = [
    "c_utils:utils",
    "drivers_interface_display:libdisplay_commontype_proxy_1.0",
    "graphic_surface:surface",
    "graphic_2d:libnative_color_space_manager",
    "hilog:libhilog",
    "ipc:ipc_single",
  ]

  innerapi_tags = [ "ndk" ]
  subsystem_name = "multimedia"
  part_name = "image_framework"
}

ohos_shared_library("image_receiver") {
  sanitize = {
    cfi = true
    cfi_cross_dso = true
    cfi_vcall_icall_only = true
    debug = false
  }
  output_name = "image_receiver"
  output_extension = "so"

  sources = [ "image_receiver_native.cpp" ]
  public_configs = [ ":native_public_config" ]
  deps = [
    "${image_subsystem}/frameworks/innerkitsimpl/utils:image_utils",
    "${image_subsystem}/interfaces/innerkits:image_native",
  ]

  external_deps = [
    "c_utils:utils",
    "graphic_surface:surface",
    "hilog:libhilog",
    "ipc:ipc_single",
  ]

  innerapi_tags = [ "ndk" ]
  subsystem_name = "multimedia"
  part_name = "image_framework"
}