{"id":28415495,"url":"https://github.com/islatri/gxci","last_synced_at":"2025-08-23T14:11:59.306Z","repository":{"id":247986747,"uuid":"800311072","full_name":"Islatri/gxci","owner":"Islatri","description":"Rust HAL and raw-wrapped API to use with Daheng Industrial Camera (Based on GxIAPI). Galaxy Camera Interface. Rust的大恒相机接口的HAL封装与原生实现接口","archived":false,"fork":false,"pushed_at":"2025-03-13T03:43:29.000Z","size":6054,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-22T03:55:46.695Z","etag":null,"topics":["camera-api","daheng-imaging","hal","industrial-camera","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Islatri.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-14T05:11:15.000Z","updated_at":"2025-06-12T17:51:41.000Z","dependencies_parsed_at":"2024-09-17T19:05:22.339Z","dependency_job_id":"0cee96fa-f89c-4d65-8ac0-d7c1abd6c147","html_url":"https://github.com/Islatri/gxci","commit_stats":null,"previous_names":["zoneherobrine/gxci","islatri/gxci"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Islatri/gxci","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Islatri%2Fgxci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Islatri%2Fgxci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Islatri%2Fgxci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Islatri%2Fgxci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Islatri","download_url":"https://codeload.github.com/Islatri/gxci/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Islatri%2Fgxci/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271751917,"owners_count":24814705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["camera-api","daheng-imaging","hal","industrial-camera","rust"],"created_at":"2025-06-03T16:40:53.693Z","updated_at":"2025-08-23T14:11:59.284Z","avatar_url":"https://github.com/Islatri.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033 MD041 MD045 MD026 --\u003e\n\u003cp align=\"center\" dir=\"auto\"\u003e\n    \u003cimg style=\"height:240px;width:240px\"  src=\"https://s2.loli.net/2024/09/08/uDKESYW7ks9eRyf.png\" alt=\"Logo逃走啦~\"/\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\" tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eGXCI\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://crates.io/crates/gxci\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/gxci\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://docs.rs/gxci\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/docsrs/gxci/0.3.8\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/islatri/gxci\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg\"/\u003e\u003c/a\u003e\n\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    Rust-based safe interface development for Daheng Industrial Camera GxIAPI\n\u003c/p\u003e\n\n\u003chr /\u003e\n\n# Now, the document site is available\n\n1. English: [https://hakochest.github.io/gxci-en/](https://hakochest.github.io/gxci-en/)\n2. 中文: [https://hakochest.github.io/gxci-cn/](https://hakochest.github.io/gxci-cn/)\n\n# Introduction\n\ngxci(Galaxy Camera Interface)是一款用Rust基于大恒工业相机GxIAPI的库进行的接口开发;\n\n目前已实现USB单相机的HAL库封装，raw内包含着C语言接口除去网络相机的全部内容(句柄、常量、结构、枚举、回调函数等)的直接rust实现；HAL内做了硬件抽象层的封装(目前包括连接、采图、推流)，适合实际开发使用；utils内则是一些工具类函数(常用的Builder模式和Facade模式函数封装);\n\nGxci (Galaxy Camera Interface) is an interface developed using Rust based on the Daxi API library of Daheng Industrial Camera;\n\nAt present, HAL library encapsulation for USB single camera has been implemented, and raw contains a direct Rust implementation of all contents (handles, constants, structures, enumerations, callback functions, etc.) of the C language interface except for the network camera; HAL has encapsulated the hardware abstraction layer (currently including connections, image capture, and streaming), which is suitable for practical development and use; Inside the utilities are some utility class functions (encapsulated with commonly used Builder and Facade pattern functions);\n\n# Overview\n\nYou can get the sdk-dev-doc from the SDK of Daheng Imaging you have installed.\n\n# Quick Start\n\n1. Ensure you have OpenCV Rust Bindings installed.\n2. Ensure your camera version is supported by the GxIAPI SDK,and ensure you have installed the GxIAPI SDK.\n\nthe document of the environment config is follow the quick start part.\n\nin your Cargo.toml, add the following dependencies:\n\n```toml\n[dependencies]\ngxci = \"0.3.7\"\n# It default with the feature \"solo\" and \"use-opencv\", and now there're only this two features can be used.\n```\n\nThe solo feature can simplify some operation if you only have one camera, because it will default to the first camera in all functions.\n\nthen, you can use the following code to get a single image from the camera and save it as png.\n\n```rust\nuse gxci::hal::device::*;\nuse gxci::hal::base::*;\nuse gxci::hal::control::analog::gxi_set_gain_auto_continuous;\nuse gxci::utils::debug::print_device_info;\n\nfn main()-\u003eResult\u003c()\u003e {\n    gxci_init_default()?;\n\n    let device_num = gxi_count_devices(1000)?;\n    println!(\"Device number: {}\", device_num);\n\n    let base_info = gxi_list_devices()?;\n    for device in \u0026base_info {\n        print_device_info(\u0026device);\n    }\n    \n    gxi_open_device()?;\n\n    gxi_set_gain_auto_continuous()?;\n\n    gxi_get_image()?;\n\n    gxi_save_image_as_png(\"test.png\")?;\n\n    gxi_close_device()?;\n\n    gxci_close()?;\n\n    Ok(())\n}\n```\n\nThe terminal output should be like this:\n\n```powershell\nPS C:\\Users\\Chest\\Documents\\GitHub\\crate_zone\\gxci\u003e cargo run --example hal_get_image\n    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.13s\n     Running `target\\debug\\examples\\hal_get_image.exe`\nInitializing GXI with DLL path: C:\\Program Files\\Daheng Imaging\\GalaxySDK\\APIDll\\Win64\\GxIAPI.dll\nDevice number: 1\np_device_info: 0x1d10264e0b0, p_buffer_size: 0x69120ff590\nVendor Name: Daheng Imaging\nModel Name: MER-050-560U3C\nSerial Number: KJ0180110048\nDisplay Name: MER-050-560U3C(KJ0180110048)\nDevice ID: MER-050-560U3C(KJ0180110048)\nUser ID:\nAccess Status: GX_ACCESS_STATUS_UNKNOWN\nDevice Class: GX_DEVICE_CLASS_U3V\n-----------------------\nSuccessfully opened device index 1\nSuccessfully sent command\nint_value: 0x69120fefd8\nint_value: 0x69120fefe0\nenum_value: 0x69120feff8\nenum_value: 0x69120fefe8\nint_value: 0x69120feff0\np_frame_data: 0x69120ff448\nframe_data: GX_FRAME_DATA { nStatus: 0, pImgBuf: 0x1d1042c6040, nWidth: 640, nHeight: 480, nPixelFormat: 17301513, nImgSize: 2457600, nFrameID: 0, nTimestamp: 0, reserved: [17301513] }\nSuccessfully sent command\nSuccessfully got image\nImage saved successfully.\nSuccessfully closed device\n```\n\nif your camera is as the following:\n\n![图片逃走啦~](https://s2.loli.net/2024/09/08/QHiIKXd4c7MSegR.png)\n\nthen you will get a test.png as\n\n![图片逃走啦~](https://s2.loli.net/2024/09/08/zxBCpr59XD74UIq.png)\n\nmore codes just see the examples and document.\n\n# Platform Support\n\nNow, is Windows only.\n\n# Licensing\n\nLicensed under the MIT License.\n\n# Contributing\n\nIf you have any questions, please issue it.\n\nIf you want to contribute, please fork it and pull request.\n\nIf you want to contact me, you can email me: `zoneherobrine@gmail.com`;\n\nor by Tencent QQ: 2212540603 (with related information in the friend request)\n\n# Acknowledgments\n\nGXCI(GalaXy Camera Interface)的命名要感谢[MoonWX](https://github.com/MoonWX)同学的建议，这是一个简洁明确并且很帅的名字ヽ(・∀・)ﾉ；\n\n同时也感谢同专业李同学的帮助，在gx_enum的冗长的类型转换中，他与我协力在十分钟之内完成了C枚举到Rust枚举的转换；\n\n也感谢[西西](https://github.com/Ben-Phantom)帮忙找的免费图床网站，进一步压缩了包的大小( - ω - )\n\nAlso thanks to OpenAI's GPT model DELTA·E for drawing the cool LOGO :D\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislatri%2Fgxci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fislatri%2Fgxci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fislatri%2Fgxci/lists"}