Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@koala123/aoi-db

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@koala123/aoi-db

AOIDB模块

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Description

AOIDB模块

此模块依赖anomaly.dll与og-common.dll库

Usage

Installation

$ npm install @koala/aoi-db
// app.module.ts
import { AOIDBModule } from '@koala/aoi-db';

@Module({
  imports: [
    AOIDBModule.forRoot({
      /** dllPath;默认值:D:/kl-storage/dll/ */
      dllPath: 'D:/kl-storage/dll/',
      /** db路径;默认值:D:/kl-storage/gallery/db/ */
      dbPath: 'D:/kl-storage/gallery/db/',
      /** 引擎宽;默认值:5120 */
      width: 5120,
      /** 引擎高;默认值:5120 */
      height: 5120,
      /** 引擎通道;默认值:3 */
      channel: 3,
      /** 特征维度;默认值:384 */
      featureDIM: 384,
      /** 特征小图高;默认值:256 */
      featureWidth: 256,
      /** 特征小图宽;默认值:256 */
      featureHeight: 256,
      /** 外环切区域不能用于注册,注册无效区域(防呆区域);默认值64 */
      deadproofArea: 64,
    })
  ],
  controllers: [AppController],
  providers: [AppService],
})

// app.service.ts
import { AOIDBService } from '@koala/aoi-db'
@Injectable()
export class AppService {
  constructor(
    public aoiDBService: AOIDBService,
  ) {
    // 加载test.db
    console.log(this.aoiDBService.load('test.db'))
  }
}

AOIDBService API

  • 初始化引擎
initEngine(): Promise<boolean>;
  • 销毁引擎
destroyEngine(): boolean;
  • 导出数据
interface Feature {
  id: number;
  type: number;
  feature: string;
}
exportDB(db: string, exportFeature?: boolean): Promise<Feature[]>;
  • 查找所有db
findAll(): Promise<string[]>;
  • 加载DB到内存中,不存在则创建一个新的DB
/**
 * 加载DB到内存中,不存在则创建一个新的DB
 * @param db db路径;若父目录不存在,则创建失败;db目录是相对${dbPath}
 * @param releaseFirst load之前先releaseDB
 * @returns db的条目总数
 */
load(db: string, releaseFirst?: boolean): Promise<number>
  • 释放DB
/**
 * 释放DB
 * @param db db路径
 * @returns 此操作是否成功
 */
release(db: string): Promise<boolean>;
  • 删除db文件
/**
 * 删除db文件
 * @param db db路径
 * @returns 操作是否成功
 */
delete(db: string): Promise<boolean>;

更多请查看./dist/app.service.d.ts

Router

运行之后查看/aoiDB/

FAQs

Package last updated on 14 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc